Skip to content

Fix ice in rustdoc of private reexport#154453

Merged
rust-bors[bot] merged 1 commit intorust-lang:mainfrom
chenyukang:yukang-fix-154383
Mar 29, 2026
Merged

Fix ice in rustdoc of private reexport#154453
rust-bors[bot] merged 1 commit intorust-lang:mainfrom
chenyukang:yukang-fix-154383

Conversation

@chenyukang
Copy link
Copy Markdown
Member

@chenyukang chenyukang commented Mar 27, 2026

Fixes #154383

The root cause is rustdoc could still try to resolve links for source docs that resolver did not cache in ResolveDocLinks::Exported mode. The test case will not crash with --document-private-items option, which will use ResolveDocLinks::All.

The fix makes rustdoc skip link resolution based on the source DefId of each doc fragment, so its behavior stays aligned with resolver's logic here: https://github.com/chenyukang/rust/blob/dc5cb1719eed6ac9275fe93d914d32141606b2ac/compiler/rustc_resolve/src/late.rs#L685

@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue. labels Mar 27, 2026
@rustbot
Copy link
Copy Markdown
Collaborator

rustbot commented Mar 27, 2026

r? @notriddle

rustbot has assigned @notriddle.
They will have a look at your PR within the next two weeks and either review your PR or reassign to another reviewer.

Use r? to explicitly pick a reviewer

Why was this reviewer chosen?

The reviewer was selected based on:

  • Owners of files modified in this PR: rustdoc
  • rustdoc expanded to 9 candidates
  • Random selection from GuillaumeGomez, camelid, fmease, lolbinarycat, notriddle

@notriddle
Copy link
Copy Markdown
Contributor

@bors r+ rollup

@rust-bors
Copy link
Copy Markdown
Contributor

rust-bors bot commented Mar 28, 2026

📌 Commit dc5cb17 has been approved by notriddle

It is now in the queue for this repository.

@rust-bors rust-bors bot added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Mar 28, 2026
JonathanBrouwer added a commit to JonathanBrouwer/rust that referenced this pull request Mar 28, 2026
…triddle

Fix ice in rustdoc of private reexport

Fixes rust-lang#154383

The root cause is rustdoc could still try to resolve links for source docs that resolver did not cache in `ResolveDocLinks::Exported` mode. The test case will not crash with `--document-private-items` option, which will use `ResolveDocLinks::All`.

The fix makes rustdoc skip link resolution based on the source `DefId` of each doc fragment, so its behavior stays aligned with resolver's logic here: https://github.com/chenyukang/rust/blob/dc5cb1719eed6ac9275fe93d914d32141606b2ac/compiler/rustc_resolve/src/late.rs#L685
rust-bors bot pushed a commit that referenced this pull request Mar 28, 2026
…uwer

Rollup of 7 pull requests

Successful merges:

 - #147811 (naked functions: respect `function-sections`)
 - #153834 (Merge `fabsf16/32/64/128` into `fabs::<F>`)
 - #154043 (simd_fmin/fmax: make semantics and name consistent with scalar intrinsics)
 - #154494 (triagebot: add reminder for bumping CI LLVM stamp)
 - #153374 (Fix LegacyKeyValueFormat report from docker build: dist-x86_64)
 - #154320 (`trim_prefix` for paths)
 - #154453 (Fix ice in rustdoc of private reexport)
JonathanBrouwer added a commit to JonathanBrouwer/rust that referenced this pull request Mar 28, 2026
…triddle

Fix ice in rustdoc of private reexport

Fixes rust-lang#154383

The root cause is rustdoc could still try to resolve links for source docs that resolver did not cache in `ResolveDocLinks::Exported` mode. The test case will not crash with `--document-private-items` option, which will use `ResolveDocLinks::All`.

The fix makes rustdoc skip link resolution based on the source `DefId` of each doc fragment, so its behavior stays aligned with resolver's logic here: https://github.com/chenyukang/rust/blob/dc5cb1719eed6ac9275fe93d914d32141606b2ac/compiler/rustc_resolve/src/late.rs#L685
rust-bors bot pushed a commit that referenced this pull request Mar 28, 2026
…uwer

Rollup of 9 pull requests

Successful merges:

 - #150752 (Update libc to v0.2.183)
 - #153380 (stabilize new RangeFrom type and iterator)
 - #153834 (Merge `fabsf16/32/64/128` into `fabs::<F>`)
 - #154043 (simd_fmin/fmax: make semantics and name consistent with scalar intrinsics)
 - #154494 (triagebot: add reminder for bumping CI LLVM stamp)
 - #153374 (Fix LegacyKeyValueFormat report from docker build: dist-x86_64)
 - #154320 (`trim_prefix` for paths)
 - #154453 (Fix ice in rustdoc of private reexport)
 - #154515 (Notify stdarch maintainers on changes in std_detect)
rust-bors bot pushed a commit that referenced this pull request Mar 29, 2026
Rollup of 9 pull requests

Successful merges:

 - #153380 (stabilize new RangeFrom type and iterator)
 - #153834 (Merge `fabsf16/32/64/128` into `fabs::<F>`)
 - #154043 (simd_fmin/fmax: make semantics and name consistent with scalar intrinsics)
 - #154494 (triagebot: add reminder for bumping CI LLVM stamp)
 - #153374 (Fix LegacyKeyValueFormat report from docker build: dist-x86_64)
 - #154320 (`trim_prefix` for paths)
 - #154453 (Fix ice in rustdoc of private reexport)
 - #154504 (move many tests from `structs-enums` to `structs` or `enum`)
 - #154515 (Notify stdarch maintainers on changes in std_detect)
@rust-bors rust-bors bot merged commit 0ba684b into rust-lang:main Mar 29, 2026
11 checks passed
@rustbot rustbot added this to the 1.96.0 milestone Mar 29, 2026
rust-timer added a commit that referenced this pull request Mar 29, 2026
Rollup merge of #154453 - chenyukang:yukang-fix-154383, r=notriddle

Fix ice in rustdoc of private reexport

Fixes #154383

The root cause is rustdoc could still try to resolve links for source docs that resolver did not cache in `ResolveDocLinks::Exported` mode. The test case will not crash with `--document-private-items` option, which will use `ResolveDocLinks::All`.

The fix makes rustdoc skip link resolution based on the source `DefId` of each doc fragment, so its behavior stays aligned with resolver's logic here: https://github.com/chenyukang/rust/blob/dc5cb1719eed6ac9275fe93d914d32141606b2ac/compiler/rustc_resolve/src/late.rs#L685
github-actions bot pushed a commit to rust-lang/miri that referenced this pull request Mar 29, 2026
Rollup of 9 pull requests

Successful merges:

 - rust-lang/rust#153380 (stabilize new RangeFrom type and iterator)
 - rust-lang/rust#153834 (Merge `fabsf16/32/64/128` into `fabs::<F>`)
 - rust-lang/rust#154043 (simd_fmin/fmax: make semantics and name consistent with scalar intrinsics)
 - rust-lang/rust#154494 (triagebot: add reminder for bumping CI LLVM stamp)
 - rust-lang/rust#153374 (Fix LegacyKeyValueFormat report from docker build: dist-x86_64)
 - rust-lang/rust#154320 (`trim_prefix` for paths)
 - rust-lang/rust#154453 (Fix ice in rustdoc of private reexport)
 - rust-lang/rust#154504 (move many tests from `structs-enums` to `structs` or `enum`)
 - rust-lang/rust#154515 (Notify stdarch maintainers on changes in std_detect)
github-actions bot pushed a commit to rust-lang/stdarch that referenced this pull request Mar 30, 2026
Rollup of 9 pull requests

Successful merges:

 - rust-lang/rust#153380 (stabilize new RangeFrom type and iterator)
 - rust-lang/rust#153834 (Merge `fabsf16/32/64/128` into `fabs::<F>`)
 - rust-lang/rust#154043 (simd_fmin/fmax: make semantics and name consistent with scalar intrinsics)
 - rust-lang/rust#154494 (triagebot: add reminder for bumping CI LLVM stamp)
 - rust-lang/rust#153374 (Fix LegacyKeyValueFormat report from docker build: dist-x86_64)
 - rust-lang/rust#154320 (`trim_prefix` for paths)
 - rust-lang/rust#154453 (Fix ice in rustdoc of private reexport)
 - rust-lang/rust#154504 (move many tests from `structs-enums` to `structs` or `enum`)
 - rust-lang/rust#154515 (Notify stdarch maintainers on changes in std_detect)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[ICE]: "no resolutions for a doc link" on intra-doc link in pub use inside private module

3 participants