-
Notifications
You must be signed in to change notification settings - Fork 13k
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: Simplify modifications of effective visibility table #103010
Conversation
r? @CraftSpider (rust-highfive has picked a reviewer for you, use r? to override) |
// All items need to be handled here in case someone wishes to link | ||
// to them with intra-doc links | ||
self.cx.cache.access_levels.set_access_level(did, AccessLevel::Public); | ||
} |
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.
Behavior change 1: set_access_level
is now called on DefKind::Mod
items themselves too.
It was previously done in visit_lib.rs
but not here.
self.access_levels.set_access_level(did, level.unwrap()); | ||
level | ||
} else { | ||
old_level |
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.
Possible behavior change 2: the visitor can no longer recurse into doc-hidden modules.
It was previously the case in visit_ast.rs
but not here.
This comment was marked as resolved.
This comment was marked as resolved.
d1498ff
to
434ba37
Compare
This comment was marked as resolved.
This comment was marked as resolved.
434ba37
to
482e39f
Compare
I made one more step and separated effective visibilities ("access levels") coming from rustc from similar data collected by rustdoc for extern |
This comment was marked as resolved.
This comment was marked as resolved.
482e39f
to
a5ea013
Compare
Ping @CraftSpider @GuillaumeGomez |
Looks good to me, thanks! Let's run a perf check to ensure it doesn't have an impact then let's r+. @bors try @rust-timer queue |
Awaiting bors try build completion. @rustbot label: +S-waiting-on-perf |
⌛ Trying commit a5ea013436b3f11d263e1c5e3dc2383de2bc68c6 with merge 5e44172c9c9d88b400c5755c5caf906c9b8188f6... |
☀️ Try build successful - checks-actions |
Queued 5e44172c9c9d88b400c5755c5caf906c9b8188f6 with parent 33b530e, future comparison URL. |
Finished benchmarking commit (5e44172c9c9d88b400c5755c5caf906c9b8188f6): comparison URL. Overall result: ✅ improvements - no action neededBenchmarking this pull request likely means that it is perf-sensitive, so we're automatically marking it as not fit for rolling up. While you can manually mark this PR as fit for rollup, we strongly recommend not doing so since this PR may lead to changes in compiler perf. @bors rollup=never 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. |
Even if small, it does impact (positively) performance, nice! @bors r+ rollup=iffy |
📌 Commit a5ea013436b3f11d263e1c5e3dc2383de2bc68c6 has been approved by It is now in the queue for this repository. |
This comment was marked as resolved.
This comment was marked as resolved.
a5ea013
to
f1850d4
Compare
@bors r=GuillaumeGomez |
☀️ Test successful - checks-actions |
Finished benchmarking commit (fab0432): comparison URL. Overall result: ✅ 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.
CyclesResultsThis 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.
|
…omez rustdoc: Simplify modifications of effective visibility table It is now obvious that rustdoc only calls `set_access_level` with foreign def ids and `AccessLevel::Public`. The second commit makes one more step and separates effective visibilities coming from rustc from similar data collected by rustdoc for extern `DefId`s. The original table is no longer modified and now only contains local def ids as populated by rustc. cc rust-lang#102026 `@Bryanskiy`
It is now obvious that rustdoc only calls
set_access_level
with foreign def ids andAccessLevel::Public
.The second commit makes one more step and separates effective visibilities coming from rustc from similar data collected by rustdoc for extern
DefId
s.The original table is no longer modified and now only contains local def ids as populated by rustc.
cc #102026 @Bryanskiy