Skip to content

Commit

Permalink
Fix implementation of clean::Path::whole_name()
Browse files Browse the repository at this point in the history
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`.
  • Loading branch information
camelid committed Oct 3, 2021
1 parent f359b31 commit ebbcafb
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/librustdoc/clean/types.rs
Expand Up @@ -1958,7 +1958,11 @@ impl Path {
}

crate fn whole_name(&self) -> String {
self.segments.iter().map(|s| s.name.to_string()).intersperse("::".into()).collect()
self.segments
.iter()
.map(|s| if s.name == kw::PathRoot { String::new() } else { s.name.to_string() })
.intersperse("::".into())
.collect()
}

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

0 comments on commit ebbcafb

Please sign in to comment.