rustdoc: Improve impl disambiguation

* Don't disambiguate if there are multiple impls for the same type.
* Disambiguate for impls of &Foo and &mut Foo.
* Don't try to disambiguate generic types.
This commit is contained in:
Oliver Middleton
2017-02-06 17:50:30 +00:00
parent fc02736d59
commit 05eef36fa5
3 changed files with 67 additions and 11 deletions

View File

@@ -671,9 +671,11 @@ fn fmt_type(t: &clean::Type, f: &mut fmt::Formatter, use_absolute: bool) -> fmt:
}
_ => {
if f.alternate() {
write!(f, "&{}{}{:#}", lt, m, **ty)
write!(f, "&{}{}", lt, m)?;
fmt_type(&ty, f, use_absolute)
} else {
write!(f, "&{}{}{}", lt, m, **ty)
write!(f, "&{}{}", lt, m)?;
fmt_type(&ty, f, use_absolute)
}
}
}