auto merge of #17892 : nodakai/rust/rustdoc-dont-nest-a, r=alexcrichton
Some examples: - `std::slice::slice`: [before](http://validator.w3.org/check?uri=http%3A%2F%2Fdoc.rust-lang.org%2Fstd%2Fslice%2Fprimitive.slice.html&charset=%28detect+automatically%29&doctype=Inline&group=0) and [after](http://validator.w3.org/check?uri=http%3A%2F%2Fnodakai.github.io%2Frust-f40b60b-doc%2Fstd%2Fslice%2Fprimitive.slice.html&charset=%28detect+automatically%29&doctype=Inline&group=0) - `core::char::char`: [before](http://validator.w3.org/check?uri=http%3A%2F%2Fdoc.rust-lang.org%2Fcore%2Fchar%2Fprimitive.char.html&charset=%28detect+automatically%29&doctype=Inline&group=0) and [after](http://validator.w3.org/check?uri=http%3A%2F%2Fnodakai.github.io%2Frust-f40b60b-doc%2Fcore%2Fchar%2Fprimitive.char.html&charset=%28detect+automatically%29&doctype=Inline&group=0) - `hexfloat::expand_syntax_ext`: [before](http://validator.w3.org/check?uri=http%3A%2F%2Fdoc.rust-lang.org%2Fhexfloat%2Ffn.expand_syntax_ext.html&charset=%28detect+automatically%29&doctype=Inline&group=0) and [after](http://validator.w3.org/check?uri=http%3A%2F%2Fnodakai.github.io%2Frust-f40b60b-doc%2Fhexfloat%2Ffn.expand_syntax_ext.html&charset=%28detect+automatically%29&doctype=Inline&group=0) TODO: do the same for tuples.
This commit is contained in:
commit
519e85b8a9
1 changed files with 19 additions and 1 deletions
|
|
@ -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")
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue