Skip to content

Commit ebbcafb

Browse files
committed
Fix implementation of clean::Path::whole_name()
I think that before this commit, the path `::std::vec::Vec` would have rendered as `{{root}}::std::vec::Vec`. Now, it should render correctly as `::std::vec::Vec`.
1 parent f359b31 commit ebbcafb

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/librustdoc/clean/types.rs

+5-1
Original file line numberDiff line numberDiff line change
@@ -1958,7 +1958,11 @@ impl Path {
19581958
}
19591959

19601960
crate fn whole_name(&self) -> String {
1961-
self.segments.iter().map(|s| s.name.to_string()).intersperse("::".into()).collect()
1961+
self.segments
1962+
.iter()
1963+
.map(|s| if s.name == kw::PathRoot { String::new() } else { s.name.to_string() })
1964+
.intersperse("::".into())
1965+
.collect()
19621966
}
19631967

19641968
/// Checks if this is a `T::Name` path for an associated type.

0 commit comments

Comments
 (0)