-
Notifications
You must be signed in to change notification settings - Fork 12.7k
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: Don't use CURRENT_DEPTH
in clean/types.rs
#82745
Conversation
This part actually wasn't that hard. Ending the use of it in `html/format.rs` is probably going to be *a lot* harder.
@@ -170,6 +170,10 @@ crate struct SharedContext<'tcx> { | |||
} | |||
|
|||
impl<'tcx> Context<'tcx> { | |||
fn depth(&self) -> usize { |
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 can add docs here if you like. Let me know what you think.
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.
Sure, that seems useful.
The job Click to see the possible cause of the failure (guessed by this bot)
|
@@ -170,6 +170,10 @@ crate struct SharedContext<'tcx> { | |||
} | |||
|
|||
impl<'tcx> Context<'tcx> { | |||
fn depth(&self) -> usize { | |||
self.current.len() |
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 confused - did current
already exist? How is it kept in sync with CURRENT_DEPTH
?
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.
CURRENT_DEPTH
is set to self.current.len()
in render_item()
. self.current
should always be the same when rendering a particular item since it represents the namespace hierarchy.
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 can combine this PR with #82815 if you like so that we don't have to worry about keeping CURRENT_DEPTH
in sync with depth()
.
☔ The latest upstream changes (presumably #82756) made this pull request unmergeable. Please resolve the merge conflicts. |
It looks like this PR is the first commit of #82815, so I'm going to close this in favor of that PR. Thanks for working on this! |
Helps with #82742.
This part actually wasn't that hard. Ending the use of it in
html/format.rs
is probably going to be a lot harder.r? @jyn514