-fn pop_set<T: Copy + Eq + ::std::hash::Hash>(set: &mut HashSet<T>) -> Option<T> {
- if let Some(elem) = set.iter().next().map(|elem| *elem) {
- set.remove(&elem);
- Some(elem)
- } else {
- None
- }
-}
-
-struct TransPlaceInterpreter;
-
-impl<'mir, 'tcx> Machine<'mir, 'tcx> for TransPlaceInterpreter {
- type MemoryKinds = !;
- type ExtraFnVal = !;
- type PointerTag = ();
- type AllocExtra = ();
- type MemoryExtra = ();
- type FrameExtra = ();
- type MemoryMap = FxHashMap<AllocId, (MemoryKind<!>, Allocation<()>)>;
-
- const CHECK_ALIGN: bool = true;
- const STATIC_KIND: Option<!> = None;
-
- fn enforce_validity(_: &InterpCx<'mir, 'tcx, Self>) -> bool {
- false
- }
-
- fn before_terminator(_: &mut InterpCx<'mir, 'tcx, Self>) -> InterpResult<'tcx> {
- panic!();
- }
-
- fn find_mir_or_eval_fn(
- _: &mut InterpCx<'mir, 'tcx, Self>,
- _: Instance<'tcx>,
- _: &[OpTy<'tcx>],
- _: Option<(PlaceTy<'tcx>, BasicBlock)>,
- _: Option<BasicBlock>,
- ) -> InterpResult<'tcx, Option<&'mir Body<'tcx>>> {
- panic!();
- }
-
- fn call_intrinsic(
- _: &mut InterpCx<'mir, 'tcx, Self>,
- _: Span,
- _: Instance<'tcx>,
- _: &[OpTy<'tcx>],
- _: Option<(PlaceTy<'tcx>, BasicBlock)>,
- _: Option<BasicBlock>,
- ) -> InterpResult<'tcx> {
- panic!();
- }
-
- fn find_foreign_static(_: TyCtxt<'tcx>, _: DefId) -> InterpResult<'tcx, Cow<'tcx, Allocation>> {
- panic!();
- }
-
- fn binary_ptr_op(
- _: &InterpCx<'mir, 'tcx, Self>,
- _: mir::BinOp,
- _: ImmTy<'tcx>,
- _: ImmTy<'tcx>,
- ) -> InterpResult<'tcx, (Scalar, bool, Ty<'tcx>)> {
- panic!();
- }
-
- fn ptr_to_int(_: &Memory<'mir, 'tcx, Self>, _: Pointer<()>) -> InterpResult<'tcx, u64> {
- panic!();
- }
-
- fn box_alloc(_: &mut InterpCx<'mir, 'tcx, Self>, _: PlaceTy<'tcx>) -> InterpResult<'tcx> {
- panic!();
- }
-
- fn init_allocation_extra<'b>(
- _: &(),
- _: AllocId,
- alloc: Cow<'b, Allocation>,
- _: Option<MemoryKind<!>>,
- ) -> (Cow<'b, Allocation<(), ()>>, ()) {
- (alloc, ())
- }
-
- fn tag_static_base_pointer(_: &(), _: AllocId) -> Self::PointerTag {
- ()
- }
-
- fn call_extra_fn(
- _: &mut InterpCx<'mir, 'tcx, Self>,
- _: !,
- _: &[OpTy<'tcx, ()>],
- _: Option<(PlaceTy<'tcx, ()>, BasicBlock)>,
- _: Option<BasicBlock>,
- ) -> InterpResult<'tcx> {
- unreachable!();
- }
-
- fn stack_push(_: &mut InterpCx<'mir, 'tcx, Self>) -> InterpResult<'tcx> {
- Ok(())
- }
-
- fn stack_pop(_: &mut InterpCx<'mir, 'tcx, Self>, _: (), _: bool) -> InterpResult<'tcx, StackPopInfo> {
- Ok(StackPopInfo::Normal)
- }
-
- fn assert_panic(
- _: &mut InterpCx<'mir, 'tcx, Self>,
- _: Span,
- _: &PanicInfo<Operand<'tcx>>,
- _: Option<BasicBlock>,
- ) -> InterpResult<'tcx> {
- unreachable!()
- }
-}
-
-pub fn mir_operand_get_const_val<'tcx>(
- fx: &FunctionCx<'_, 'tcx, impl Backend>,