Skip to content

Commit

Permalink
Showing 1 changed file with 19 additions and 1 deletion.
20 changes: 19 additions & 1 deletion src/librustdoc/html/format.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down

0 comments on commit 519e85b

Please sign in to comment.