diff options
| author | Matthias Krüger <matthias.krueger@famsik.de> | 2022-01-18 04:42:08 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2022-01-18 04:42:08 +0100 |
| commit | 71e5bfed706616ed85efe57244db95cc358716ad (patch) | |
| tree | 4fde2f2ae419ff8153fe7149b04449799dba5d52 | |
| parent | b05be976eff3829e91fcaa05e0e1a6da0c6ea4f2 (diff) | |
| parent | 47de5b45beafbf95acaaf18a92b0a731e8b3e383 (diff) | |
| download | rust-71e5bfed706616ed85efe57244db95cc358716ad.tar.gz rust-71e5bfed706616ed85efe57244db95cc358716ad.zip | |
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.
| -rw-r--r-- | src/librustdoc/core.rs | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/librustdoc/core.rs b/src/librustdoc/core.rs index c7c049f9914..3b926e44403 100644 --- a/src/librustdoc/core.rs +++ b/src/librustdoc/core.rs @@ -492,9 +492,9 @@ impl<'tcx> Visitor<'tcx> for EmitIgnoredResolutionErrors<'tcx> { "could not resolve path `{}`", path.segments .iter() - .map(|segment| segment.ident.as_str().to_string()) - .collect::<Vec<_>>() - .join("::") + .map(|segment| segment.ident.as_str()) + .intersperse("::") + .collect::<String>() ); let mut err = rustc_errors::struct_span_err!( self.tcx.sess, |
