diff options
| author | Mara Bos <m-ou.se@m-ou.se> | 2021-07-10 18:32:27 +0200 |
|---|---|---|
| committer | Mara Bos <m-ou.se@m-ou.se> | 2021-07-28 16:18:38 +0200 |
| commit | 4e6356188f14b2c05957a4671e7a8e857fa5f429 (patch) | |
| tree | 97343592f0fc943be37b498e1b23fffc2848f2b9 /compiler/rustc_mir | |
| parent | 38bf5b0412fc38313d8db931febb306093c1bcae (diff) | |
| download | rust-4e6356188f14b2c05957a4671e7a8e857fa5f429.tar.gz rust-4e6356188f14b2c05957a4671e7a8e857fa5f429.zip | |
Check that const_panic_fmt is const too.
Diffstat (limited to 'compiler/rustc_mir')
| -rw-r--r-- | compiler/rustc_mir/src/const_eval/machine.rs | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/compiler/rustc_mir/src/const_eval/machine.rs b/compiler/rustc_mir/src/const_eval/machine.rs index 40621f6d4be..dae2fe91294 100644 --- a/compiler/rustc_mir/src/const_eval/machine.rs +++ b/compiler/rustc_mir/src/const_eval/machine.rs @@ -238,7 +238,7 @@ impl<'mir, 'tcx> interpret::Machine<'mir, 'tcx> for CompileTimeInterpreter<'mir, fn find_mir_or_eval_fn( ecx: &mut InterpCx<'mir, 'tcx, Self>, - mut instance: ty::Instance<'tcx>, + instance: ty::Instance<'tcx>, _abi: Abi, args: &[OpTy<'tcx>], _ret: Option<(&PlaceTy<'tcx>, mir::BasicBlock)>, @@ -258,7 +258,14 @@ impl<'mir, 'tcx> interpret::Machine<'mir, 'tcx> for CompileTimeInterpreter<'mir, // that for const fn! if let Some(new_instance) = ecx.hook_panic_fn(instance, args)? { // We call another const fn instead. - instance = new_instance; + return Self::find_mir_or_eval_fn( + ecx, + new_instance, + _abi, + args, + _ret, + _unwind, + ); } else { // We certainly do *not* want to actually call the fn // though, so be sure we return here. |
