fn filter_non_trait_generics(trait_did: DefId, mut g: clean::Generics) -> clean::Generics {
for pred in &mut g.where_predicates {
match *pred {
- clean::WherePredicate::BoundPredicate { ty: clean::Generic(ref s), ref mut bounds }
- if *s == kw::SelfUpper =>
- {
+ clean::WherePredicate::BoundPredicate {
+ ty: clean::Generic(ref s),
+ ref mut bounds,
+ ..
+ } if *s == kw::SelfUpper => {
bounds.retain(|bound| match *bound {
clean::GenericBound::TraitBound(
clean::PolyTrait { trait_: clean::ResolvedPath { did, .. }, .. },
..
},
ref bounds,
+ ..
} => !(bounds.is_empty() || *s == kw::SelfUpper && did == trait_did),
_ => true,
});
) -> (clean::Generics, Vec<clean::GenericBound>) {
let mut ty_bounds = Vec::new();
g.where_predicates.retain(|pred| match *pred {
- clean::WherePredicate::BoundPredicate { ty: clean::Generic(ref s), ref bounds }
+ clean::WherePredicate::BoundPredicate { ty: clean::Generic(ref s), ref bounds, .. }
if *s == kw::SelfUpper =>
{
ty_bounds.extend(bounds.iter().cloned());