1
Fork 0

region_outlives_predicate no snapshot

This commit is contained in:
lcnr 2022-07-20 11:49:20 +02:00
parent 608625dae9
commit 43ccacf89b
6 changed files with 15 additions and 42 deletions

View file

@ -793,9 +793,7 @@ impl<'tcx> AutoTraitFinder<'tcx> {
}
ty::PredicateKind::RegionOutlives(binder) => {
let binder = bound_predicate.rebind(binder);
if select.infcx().region_outlives_predicate(&dummy_cause, binder).is_err() {
return false;
}
select.infcx().region_outlives_predicate(&dummy_cause, binder)
}
ty::PredicateKind::TypeOutlives(binder) => {
let binder = bound_predicate.rebind(binder);

View file

@ -789,24 +789,9 @@ impl<'a, 'tcx> InferCtxtExt<'tcx> for InferCtxt<'a, 'tcx> {
span_bug!(span, "coerce requirement gave wrong error: `{:?}`", predicate)
}
ty::PredicateKind::RegionOutlives(predicate) => {
let predicate = bound_predicate.rebind(predicate);
let predicate = self.resolve_vars_if_possible(predicate);
let err = self
.region_outlives_predicate(&obligation.cause, predicate)
.err()
.unwrap();
struct_span_err!(
self.tcx.sess,
span,
E0279,
"the requirement `{}` is not satisfied (`{}`)",
predicate,
err,
)
}
ty::PredicateKind::Projection(..) | ty::PredicateKind::TypeOutlives(..) => {
ty::PredicateKind::RegionOutlives(..)
| ty::PredicateKind::Projection(..)
| ty::PredicateKind::TypeOutlives(..) => {
let predicate = self.resolve_vars_if_possible(obligation.predicate);
struct_span_err!(
self.tcx.sess,

View file

@ -359,15 +359,10 @@ impl<'a, 'b, 'tcx> ObligationProcessor for FulfillProcessor<'a, 'b, 'tcx> {
ty::PredicateKind::RegionOutlives(data) => {
if infcx.considering_regions || data.has_placeholders() {
match infcx
.region_outlives_predicate(&obligation.cause, Binder::dummy(data))
{
Ok(()) => ProcessResult::Changed(vec![]),
Err(_) => ProcessResult::Error(CodeSelectionError(Unimplemented)),
}
} else {
ProcessResult::Changed(vec![])
infcx.region_outlives_predicate(&obligation.cause, Binder::dummy(data));
}
ProcessResult::Changed(vec![])
}
ty::PredicateKind::TypeOutlives(ty::OutlivesPredicate(t_a, r_b)) => {