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

rustdoc: Use intersperse in a visit_path function #92947

Merged
merged 1 commit into from
Jan 18, 2022
Merged

rustdoc: Use intersperse in a visit_path function #92947

merged 1 commit into from
Jan 18, 2022

Conversation

vacuus
Copy link
Contributor

@vacuus vacuus commented Jan 15, 2022

(Is there a better way to word the title? Eh, this works, I guess.)
I'm surprised that the compiler didn't complain when I left out the .to_string(), but hey, if it works then it works.

@rustbot rustbot added the T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue. label Jan 15, 2022
@rust-highfive
Copy link
Collaborator

r? @jsha

(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 Jan 15, 2022
@vacuus vacuus changed the title rustdoc: Remove collect in <EmitIgnoredResolutionErrors as Visitor>::visit_path rustdoc: Remove collect in <[long type name] as Visitor>::visit_path Jan 15, 2022
src/librustdoc/core.rs Outdated Show resolved Hide resolved
@camelid camelid assigned camelid and unassigned jsha Jan 15, 2022
@camelid camelid changed the title rustdoc: Remove collect in <[long type name] as Visitor>::visit_path rustdoc: Use intersperse in a visit_path function Jan 15, 2022
.collect::<Vec<_>>()
.join("::")
.map(|segment| segment.ident.as_str())
.intersperse_with(|| "::")
Copy link
Member

Choose a reason for hiding this comment

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

Can you do this? If not, can you post the error?

Suggested change
.intersperse_with(|| "::")
.intersperse("::")

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Apparently it does work. I must've misjudged the trait impls somewhere.

@camelid camelid added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Jan 15, 2022
Copy link
Member

@camelid camelid left a comment

Choose a reason for hiding this comment

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

Thanks!

@camelid
Copy link
Member

camelid commented Jan 17, 2022

@bors r+

@bors
Copy link
Contributor

bors commented Jan 17, 2022

📌 Commit 47de5b4 has been approved by camelid

@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-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Jan 17, 2022
@camelid
Copy link
Member

camelid commented Jan 17, 2022

This is an error path AFAICT, so @bors rollup

bors added a commit to rust-lang-ci/rust that referenced this pull request Jan 18, 2022
…askrgr

Rollup of 14 pull requests

Successful merges:

 - rust-lang#92629 (Pick themes on settings page, not every page)
 - rust-lang#92640 (Fix ICEs related to `Deref<Target=[T; N]>` on newtypes)
 - rust-lang#92701 (Add some more attribute validation)
 - rust-lang#92803 (Hide mobile sidebar on some clicks)
 - rust-lang#92830 (Rustdoc style cleanups)
 - rust-lang#92866 ("Does exists" typos fix)
 - rust-lang#92870 (add `rustc_diagnostic_item` attribute to `AtomicBool` type)
 - rust-lang#92914 (htmldocck: Add support for `/text()` in ``@snapshot`)`
 - rust-lang#92923 (Abstract the pretty printer's ringbuffer to be infinitely sized)
 - rust-lang#92946 (Exclude llvm-libunwind from the self-contained set on s390x-musl targets)
 - rust-lang#92947 (rustdoc: Use `intersperse` in a `visit_path` function)
 - rust-lang#92997 (Add `~const` bound test for negative impls)
 - rust-lang#93004 (update codegen test for LLVM 14)
 - rust-lang#93016 (Stabilize vec_spare_capacity)

Failed merges:

 - rust-lang#92924 (Delete pretty printer tracing)

r? `@ghost`
`@rustbot` modify labels: rollup
@bors bors merged commit 71e5bfe into rust-lang:master Jan 18, 2022
@rustbot rustbot added this to the 1.60.0 milestone Jan 18, 2022
@vacuus vacuus deleted the rustdoc-core-visit-path branch April 8, 2022 21:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
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.

6 participants