-
Notifications
You must be signed in to change notification settings - Fork 12.8k
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
Merge idents when generating source content #83992
Conversation
r? @jyn514 (rust-highfive has picked a reviewer for you, use r? to override) |
This comment has been minimized.
This comment has been minimized.
bfa7d82
to
89063a1
Compare
89063a1
to
e2708b4
Compare
} | ||
|
||
/// Concatenate colons and idents as one when possible. | ||
fn get_full_ident_path(&mut self) -> Vec<(TokenKind, usize, 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.
How about ArrayVec? librustdoc already depends on it, and these Vecs have exactly zero, one, or two items in them.
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.
Good idea!
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.
Actually just gave it a try, no difference and it's actually not great in case we have less than 2 elements. Keeping it as is for the moment. If you want to give it another try later on, don't hesitate!
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.
Overall, I don't mind this, and would happily have it merge as-is.
Thanks @notriddle! @bors: r=notriddle |
📌 Commit e2708b4 has been approved by |
Rollup of 6 pull requests Successful merges: - rust-lang#80733 (Improve links in inline code in `core::pin`.) - rust-lang#81764 (Stabilize `rustdoc::bare_urls` lint) - rust-lang#81938 (Stabilize `peekable_peek_mut`) - rust-lang#83980 (Fix outdated crate names in compiler docs) - rust-lang#83992 (Merge idents when generating source content) - rust-lang#84001 (Update Clippy) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
The idea here is to not have a span for each part of a path. Currently, for
a::b::c
we generate<span>a</span>::<span>b</span>::<span>c</span>
, with this change, we will generate<span>a::b::c</span>
.A nice "side-effect" is that it reduces the size of the output HTML too. :)
cc @notriddle