rustdoc: Include supertraits on inlined traits
Previously, documentation for an inlined trait (i.e. a trait imported and reexported from another crate) didn't display the trait's supertraits. Closes #14636
This commit is contained in:
parent
073c8f10fc
commit
2382bf42df
|
@ -147,10 +147,18 @@ pub fn build_external_trait(tcx: &ty::ctxt, did: ast::DefId) -> clean::Trait {
|
||||||
clean::Required(meth)
|
clean::Required(meth)
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
let supertraits = ty::trait_supertraits(tcx, did);
|
||||||
|
let mut parents = supertraits.iter().map(|i| {
|
||||||
|
match i.clean() {
|
||||||
|
clean::TraitBound(ty) => ty,
|
||||||
|
clean::RegionBound => unreachable!()
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
clean::Trait {
|
clean::Trait {
|
||||||
generics: def.generics.clean(),
|
generics: def.generics.clean(),
|
||||||
methods: methods.collect(),
|
methods: methods.collect(),
|
||||||
parents: Vec::new(), // FIXME: this is likely wrong
|
parents: parents.collect()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue