Auto merge of #125602 - RalfJung:interpret-mir-lifetime, r=oli-obk · rust-lang/rust@a59072e

@@ -44,20 +44,20 @@ impl HasStaticRootDefId for DummyMachine {

4444

}

4545

}

464647-

impl<'mir, 'tcx: 'mir> interpret::Machine<'mir, 'tcx> for DummyMachine {

48-

interpret::compile_time_machine!(<'mir, 'tcx>);

47+

impl<'tcx> interpret::Machine<'tcx> for DummyMachine {

48+

interpret::compile_time_machine!(<'tcx>);

4949

type MemoryKind = !;

5050

const PANIC_ON_ALLOC_FAIL: bool = true;

51515252

// We want to just eval random consts in the program, so `eval_mir_const` can fail.

5353

const ALL_CONSTS_ARE_PRECHECKED: bool = false;

54545555

#[inline(always)]

56-

fn enforce_alignment(_ecx: &InterpCx<'mir, 'tcx, Self>) -> bool {

56+

fn enforce_alignment(_ecx: &InterpCx<'tcx, Self>) -> bool {

5757

false // no reason to enforce alignment

5858

}

595960-

fn enforce_validity(_ecx: &InterpCx<'mir, 'tcx, Self>, _layout: TyAndLayout<'tcx>) -> bool {

60+

fn enforce_validity(_ecx: &InterpCx<'tcx, Self>, _layout: TyAndLayout<'tcx>) -> bool {

6161

false

6262

}

6363

@@ -83,26 +83,26 @@ impl<'mir, 'tcx: 'mir> interpret::Machine<'mir, 'tcx> for DummyMachine {

8383

}

84848585

fn find_mir_or_eval_fn(

86-

_ecx: &mut InterpCx<'mir, 'tcx, Self>,

86+

_ecx: &mut InterpCx<'tcx, Self>,

8787

_instance: ty::Instance<'tcx>,

8888

_abi: rustc_target::spec::abi::Abi,

8989

_args: &[interpret::FnArg<'tcx, Self::Provenance>],

9090

_destination: &interpret::MPlaceTy<'tcx, Self::Provenance>,

9191

_target: Option<BasicBlock>,

9292

_unwind: UnwindAction,

93-

) -> interpret::InterpResult<'tcx, Option<(&'mir Body<'tcx>, ty::Instance<'tcx>)>> {

93+

) -> interpret::InterpResult<'tcx, Option<(&'tcx Body<'tcx>, ty::Instance<'tcx>)>> {

9494

unimplemented!()

9595

}

96969797

fn panic_nounwind(

98-

_ecx: &mut InterpCx<'mir, 'tcx, Self>,

98+

_ecx: &mut InterpCx<'tcx, Self>,

9999

_msg: &str,

100100

) -> interpret::InterpResult<'tcx> {

101101

unimplemented!()

102102

}

103103104104

fn call_intrinsic(

105-

_ecx: &mut InterpCx<'mir, 'tcx, Self>,

105+

_ecx: &mut InterpCx<'tcx, Self>,

106106

_instance: ty::Instance<'tcx>,

107107

_args: &[interpret::OpTy<'tcx, Self::Provenance>],

108108

_destination: &interpret::MPlaceTy<'tcx, Self::Provenance>,

@@ -113,15 +113,15 @@ impl<'mir, 'tcx: 'mir> interpret::Machine<'mir, 'tcx> for DummyMachine {

113113

}

114114115115

fn assert_panic(

116-

_ecx: &mut InterpCx<'mir, 'tcx, Self>,

116+

_ecx: &mut InterpCx<'tcx, Self>,

117117

_msg: &rustc_middle::mir::AssertMessage<'tcx>,

118118

_unwind: UnwindAction,

119119

) -> interpret::InterpResult<'tcx> {

120120

unimplemented!()

121121

}

122122123123

fn binary_ptr_op(

124-

ecx: &InterpCx<'mir, 'tcx, Self>,

124+

ecx: &InterpCx<'tcx, Self>,

125125

bin_op: BinOp,

126126

left: &interpret::ImmTy<'tcx, Self::Provenance>,

127127

right: &interpret::ImmTy<'tcx, Self::Provenance>,

@@ -168,32 +168,30 @@ impl<'mir, 'tcx: 'mir> interpret::Machine<'mir, 'tcx> for DummyMachine {

168168

}

169169170170

fn expose_ptr(

171-

_ecx: &mut InterpCx<'mir, 'tcx, Self>,

171+

_ecx: &mut InterpCx<'tcx, Self>,

172172

_ptr: interpret::Pointer<Self::Provenance>,

173173

) -> interpret::InterpResult<'tcx> {

174174

unimplemented!()

175175

}

176176177177

fn init_frame_extra(

178-

_ecx: &mut InterpCx<'mir, 'tcx, Self>,

179-

_frame: interpret::Frame<'mir, 'tcx, Self::Provenance>,

180-

) -> interpret::InterpResult<

181-

'tcx,

182-

interpret::Frame<'mir, 'tcx, Self::Provenance, Self::FrameExtra>,

183-

> {

178+

_ecx: &mut InterpCx<'tcx, Self>,

179+

_frame: interpret::Frame<'tcx, Self::Provenance>,

180+

) -> interpret::InterpResult<'tcx, interpret::Frame<'tcx, Self::Provenance, Self::FrameExtra>>

181+

{

184182

unimplemented!()

185183

}

186184187185

fn stack<'a>(

188-

_ecx: &'a InterpCx<'mir, 'tcx, Self>,

189-

) -> &'a [interpret::Frame<'mir, 'tcx, Self::Provenance, Self::FrameExtra>] {

186+

_ecx: &'a InterpCx<'tcx, Self>,

187+

) -> &'a [interpret::Frame<'tcx, Self::Provenance, Self::FrameExtra>] {

190188

// Return an empty stack instead of panicking, as `cur_span` uses it to evaluate constants.

191189

&[]

192190

}

193191194192

fn stack_mut<'a>(

195-

_ecx: &'a mut InterpCx<'mir, 'tcx, Self>,

196-

) -> &'a mut Vec<interpret::Frame<'mir, 'tcx, Self::Provenance, Self::FrameExtra>> {

193+

_ecx: &'a mut InterpCx<'tcx, Self>,

194+

) -> &'a mut Vec<interpret::Frame<'tcx, Self::Provenance, Self::FrameExtra>> {

197195

unimplemented!()

198196

}

199197

}