Skip to content

Conversation

GoldsteinE
Copy link
Contributor

@GoldsteinE GoldsteinE commented Oct 20, 2025

For cases like

fn foo() {
    impl<E> Trait for Bar<E>
    where E: Baz {}
}

hir_enclosing_body_owner() in rustdoc considered fn foo() to be the “enclosing body” of E, which caused to to produce HirIds for E with owner set to fn foo() instead of the impl. This instead treats E as having no enclosing body.

r? @GuillaumeGomez as the author of this logic, I’m not 100% I understood it correctly.

Fixes #147882.
Fixes #147057.

@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. T-rustdoc-frontend Relevant to the rustdoc-frontend team, which will review and decide on the web UI/UX output. labels Oct 20, 2025
@GoldsteinE GoldsteinE force-pushed the fix/rustdoc-ice-147882 branch from 206b202 to fed595d Compare October 20, 2025 15:24
@GuillaumeGomez
Copy link
Member

I'll side step here and let @fmease review this as they're the expert of this topic.

r? fmease

@rustbot rustbot assigned fmease and unassigned GuillaumeGomez Oct 20, 2025
@rustbot
Copy link
Collaborator

rustbot commented Oct 20, 2025

fmease is currently at their maximum review capacity.
They may take a while to respond.

@fmease
Copy link
Member

fmease commented Oct 20, 2025

Haven't looked at the impl yet; I guess this also fixes #147057 cuz #147882 is likely a dupe of the former?

@GoldsteinE
Copy link
Contributor Author

I’ve checked this, and yes, it fixes #147057. Updated the top post accordingly.

@GoldsteinE GoldsteinE force-pushed the fix/rustdoc-ice-147882 branch from fed595d to aec6f97 Compare October 20, 2025 16:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

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. T-rustdoc-frontend Relevant to the rustdoc-frontend team, which will review and decide on the web UI/UX output.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Internal compiler error when building docs for serde_with@3.14.1 on nightly rustdoc: ICE: [trying to look up a HirId in the wrong context]

4 participants