Function rustdoc::clean::inline::filter_non_trait_generics

source ·
fn filter_non_trait_generics(trait_did: DefId, g: Generics) -> Generics
Expand description

A trait’s generics clause actually contains all of the predicates for all of its associated types as well. We specifically move these clauses to the associated types instead when displaying, so when we’re generating the generics for the trait itself we need to be sure to remove them. We also need to remove the implied “recursive” Self: Trait bound.

The inverse of this filtering logic can be found in the Clean implementation for AssociatedType