Skip to content

Conversation

@GuillaumeGomez
Copy link
Member

@GuillaumeGomez GuillaumeGomez commented Jan 17, 2026

Supersedes #151237.
Follow-up of #151120.

The span overlapping approach wasn't good enough so instead we now check if the reexport itself has the deprecated attribute, and if so, we resolve the path to the reexport DefId, otherwise we resolve it on the reexported item's DefId.

cc @Zalathar
r? @lolbinarycat

@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 Jan 17, 2026
@rust-log-analyzer

This comment has been minimized.

@GuillaumeGomez GuillaumeGomez force-pushed the fix-rustdoc-ice-reexported-deprecated-note branch from 1fcf0c7 to 1faaa76 Compare January 17, 2026 16:16
@GuillaumeGomez
Copy link
Member Author

And fixed fmt...

@lolbinarycat
Copy link
Contributor

@bors r+

I don't see what would've caused an ICE in the last one except maybe the expect_def_id, in which case it's probably better to raise an error than use some fallback likely to cause improper resolution? This approach does look much more robust, though.

@rust-bors
Copy link
Contributor

rust-bors bot commented Jan 19, 2026

📌 Commit 1faaa76 has been approved by lolbinarycat

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 Jan 19, 2026
@GuillaumeGomez
Copy link
Member Author

@bors r+

I don't see what would've caused an ICE in the last one except maybe the expect_def_id, in which case it's probably better to raise an error than use some fallback likely to cause improper resolution? This approach does look much more robust, though.

The span of the item doesn't always contain the attribute (guess how I found out =D). So we tried to resolve the intra-doc link in the wrong scope, which ended very badly.

Zalathar added a commit to Zalathar/rust that referenced this pull request Jan 20, 2026
…ted-note, r=lolbinarycat

rustdoc: Fix ICE when deprecated note is not resolved on the correct `DefId`

Supersedes rust-lang#151237.
Follow-up of rust-lang#151120.

The `span` overlapping approach wasn't good enough so instead we now check if the reexport itself has the `deprecated` attribute, and if so, we resolve the path to the reexport `DefId`, otherwise we resolve it on the reexported item's `DefId`.

cc @Zalathar
r? @lolbinarycat
rust-bors bot pushed a commit that referenced this pull request Jan 20, 2026
Rollup of 8 pull requests

Successful merges:

 - #149587 (coverage: Sort the expansion tree to help choose a single BCB for child expansions)
 - #150071 (Add dist step for Enzyme)
 - #150288 (Add scalar support for offload)
 - #151091 (Add new "hide deprecated items" setting in rustdoc)
 - #151255 (rustdoc: Fix ICE when deprecated note is not resolved on the correct `DefId`)
 - #151375 (Fix terminal  width dependent tests)
 - #151384 (add basic `TokenStream` api tests)
 - #151391 (rustc-dev-guide subtree update)

r? @ghost
@Kobzol
Copy link
Member

Kobzol commented Jan 20, 2026

@bors p=10

Just in case the rollup currently being tested fails, as this causes errors in rustc-perf and blocks is CI.

@rust-bors rust-bors bot merged commit 0a5d1e8 into rust-lang:main Jan 20, 2026
11 checks passed
@rustbot rustbot added this to the 1.95.0 milestone Jan 20, 2026
rust-timer added a commit that referenced this pull request Jan 20, 2026
Rollup merge of #151255 - fix-rustdoc-ice-reexported-deprecated-note, r=lolbinarycat

rustdoc: Fix ICE when deprecated note is not resolved on the correct `DefId`

Supersedes #151237.
Follow-up of #151120.

The `span` overlapping approach wasn't good enough so instead we now check if the reexport itself has the `deprecated` attribute, and if so, we resolve the path to the reexport `DefId`, otherwise we resolve it on the reexported item's `DefId`.

cc @Zalathar
r? @lolbinarycat
@GuillaumeGomez GuillaumeGomez deleted the fix-rustdoc-ice-reexported-deprecated-note branch January 20, 2026 13:08
@Zalathar
Copy link
Member

Will this want a beta backport for 1.94?

The previous PR was merged before the 1.95 version bump, so I assume the new beta branch will still have the ICE.

@GuillaumeGomez
Copy link
Member Author

Arf, missed the release. Nominating for backport then. Thanks for the ping!

@GuillaumeGomez GuillaumeGomez added the beta-nominated Nominated for backporting to the compiler in the beta channel. label Jan 20, 2026
@Zalathar
Copy link
Member

Also note that the rollup had a bunch of doc perf regressions, though I imagine they're probably justified by the bugfix.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

beta-nominated Nominated for backporting to the compiler in the beta channel. 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.

6 participants