Skip to content

Commit f2821f2

Browse files
committed
auto merge of #14640 : tomjakubowski/rust/fix-14636, r=huonw
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
2 parents 0c74911 + 2382bf4 commit f2821f2

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

src/librustdoc/clean/inline.rs

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -147,10 +147,18 @@ pub fn build_external_trait(tcx: &ty::ctxt, did: ast::DefId) -> clean::Trait {
147147
clean::Required(meth)
148148
}
149149
});
150+
let supertraits = ty::trait_supertraits(tcx, did);
151+
let mut parents = supertraits.iter().map(|i| {
152+
match i.clean() {
153+
clean::TraitBound(ty) => ty,
154+
clean::RegionBound => unreachable!()
155+
}
156+
});
157+
150158
clean::Trait {
151159
generics: def.generics.clean(),
152160
methods: methods.collect(),
153-
parents: Vec::new(), // FIXME: this is likely wrong
161+
parents: parents.collect()
154162
}
155163
}
156164

0 commit comments

Comments
 (0)