diff --git a/compiler/rustc_const_eval/src/const_eval/machine.rs b/compiler/rustc_const_eval/src/const_eval/machine.rs index 76fa744361a47..52fc898192ade 100644 --- a/compiler/rustc_const_eval/src/const_eval/machine.rs +++ b/compiler/rustc_const_eval/src/const_eval/machine.rs @@ -331,10 +331,10 @@ impl<'tcx> interpret::Machine<'tcx> for CompileTimeMachine<'tcx> { fn load_mir( ecx: &InterpCx<'tcx, Self>, instance: ty::InstanceKind<'tcx>, - ) -> InterpResult<'tcx, &'tcx mir::Body<'tcx>> { + ) -> &'tcx mir::Body<'tcx> { match instance { - ty::InstanceKind::Item(def) => interp_ok(ecx.tcx.mir_for_ctfe(def)), - _ => interp_ok(ecx.tcx.instance_mir(instance)), + ty::InstanceKind::Item(def) => ecx.tcx.mir_for_ctfe(def), + _ => ecx.tcx.instance_mir(instance), } } diff --git a/compiler/rustc_const_eval/src/interpret/eval_context.rs b/compiler/rustc_const_eval/src/interpret/eval_context.rs index 46c784b41c66b..068d6369f8769 100644 --- a/compiler/rustc_const_eval/src/interpret/eval_context.rs +++ b/compiler/rustc_const_eval/src/interpret/eval_context.rs @@ -272,7 +272,7 @@ impl<'tcx, M: Machine<'tcx>> InterpCx<'tcx, M> { let def = instance.def_id(); &self.tcx.promoted_mir(def)[promoted] } else { - M::load_mir(self, instance)? + M::load_mir(self, instance) }; // do not continue if typeck errors occurred (can only occur in local crate) if let Some(err) = body.tainted_by_errors { diff --git a/compiler/rustc_const_eval/src/interpret/machine.rs b/compiler/rustc_const_eval/src/interpret/machine.rs index 35ec303f96197..844c19fea2dba 100644 --- a/compiler/rustc_const_eval/src/interpret/machine.rs +++ b/compiler/rustc_const_eval/src/interpret/machine.rs @@ -189,8 +189,8 @@ pub trait Machine<'tcx>: Sized { fn load_mir( ecx: &InterpCx<'tcx, Self>, instance: ty::InstanceKind<'tcx>, - ) -> InterpResult<'tcx, &'tcx mir::Body<'tcx>> { - interp_ok(ecx.tcx.instance_mir(instance)) + ) -> &'tcx mir::Body<'tcx> { + ecx.tcx.instance_mir(instance) } /// Entry point to all function calls.