1
Fork 0

rustc: keep a Span for each predicate in ty::GenericPredicates.

This commit is contained in:
Eduard-Mihai Burtescu 2018-09-16 20:15:49 +03:00
parent c222479c6f
commit 7020326bea
33 changed files with 265 additions and 290 deletions

View file

@ -1571,7 +1571,9 @@ impl<'a, 'tcx> Clean<Generics> for (&'a ty::Generics,
}
}).collect::<Vec<GenericParamDef>>();
let mut where_predicates = preds.predicates.to_vec().clean(cx);
let mut where_predicates = preds.predicates.iter()
.map(|(p, _)| p.clean(cx))
.collect::<Vec<_>>();
// Type parameters and have a Sized bound by default unless removed with
// ?Sized. Scan through the predicates and mark any type parameter with

View file

@ -157,7 +157,7 @@ fn trait_is_same_or_supertrait(cx: &DocContext, child: DefId,
return true
}
let predicates = cx.tcx.super_predicates_of(child).predicates;
predicates.iter().filter_map(|pred| {
predicates.iter().filter_map(|(pred, _)| {
if let ty::Predicate::Trait(ref pred) = *pred {
if pred.skip_binder().trait_ref.self_ty().is_self() {
Some(pred.def_id())