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.
This commit is contained in:
Matthias Krüger 2022-01-18 04:42:08 +01:00 committed by GitHub
commit 71e5bfed70
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -492,9 +492,9 @@ fn visit_path(&mut self, path: &'tcx Path<'_>, _id: HirId) {
"could not resolve path `{}`", "could not resolve path `{}`",
path.segments path.segments
.iter() .iter()
.map(|segment| segment.ident.as_str().to_string()) .map(|segment| segment.ident.as_str())
.collect::<Vec<_>>() .intersperse("::")
.join("::") .collect::<String>()
); );
let mut err = rustc_errors::struct_span_err!( let mut err = rustc_errors::struct_span_err!(
self.tcx.sess, self.tcx.sess,