Skip to content
Permalink
Browse files

reintroduce `commit_if_ok` calls to `subtype_predicate`

  • Loading branch information...
nikomatsakis committed Feb 19, 2019
1 parent 6cb4ffb commit 2cbe07b5b3da7708c32d044b7d06bd81d568dab3
Showing with 16 additions and 14 deletions.
  1. +16 −14 src/librustc/infer/mod.rs
@@ -937,20 +937,22 @@ impl<'a, 'gcx, 'tcx> InferCtxt<'a, 'gcx, 'tcx> {
return None;
}

let (
ty::SubtypePredicate {
a_is_expected,
a,
b,
},
_,
) = self.replace_bound_vars_with_placeholders(predicate);

Some(
self.at(cause, param_env)
.sub_exp(a_is_expected, a, b)
.map(|ok| ok.unit()),
)
Some(self.commit_if_ok(|_snapshot| {
let (
ty::SubtypePredicate {
a_is_expected,
a,
b,
},
_,
) = self.replace_bound_vars_with_placeholders(predicate);

Ok(
self.at(cause, param_env)
.sub_exp(a_is_expected, a, b)?
.unit(),
)
}))
}

pub fn region_outlives_predicate(

0 comments on commit 2cbe07b

Please sign in to comment.
You can’t perform that action at this time.