You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Intro of rustc_attr_parsing::attributes::prelude regressed "canonical" paths of certain well-known compiler items in rustdoc search #145870
This is likely an instance of #124608 (solved by rust-lang/rfcs#3011). However it might be worth discussing this recent and concrete regression in isolation.
rustdoc-search now considers this prelude to be the "canonical" location of these items. This means that searching for Symbol no longer renders rustc_span::span::Symbol as its first result:
but rustc_attr_parsing::attributes::prelude::Symbol:
To be clear, they still link to the same item, it's just no longer apparent where this item actually comes from. See also:
This isn't a super big deal (since most ppl use IDE auto-import instead of copy/pasting from API docs) but it might confuse new contributors who try to learn the internal compiler surface.
#[doc(no_inline)] on these re-exports doesn't help unfortunately, it would make it even worse actually and lead to said path / hyperlink pointing to a non-existing site.
Huh that's awful.... And it does that despite this module being inaccessible outside rustc_attr_parsing ? Because in most places you can't actually use this path to import these items at all
Maybe use #[doc(hidden)] for the prelude re-exports? That would also avoid rust-analyzer suggesting something like use rustc_attr_parsing::attributes::prelude::Symbol.
Activity
fmease commentedon Aug 26, 2025
This isn't a super big deal (since most ppl use IDE auto-import instead of copy/pasting from API docs) but it might confuse new contributors who try to learn the internal compiler surface.
fmease commentedon Aug 26, 2025
#[doc(no_inline)]on these re-exports doesn't help unfortunately, it would make it even worse actually and lead to said path / hyperlink pointing to a non-existing site.jdonszelmann commentedon Aug 26, 2025
Huh that's awful.... And it does that despite this module being inaccessible outside
rustc_attr_parsing? Because in most places you can't actually use this path to import these items at allfmease commentedon Aug 26, 2025
Yea, it's bad. The fact that it's private doesn't really matter here because we document the APIs with
--document-private-items, soobjorn3 commentedon Aug 26, 2025
Maybe use
#[doc(hidden)]for the prelude re-exports? That would also avoid rust-analyzer suggesting something likeuse rustc_attr_parsing::attributes::prelude::Symbol.fmease commentedon Aug 26, 2025
Could be worth a try 🤷
jdonszelmann commentedon Aug 26, 2025
Well within those modules I'd quite like the prelude to work. But I guess it's better than the current situation
Rollup merge of rust-lang#145937 - jdonszelmann:doc-hidden-prelude, r…
Unrolled build for #145937