-
Notifications
You must be signed in to change notification settings - Fork 13.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
rustdoc: improve crate-local inlining #32142
Conversation
91ea7c7
to
1953f4b
Compare
while let Some(id) = cx.map.get_enclosing_scope(node) { | ||
node = id; | ||
if !seen.insert(id) { | ||
break; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not quite sure why this is necessary. (rustdoc/viewpath-self.rs
is caught in an infinite loop otherwise)
7792679
to
18506c8
Compare
Thanks @mitaa! I wonder if we might be able to get away from dealing with the passes for now? Is there a use case where rustdoc is actually being called with various passes and this isn't working? I tend to view the passes in rustdoc as kinda a half-baked feature which wasn't ever really ready for prime time :( |
18506c8
to
7c98399
Compare
I've backed that commit out for now. The only thing rustdoc is doing "wrong" is overzealous inlining when it isn't required. It is definitely unfortunate that some passes have to currently to leak out like that such that various points in rustdoc need to have knowledge about them hardcoded in. |
This is actually a reexported implementation detail in the `rt::v1` module but rustdoc doesn't like reexporting items from `doc(hidden)` modules. Do what we'd end up doing anyway from an API perspective and make a public-facing `enum` that can be retranslated under the hood if necessary.
…excrichton rustdoc: improve crate-local inlining fixes rust-lang#28537 r? @alexcrichton
rustdoc: improve crate-local inlining fixes #28537 r? @alexcrichton
fixes #28537
r? @alexcrichton