Skip to content

Commit

Permalink
Fix test failure due to rust-lang/rust#72493
Browse files Browse the repository at this point in the history
  • Loading branch information
Xanewok committed Nov 19, 2020
1 parent 7b1387f commit 0d52c24
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 8 deletions.
2 changes: 1 addition & 1 deletion rust-toolchain
Original file line number Diff line number Diff line change
@@ -1 +1 @@
nightly-2020-06-23
nightly-2020-06-24
19 changes: 12 additions & 7 deletions src/typeck.rs
Original file line number Diff line number Diff line change
Expand Up @@ -221,13 +221,18 @@ impl<'a, 'tcx> TypeComparisonContext<'a, 'tcx> {
use rustc_infer::infer::{InferOk, RegionckMode};
use rustc_middle::ty::Lift;

let error = self
.infcx
.at(&ObligationCause::dummy(), target_param_env)
.eq(orig, target)
.map(|InferOk { obligations: o, .. }| {
assert_eq!(o, vec![]);
});
let error = self.infcx.commit_if_ok(|snapshot| {
let select = self
.infcx
.at(&ObligationCause::dummy(), target_param_env)
.eq(orig, target)
.map(|InferOk { obligations: o, .. }| {
assert_eq!(o, vec![]);
});
// check for unresolvable lifetime constraints
let leak_check = self.infcx.leak_check(false, snapshot);
select.and(leak_check)
});

if let Err(err) = error {
let outlives_env = OutlivesEnvironment::new(target_param_env);
Expand Down

0 comments on commit 0d52c24

Please sign in to comment.