match ty {
clean::Generic(s) => params.entry(s).or_default()
.extend(bounds),
- t => tybounds.push((t, ty_bounds(bounds))),
+ t => tybounds.push((t, bounds)),
}
}
WP::RegionPredicate { lifetime, bounds } => {
}
}
- // Simplify the type parameter bounds on all the generics
- let mut params = params.into_iter().map(|(k, v)| {
- (k, ty_bounds(v))
- }).collect::<BTreeMap<_, _>>();
-
// Look for equality predicates on associated types that can be merged into
// general bound predicates
equalities.retain(|&(ref lhs, ref rhs)| {
// And finally, let's reassemble everything
let mut clauses = Vec::new();
clauses.extend(lifetimes.into_iter().map(|(lt, bounds)| {
- WP::RegionPredicate { lifetime: lt, bounds: bounds }
+ WP::RegionPredicate { lifetime: lt, bounds }
}));
clauses.extend(params.into_iter().map(|(k, v)| {
WP::BoundPredicate {
}
}));
clauses.extend(tybounds.into_iter().map(|(ty, bounds)| {
- WP::BoundPredicate { ty: ty, bounds: bounds }
+ WP::BoundPredicate { ty, bounds }
}));
clauses.extend(equalities.into_iter().map(|(lhs, rhs)| {
- WP::EqPredicate { lhs: lhs, rhs: rhs }
+ WP::EqPredicate { lhs, rhs }
}));
clauses
}
for param in &mut params {
match param.kind {
clean::GenericParamDefKind::Type { ref mut bounds, .. } => {
- *bounds = ty_bounds(mem::take(bounds));
+ *bounds = mem::take(bounds);
}
_ => panic!("expected only type parameters"),
}
params
}
-fn ty_bounds(bounds: Vec<clean::GenericBound>) -> Vec<clean::GenericBound> {
- bounds
-}
-
fn trait_is_same_or_supertrait(cx: &DocContext<'_>, child: DefId,
trait_: DefId) -> bool {
if child == trait_ {