Check that const_panic_fmt is const too.
This commit is contained in:
parent
38bf5b0412
commit
4e6356188f
1 changed files with 9 additions and 2 deletions
|
@ -238,7 +238,7 @@ impl<'mir, 'tcx> interpret::Machine<'mir, 'tcx> for CompileTimeInterpreter<'mir,
|
||||||
|
|
||||||
fn find_mir_or_eval_fn(
|
fn find_mir_or_eval_fn(
|
||||||
ecx: &mut InterpCx<'mir, 'tcx, Self>,
|
ecx: &mut InterpCx<'mir, 'tcx, Self>,
|
||||||
mut instance: ty::Instance<'tcx>,
|
instance: ty::Instance<'tcx>,
|
||||||
_abi: Abi,
|
_abi: Abi,
|
||||||
args: &[OpTy<'tcx>],
|
args: &[OpTy<'tcx>],
|
||||||
_ret: Option<(&PlaceTy<'tcx>, mir::BasicBlock)>,
|
_ret: Option<(&PlaceTy<'tcx>, mir::BasicBlock)>,
|
||||||
|
@ -258,7 +258,14 @@ impl<'mir, 'tcx> interpret::Machine<'mir, 'tcx> for CompileTimeInterpreter<'mir,
|
||||||
// that for const fn!
|
// that for const fn!
|
||||||
if let Some(new_instance) = ecx.hook_panic_fn(instance, args)? {
|
if let Some(new_instance) = ecx.hook_panic_fn(instance, args)? {
|
||||||
// We call another const fn instead.
|
// We call another const fn instead.
|
||||||
instance = new_instance;
|
return Self::find_mir_or_eval_fn(
|
||||||
|
ecx,
|
||||||
|
new_instance,
|
||||||
|
_abi,
|
||||||
|
args,
|
||||||
|
_ret,
|
||||||
|
_unwind,
|
||||||
|
);
|
||||||
} else {
|
} else {
|
||||||
// We certainly do *not* want to actually call the fn
|
// We certainly do *not* want to actually call the fn
|
||||||
// though, so be sure we return here.
|
// though, so be sure we return here.
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue