diff --git a/src/librustc_mir/const_eval.rs b/src/librustc_mir/const_eval.rs index e2d5eec6502e..f280ea7aa466 100644 --- a/src/librustc_mir/const_eval.rs +++ b/src/librustc_mir/const_eval.rs @@ -337,7 +337,7 @@ impl<'mir, 'tcx> interpret::Machine<'mir, 'tcx> for CompileTimeInterpreter<'mir, // Some functions we support even if they are non-const -- but avoid testing // that for const fn! We certainly do *not* want to actually call the fn // though, so be sure we return here. - return if ecx.hook_fn(instance, args, dest)? { + return if ecx.hook_panic_fn(instance, args, dest)? { ecx.goto_block(ret)?; // fully evaluated and done Ok(None) } else { diff --git a/src/librustc_mir/interpret/intrinsics.rs b/src/librustc_mir/interpret/intrinsics.rs index d6d53a740bb2..ce16b89d6ea8 100644 --- a/src/librustc_mir/interpret/intrinsics.rs +++ b/src/librustc_mir/interpret/intrinsics.rs @@ -354,9 +354,10 @@ impl<'mir, 'tcx, M: Machine<'mir, 'tcx>> InterpCx<'mir, 'tcx, M> { Ok(true) } - /// "Intercept" a function call because we have something special to do for it. + /// "Intercept" a function call to a panic-related function + /// because we have something special to do for it. /// Returns `true` if an intercept happened. - pub fn hook_fn( + pub fn hook_panic_fn( &mut self, instance: ty::Instance<'tcx>, args: &[OpTy<'tcx, M::PointerTag>],