Skip to content

File tree

1 file changed

+19
-1
lines changed

1 file changed

+19
-1
lines changed

src/librustdoc/html/format.rs

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -478,7 +478,25 @@ impl fmt::Show for clean::Type {
478478
Some(ref l) => format!("{} ", *l),
479479
_ => "".to_string(),
480480
};
481-
write!(f, "&{}{}{}", lt, MutableSpace(mutability), **ty)
481+
let m = MutableSpace(mutability);
482+
match **ty {
483+
clean::Vector(ref bt) => { // BorrowedRef{ ... Vector(T) } is &[T]
484+
match **bt {
485+
clean::Generic(_) =>
486+
primitive_link(f, clean::Slice,
487+
format!("&{}{}[{}]", lt, m, **bt).as_slice()),
488+
_ => {
489+
try!(primitive_link(f, clean::Slice,
490+
format!("&{}{}[", lt, m).as_slice()));
491+
try!(write!(f, "{}", **bt));
492+
primitive_link(f, clean::Slice, "]")
493+
}
494+
}
495+
}
496+
_ => {
497+
write!(f, "&{}{}{}", lt, m, **ty)
498+
}
499+
}
482500
}
483501
clean::Unique(..) => {
484502
fail!("should have been cleaned")

0 commit comments

Comments
 (0)