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 18, 2020
1 parent be321bd commit 10813ea
Show file tree
Hide file tree
Showing 2 changed files with 12 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
18 changes: 11 additions & 7 deletions src/typeck.rs
Original file line number Diff line number Diff line change
Expand Up @@ -221,13 +221,17 @@ 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![]);
});
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 10813ea

Please sign in to comment.