rustdoc: Fix cross-crate links to reexported items
Cross crate links can target items which are not rendered in the documentation. If the item is reexported at a higher level, the destination of the link (a concatenation of the fully qualified name) may actually lead to nowhere. This fixes this problem by altering rustdoc to emit pages which redirect to the local copy of the reexported structure. cc #14515 Closes #14137
This commit is contained in:
@@ -424,14 +424,8 @@ impl fmt::Show for clean::Type {
|
||||
decl.decl)
|
||||
}
|
||||
clean::Tuple(ref typs) => {
|
||||
try!(f.write("(".as_bytes()));
|
||||
for (i, typ) in typs.iter().enumerate() {
|
||||
if i > 0 {
|
||||
try!(f.write(", ".as_bytes()))
|
||||
}
|
||||
try!(write!(f, "{}", *typ));
|
||||
}
|
||||
f.write(")".as_bytes())
|
||||
primitive_link(f, clean::PrimitiveTuple,
|
||||
format!("({:#})", typs).as_slice())
|
||||
}
|
||||
clean::Vector(ref t) => {
|
||||
primitive_link(f, clean::Slice, format!("[{}]", **t).as_slice())
|
||||
|
||||
Reference in New Issue
Block a user