diff options
| author | lcnr <rust@lcnr.de> | 2022-07-20 11:49:20 +0200 |
|---|---|---|
| committer | lcnr <rust@lcnr.de> | 2022-07-21 13:09:01 +0200 |
| commit | 43ccacf89b704f74e3ff61ba015c0dddcedfe068 (patch) | |
| tree | 72b9279053cce1d1db9eb108ab0b091ae7f68831 /compiler/rustc_trait_selection | |
| parent | 608625dae95cde00e4570eb6c2d63b2244bbf34c (diff) | |
| download | rust-43ccacf89b704f74e3ff61ba015c0dddcedfe068.tar.gz rust-43ccacf89b704f74e3ff61ba015c0dddcedfe068.zip | |
`region_outlives_predicate` no snapshot
Diffstat (limited to 'compiler/rustc_trait_selection')
3 files changed, 7 insertions, 29 deletions
diff --git a/compiler/rustc_trait_selection/src/traits/auto_trait.rs b/compiler/rustc_trait_selection/src/traits/auto_trait.rs index 65ff9ceb67e..5763e6d1b55 100644 --- a/compiler/rustc_trait_selection/src/traits/auto_trait.rs +++ b/compiler/rustc_trait_selection/src/traits/auto_trait.rs @@ -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); diff --git a/compiler/rustc_trait_selection/src/traits/error_reporting/mod.rs b/compiler/rustc_trait_selection/src/traits/error_reporting/mod.rs index 29df771b957..eb2c3c96019 100644 --- a/compiler/rustc_trait_selection/src/traits/error_reporting/mod.rs +++ b/compiler/rustc_trait_selection/src/traits/error_reporting/mod.rs @@ -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, diff --git a/compiler/rustc_trait_selection/src/traits/fulfill.rs b/compiler/rustc_trait_selection/src/traits/fulfill.rs index 9b0ad15bc05..556ef466cd1 100644 --- a/compiler/rustc_trait_selection/src/traits/fulfill.rs +++ b/compiler/rustc_trait_selection/src/traits/fulfill.rs @@ -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)) => { |
