diff options
| author | Tom Jakubowski <tom@crystae.net> | 2014-06-04 03:51:41 -0700 |
|---|---|---|
| committer | Tom Jakubowski <tom@crystae.net> | 2014-06-05 01:43:30 -0700 |
| commit | 2382bf42df52d35cce39507048670c76edd5a7b5 (patch) | |
| tree | ec45e5856c245a57b88fba56e892ab7708de161c | |
| parent | 073c8f10fc40b07596fd1018a2002db8e6d5222a (diff) | |
| download | rust-2382bf42df52d35cce39507048670c76edd5a7b5.tar.gz rust-2382bf42df52d35cce39507048670c76edd5a7b5.zip | |
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
| -rw-r--r-- | src/librustdoc/clean/inline.rs | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/src/librustdoc/clean/inline.rs b/src/librustdoc/clean/inline.rs index 575dd057867..1bc6cfdabd3 100644 --- a/src/librustdoc/clean/inline.rs +++ b/src/librustdoc/clean/inline.rs @@ -147,10 +147,18 @@ pub fn build_external_trait(tcx: &ty::ctxt, did: ast::DefId) -> clean::Trait { 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 { generics: def.generics.clean(), methods: methods.collect(), - parents: Vec::new(), // FIXME: this is likely wrong + parents: parents.collect() } } |
