Cleanup
This commit is contained in:
parent
7f24c21a50
commit
476bd53058
9 changed files with 25 additions and 66 deletions
|
@ -544,7 +544,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
|
|||
self.infcx.instantiate_opaque_types(id, self.body_id, self.param_env, ty, span);
|
||||
let mut suggest_box = !impl_trait_ret_ty.obligations.is_empty();
|
||||
for o in impl_trait_ret_ty.obligations {
|
||||
match o.predicate.skip_binders_unchecked() {
|
||||
match o.predicate.bound_atom().skip_binder() {
|
||||
ty::PredicateAtom::Trait(t, constness) => {
|
||||
let pred = ty::PredicateAtom::Trait(
|
||||
ty::TraitPredicate {
|
||||
|
|
|
@ -1949,7 +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), span));
|
||||
predicates.insert((predicate.to_predicate(tcx), span));
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1993,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),
|
||||
.to_predicate(tcx),
|
||||
lifetime.span,
|
||||
));
|
||||
}
|
||||
|
|
|
@ -30,13 +30,10 @@ fn inferred_outlives_of(tcx: TyCtxt<'_>, item_def_id: DefId) -> &[(ty::Predicate
|
|||
if tcx.has_attr(item_def_id, sym::rustc_outlives) {
|
||||
let mut pred: Vec<String> = predicates
|
||||
.iter()
|
||||
.map(|(out_pred, _)| {
|
||||
let binder = out_pred.bound_atom();
|
||||
match binder.skip_binder() {
|
||||
ty::PredicateAtom::RegionOutlives(p) => p.to_string(),
|
||||
ty::PredicateAtom::TypeOutlives(p) => p.to_string(),
|
||||
err => bug!("unexpected predicate {:?}", err),
|
||||
}
|
||||
.map(|(out_pred, _)| match out_pred.bound_atom().skip_binder() {
|
||||
ty::PredicateAtom::RegionOutlives(p) => p.to_string(),
|
||||
ty::PredicateAtom::TypeOutlives(p) => p.to_string(),
|
||||
err => bug!("unexpected predicate {:?}", err),
|
||||
})
|
||||
.collect();
|
||||
pred.sort();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue