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

@ -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.