1
Fork 0

Remove PredicateKind::Atom

This commit is contained in:
Jack Huey 2020-12-21 22:49:03 -05:00
parent 8a6518427e
commit 8278314a8b
12 changed files with 73 additions and 101 deletions

View file

@ -1949,10 +1949,7 @@ fn gather_explicit_predicates_of(tcx: TyCtxt<'_>, def_id: DefId) -> ty::GenericP
let predicate = ty::Binder::bind(ty::PredicateAtom::TypeOutlives(
ty::OutlivesPredicate(ty, re_root_empty),
));
predicates.insert((
predicate.potentially_quantified(tcx, ty::PredicateKind::ForAll),
span,
));
predicates.insert((predicate.potentially_quantified(tcx), span));
}
}
@ -1996,7 +1993,7 @@ fn gather_explicit_predicates_of(tcx: TyCtxt<'_>, def_id: DefId) -> ty::GenericP
ty::Binder::bind(ty::PredicateAtom::TypeOutlives(
ty::OutlivesPredicate(ty, region),
))
.potentially_quantified(tcx, ty::PredicateKind::ForAll),
.potentially_quantified(tcx),
lifetime.span,
));
}

View file

@ -31,13 +31,11 @@ fn inferred_outlives_of(tcx: TyCtxt<'_>, item_def_id: DefId) -> &[(ty::Predicate
let mut pred: Vec<String> = predicates
.iter()
.map(|(out_pred, _)| match out_pred.kind() {
ty::PredicateKind::Atom(ty::PredicateAtom::RegionOutlives(p)) => {
p.to_string()
}
ty::PredicateKind::Atom(ty::PredicateAtom::TypeOutlives(p)) => {
p.to_string()
}
err => bug!("unexpected predicate {:?}", err),
ty::PredicateKind::ForAll(binder) => match binder.skip_binder() {
ty::PredicateAtom::RegionOutlives(p) => p.to_string(),
ty::PredicateAtom::TypeOutlives(p) => p.to_string(),
err => bug!("unexpected predicate {:?}", err),
},
})
.collect();
pred.sort();