Navigation Menu

Skip to content

Commit

Permalink
rustdoc: Include supertraits on inlined traits
Browse files Browse the repository at this point in the history
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
  • Loading branch information
tomjakubowski committed Jun 5, 2014
1 parent 073c8f1 commit 2382bf4
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion src/librustdoc/clean/inline.rs
Expand Up @@ -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()
}
}

Expand Down

5 comments on commit 2382bf4

@bors
Copy link
Contributor

@bors bors commented on 2382bf4 Jun 5, 2014

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

saw approval from huonw
at tomjakubowski@2382bf4

@bors
Copy link
Contributor

@bors bors commented on 2382bf4 Jun 5, 2014

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

merging tomjakubowski/rust/fix-14636 = 2382bf4 into auto

@bors
Copy link
Contributor

@bors bors commented on 2382bf4 Jun 5, 2014

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

tomjakubowski/rust/fix-14636 = 2382bf4 merged ok, testing candidate = f2821f2

@bors
Copy link
Contributor

@bors bors commented on 2382bf4 Jun 5, 2014

@bors
Copy link
Contributor

@bors bors commented on 2382bf4 Jun 5, 2014

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fast-forwarding master to auto = f2821f2

Please sign in to comment.