diff options
| author | Deadbeef <ent3rm4n@gmail.com> | 2025-07-07 19:56:56 +0800 |
|---|---|---|
| committer | Deadbeef <ent3rm4n@gmail.com> | 2025-07-07 19:57:04 +0800 |
| commit | be6cd11d1be706bddbf32c0344e3248c0fb84eaa (patch) | |
| tree | 47542a46290c6b9370890826056a612e8420e13b /compiler/rustc_const_eval/src/const_eval | |
| parent | 75d5834a6c571cb0455acb5128ad51118fcbf2be (diff) | |
make `Machine::load_mir` infallible
it doesn't need to return an `InterpResult`.
Diffstat (limited to 'compiler/rustc_const_eval/src/const_eval')
| -rw-r--r-- | compiler/rustc_const_eval/src/const_eval/machine.rs | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/compiler/rustc_const_eval/src/const_eval/machine.rs b/compiler/rustc_const_eval/src/const_eval/machine.rs index 76fa744361a..52fc898192a 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), } } |
