Skip to content

Commit 71e5bfe

Browse files
authored
Rollup merge of #92947 - vacuus:rustdoc-core-visit-path, r=camelid
rustdoc: Use `intersperse` in a `visit_path` function (~~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.
2 parents b05be97 + 47de5b4 commit 71e5bfe

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/librustdoc/core.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -492,9 +492,9 @@ impl<'tcx> Visitor<'tcx> for EmitIgnoredResolutionErrors<'tcx> {
492492
"could not resolve path `{}`",
493493
path.segments
494494
.iter()
495-
.map(|segment| segment.ident.as_str().to_string())
496-
.collect::<Vec<_>>()
497-
.join("::")
495+
.map(|segment| segment.ident.as_str())
496+
.intersperse("::")
497+
.collect::<String>()
498498
);
499499
let mut err = rustc_errors::struct_span_err!(
500500
self.tcx.sess,

0 commit comments

Comments
 (0)