Skip to content

Commit 2e66f85

Browse files
committed
Bail out before running the query
1 parent b97abd0 commit 2e66f85

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

src/librustc_mir/const_eval/machine.rs

+4-3
Original file line numberDiff line numberDiff line change
@@ -40,15 +40,16 @@ impl<'mir, 'tcx> InterpCx<'mir, 'tcx, CompileTimeInterpreter<'mir, 'tcx>> {
4040
return Ok(false);
4141
}
4242

43-
let gid = GlobalId { instance, promoted: None };
44-
45-
let place = self.const_eval_raw(gid)?;
4643
let dest = match ret {
4744
Some((dest, _)) => dest,
4845
// Don't memoize diverging function calls.
4946
None => return Ok(false),
5047
};
5148

49+
let gid = GlobalId { instance, promoted: None };
50+
51+
let place = self.const_eval_raw(gid)?;
52+
5253
self.copy_op(place.into(), dest)?;
5354

5455
self.return_to_block(ret.map(|r| r.1))?;

0 commit comments

Comments
 (0)