Skip to content
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

Merged
merged 2 commits into from
Apr 8, 2021

Conversation

GuillaumeGomez
Copy link
Member

@GuillaumeGomez GuillaumeGomez commented Apr 8, 2021

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

@GuillaumeGomez GuillaumeGomez added T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue. A-rustdoc-ui Area: Rustdoc UI (generated HTML) A-rustdoc-js Area: Rustdoc's JS front-end labels Apr 8, 2021
@rust-highfive
Copy link
Collaborator

r? @jyn514

(rust-highfive has picked a reviewer for you, use r? to override)

@rust-highfive rust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Apr 8, 2021
@rust-log-analyzer

This comment has been minimized.

}

/// Concatenate colons and idents as one when possible.
fn get_full_ident_path(&mut self) -> Vec<(TokenKind, usize, usize)> {
Copy link
Contributor

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.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good idea!

Copy link
Member Author

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!

Copy link
Contributor

@notriddle notriddle left a 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.

@GuillaumeGomez
Copy link
Member Author

Thanks @notriddle!

@bors: r=notriddle

@bors
Copy link
Contributor

bors commented Apr 8, 2021

📌 Commit e2708b4 has been approved by notriddle

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Apr 8, 2021
bors added a commit to rust-lang-ci/rust that referenced this pull request Apr 8, 2021
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
@bors bors merged commit 901ada6 into rust-lang:master Apr 8, 2021
@rustbot rustbot added this to the 1.53.0 milestone Apr 8, 2021
@GuillaumeGomez GuillaumeGomez deleted the merge-idents branch April 9, 2021 08:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-rustdoc-js Area: Rustdoc's JS front-end A-rustdoc-ui Area: Rustdoc UI (generated HTML) S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants