Auto merge of #33600 - ollie27:rustdoc_impl_params, r=alexcrichton

rustdoc: Fix missing type parameters on impls

They were broken by #32558.

Fixes: #33592
This commit is contained in:
bors 2016-05-14 19:46:01 -07:00
commit dd0ef17a2d
3 changed files with 30 additions and 8 deletions

View file

@ -1534,13 +1534,6 @@ impl Type {
}
}
pub fn trait_name(&self) -> Option<String> {
match *self {
ResolvedPath { ref path, .. } => Some(path.last_name()),
_ => None,
}
}
pub fn is_generic(&self) -> bool {
match *self {
ResolvedPath { is_generic, .. } => is_generic,

View file

@ -587,7 +587,13 @@ fn fmt_impl(i: &clean::Impl, f: &mut fmt::Formatter, link_trait: bool) -> fmt::R
if link_trait {
write!(f, "{}", *ty)?;
} else {
write!(f, "{}", ty.trait_name().unwrap())?;
match *ty {
clean::ResolvedPath{ typarams: None, ref path, is_generic: false, .. } => {
let last = path.segments.last().unwrap();
write!(f, "{}{}", last.name, last.params)?;
}
_ => unreachable!(),
}
}
write!(f, " for ")?;
}