region_outlives_predicate
no snapshot
This commit is contained in:
parent
608625dae9
commit
43ccacf89b
@ -559,7 +559,7 @@ E0790: include_str!("./error_codes/E0790.md"),
|
||||
// E0273, // on_unimplemented #1
|
||||
// E0274, // on_unimplemented #2
|
||||
// E0278, // requirement is not satisfied
|
||||
E0279, // requirement is not satisfied
|
||||
// E0279,
|
||||
E0280, // requirement is not satisfied
|
||||
// E0285, // overflow evaluation builtin bounds
|
||||
// E0296, // replaced with a generic attribute input check
|
||||
|
@ -1061,16 +1061,11 @@ impl<'a, 'tcx> InferCtxt<'a, 'tcx> {
|
||||
&self,
|
||||
cause: &traits::ObligationCause<'tcx>,
|
||||
predicate: ty::PolyRegionOutlivesPredicate<'tcx>,
|
||||
) -> UnitResult<'tcx> {
|
||||
self.commit_if_ok(|_snapshot| {
|
||||
let ty::OutlivesPredicate(r_a, r_b) =
|
||||
self.replace_bound_vars_with_placeholders(predicate);
|
||||
let origin = SubregionOrigin::from_obligation_cause(cause, || {
|
||||
RelateRegionParamBound(cause.span)
|
||||
});
|
||||
self.sub_regions(origin, r_b, r_a); // `b : a` ==> `a <= b`
|
||||
Ok(())
|
||||
})
|
||||
) {
|
||||
let ty::OutlivesPredicate(r_a, r_b) = self.replace_bound_vars_with_placeholders(predicate);
|
||||
let origin =
|
||||
SubregionOrigin::from_obligation_cause(cause, || RelateRegionParamBound(cause.span));
|
||||
self.sub_regions(origin, r_b, r_a); // `b : a` ==> `a <= b`
|
||||
}
|
||||
|
||||
/// Number of type variables created so far.
|
||||
|
@ -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);
|
||||
|
@ -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,
|
||||
|
@ -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)) => {
|
||||
|
@ -10,8 +10,8 @@ use regex::Regex;
|
||||
|
||||
// A few of those error codes can't be tested but all the others can and *should* be tested!
|
||||
const EXEMPTED_FROM_TEST: &[&str] = &[
|
||||
"E0279", "E0313", "E0377", "E0461", "E0462", "E0465", "E0476", "E0490", "E0514", "E0519",
|
||||
"E0523", "E0554", "E0640", "E0717", "E0729", "E0789",
|
||||
"E0313", "E0377", "E0461", "E0462", "E0465", "E0476", "E0490", "E0514", "E0519", "E0523",
|
||||
"E0554", "E0640", "E0717", "E0729", "E0789",
|
||||
];
|
||||
|
||||
// Some error codes don't have any tests apparently...
|
||||
|
Loading…
x
Reference in New Issue
Block a user