-
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
rustdoc: Use intersperse
in a visit_path
function
#92947
Conversation
r? @jsha (rust-highfive has picked a reviewer for you, use r? to override) |
collect
in <EmitIgnoredResolutionErrors as Visitor>::visit_path
collect
in <[long type name] as Visitor>::visit_path
collect
in <[long type name] as Visitor>::visit_path
intersperse
in a visit_path
function
src/librustdoc/core.rs
Outdated
.collect::<Vec<_>>() | ||
.join("::") | ||
.map(|segment| segment.ident.as_str()) | ||
.intersperse_with(|| "::") |
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.
Can you do this? If not, can you post the error?
.intersperse_with(|| "::") | |
.intersperse("::") |
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.
Apparently it does work. I must've misjudged the trait impls somewhere.
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.
Thanks!
@bors r+ |
📌 Commit 47de5b4 has been approved by |
This is an error path AFAICT, so @bors rollup |
…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
(
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.