-
Notifications
You must be signed in to change notification settings - Fork 13.1k
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
fix intra-doc links on nested use
and extern crate
items
#113958
Conversation
r? @davidtwco (rustbot has picked a reviewer for you, use r? to override) |
Looks good to me, thanks! Might be worth to have @petrochenkov take a look as well. |
r=me after fixing the articles. |
@bors r=GuillaumeGomez,petrochenkov |
☀️ Test successful - checks-actions |
Finished benchmarking commit (beef07f): comparison URL. Overall result: ❌✅ regressions and improvements - no action needed@rustbot label: -perf-regression Instruction countThis is a highly reliable metric that was used to determine the overall result at the top of this comment.
Max RSS (memory usage)ResultsThis is a less reliable metric that may be of interest but was not used to determine the overall result at the top of this comment.
CyclesThis benchmark run did not return any relevant results for this metric. Binary sizeThis benchmark run did not return any relevant results for this metric. Bootstrap: 652.747s -> 650.991s (-0.27%) |
This PR fixes two rustdoc ICEs that happen if there are any intra-doc links on nested
use
orextern crate
items, for example:Nested use items were incorrectly considered private and therefore didn't have their intra-doc links resolved. I fixed this by always resolving intra-doc links for nested
use
items that are declaredpub
.During AST->HIR lowering, nested
use
items are desugared like this:Each of these HIR nodes has it's own effective visibility and the list stem is always considered private.
To check the effective visibility of an AST node, the AST node is mapped to a HIR node with
Resolver::local_def_id
, which returns the (private) list stem for nested use items.For
extern crate
, there was a hack in rustdoc that stored theDefId
of the crate itself in the cleaned item, instead of theDefId
of theextern crate
item. This made rustdoc look at the resolved links of the extern crate's crate root instead of theextern crate
item. I've removed this hack and instead translate theDefId
in the appropriate places.As as side effect of fixing
extern crate
, i've turnedinto a no-op instead of hiding all trait impls. Proper verification for
doc(masked)
is included as a bonus.fixes #113896