Skip to content

Commit 0d52c24

Browse files
committed
Fix test failure due to rust-lang/rust#72493
See rust-lang/rust#72493
1 parent 7b1387f commit 0d52c24

File tree

2 files changed

+13
-8
lines changed

2 files changed

+13
-8
lines changed

rust-toolchain

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
nightly-2020-06-23
1+
nightly-2020-06-24

src/typeck.rs

+12-7
Original file line numberDiff line numberDiff line change
@@ -221,13 +221,18 @@ impl<'a, 'tcx> TypeComparisonContext<'a, 'tcx> {
221221
use rustc_infer::infer::{InferOk, RegionckMode};
222222
use rustc_middle::ty::Lift;
223223

224-
let error = self
225-
.infcx
226-
.at(&ObligationCause::dummy(), target_param_env)
227-
.eq(orig, target)
228-
.map(|InferOk { obligations: o, .. }| {
229-
assert_eq!(o, vec![]);
230-
});
224+
let error = self.infcx.commit_if_ok(|snapshot| {
225+
let select = self
226+
.infcx
227+
.at(&ObligationCause::dummy(), target_param_env)
228+
.eq(orig, target)
229+
.map(|InferOk { obligations: o, .. }| {
230+
assert_eq!(o, vec![]);
231+
});
232+
// check for unresolvable lifetime constraints
233+
let leak_check = self.infcx.leak_check(false, snapshot);
234+
select.and(leak_check)
235+
});
231236

232237
if let Err(err) = error {
233238
let outlives_env = OutlivesEnvironment::new(target_param_env);

0 commit comments

Comments
 (0)