bors 2014-10-11 21:42:17 +00:00
commit 519e85b8a9

View file

@ -478,7 +478,25 @@ impl fmt::Show for clean::Type {
Some(ref l) => format!("{} ", *l),
_ => "".to_string(),
};
write!(f, "&{}{}{}", lt, MutableSpace(mutability), **ty)
let m = MutableSpace(mutability);
match **ty {
clean::Vector(ref bt) => { // BorrowedRef{ ... Vector(T) } is &[T]
match **bt {
clean::Generic(_) =>
primitive_link(f, clean::Slice,
format!("&{}{}[{}]", lt, m, **bt).as_slice()),
_ => {
try!(primitive_link(f, clean::Slice,
format!("&{}{}[", lt, m).as_slice()));
try!(write!(f, "{}", **bt));
primitive_link(f, clean::Slice, "]")
}
}
}
_ => {
write!(f, "&{}{}{}", lt, m, **ty)
}
}
}
clean::Unique(..) => {
fail!("should have been cleaned")