diff --git a/src/base.rs b/src/base.rs index 2bc1af2fc59..5bc98237cd3 100644 --- a/src/base.rs +++ b/src/base.rs @@ -288,7 +288,7 @@ fn codegen_fn_content<'a, 'tcx: 'a>(fx: &mut FunctionCx<'a, 'tcx, impl Backend>) } => { let ty = location.ty(fx.mir, fx.tcx).ty; let ty = fx.monomorphize(&ty); - let drop_fn = crate::rustc_mir::monomorphize::resolve_drop_in_place(fx.tcx, ty); + let drop_fn = Instance::resolve_drop_in_place(fx.tcx, ty); if let ty::InstanceDef::DropGlue(_, None) = drop_fn.def { // we don't actually need to drop anything @@ -603,7 +603,7 @@ fn is_fat_ptr<'a, 'tcx: 'a>(fx: &FunctionCx<'a, 'tcx, impl Backend>, ty: Ty<'tcx let operand = trans_operand(fx, operand); match operand.layout().ty.sty { ty::Closure(def_id, substs) => { - let instance = rustc_mir::monomorphize::resolve_closure( + let instance = Instance::resolve_closure( fx.tcx, def_id, substs, diff --git a/src/constant.rs b/src/constant.rs index b4e6273cfcb..e9ea58ed1b1 100644 --- a/src/constant.rs +++ b/src/constant.rs @@ -5,7 +5,7 @@ }; use rustc::ty::Const; use rustc_mir::interpret::{ - InterpretCx, ImmTy, MPlaceTy, Machine, Memory, MemoryKind, OpTy, PlaceTy, Pointer, + InterpretCx, ImmTy, Machine, Memory, MemoryKind, OpTy, PlaceTy, StackPopCleanup, }; @@ -375,7 +375,6 @@ fn call_intrinsic( fn find_foreign_static( _: DefId, _: ::rustc::ty::query::TyCtxtAt<'a, 'tcx, 'tcx>, - _: &(), ) -> EvalResult<'tcx, Cow<'tcx, Allocation>> { panic!(); } @@ -393,27 +392,17 @@ fn box_alloc(_: &mut InterpretCx<'a, 'mir, 'tcx, Self>, _: PlaceTy<'tcx>) -> Eva panic!(); } - fn tag_dereference( - _: &InterpretCx<'a, 'mir, 'tcx, Self>, - _: MPlaceTy<'tcx>, - _: Option<::rustc::hir::Mutability>, - ) -> EvalResult<'tcx, Scalar> { - panic!(); + fn tag_allocation<'b>( + _: AllocId, + alloc: Cow<'b, Allocation>, + _: Option>, + _: &(), + ) -> (Cow<'b, Allocation<(), ()>>, ()) { + (alloc, ()) } - fn adjust_static_allocation<'alloc>( - alloc: &'alloc Allocation, - _: &(), - ) -> Cow<'alloc, Allocation> { - Cow::Borrowed(alloc) - } - - fn new_allocation( - _: Size, - _: &(), - _: MemoryKind, - ) -> ((), ()) { - ((), ()) + fn tag_static_base_pointer(_: AllocId, _: &()) -> Self::PointerTag { + () } fn stack_push(_: &mut InterpretCx<'a, 'mir, 'tcx, Self>) -> EvalResult<'tcx> { diff --git a/src/driver.rs b/src/driver.rs index 6c66ee0f82e..beaa24d62f5 100644 --- a/src/driver.rs +++ b/src/driver.rs @@ -8,7 +8,6 @@ use rustc::session::config::{DebugInfo, OutputType}; use rustc_codegen_ssa::back::linker::LinkerInfo; use rustc_codegen_ssa::CrateInfo; -use rustc_mir::monomorphize::partitioning::CodegenUnitExt; use cranelift_faerie::*; diff --git a/src/lib.rs b/src/lib.rs index 2cdd9737426..0d545ebb9af 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -56,7 +56,7 @@ mod prelude { pub use rustc::bug; pub use rustc::hir::def_id::{CrateNum, DefId, LOCAL_CRATE}; - pub use rustc::mir::{self, interpret::AllocId, *}; + pub use rustc::mir::{self, interpret::AllocId, mono::MonoItem, *}; pub use rustc::session::{ config::{CrateType, Lto}, Session, @@ -71,7 +71,7 @@ mod prelude { indexed_vec::Idx, sync::Lrc, }; - pub use rustc_mir::monomorphize::{collector, MonoItem}; + pub use rustc_mir::monomorphize::collector; pub use rustc_codegen_ssa::mir::operand::{OperandRef, OperandValue}; pub use rustc_codegen_ssa::traits::*; diff --git a/src/vtable.rs b/src/vtable.rs index a19b6b458c4..d89f16ded0d 100644 --- a/src/vtable.rs +++ b/src/vtable.rs @@ -89,7 +89,7 @@ fn build_vtable<'a, 'tcx: 'a>( let drop_in_place_fn = import_function( tcx, fx.module, - crate::rustc_mir::monomorphize::resolve_drop_in_place(tcx, ty), + Instance::resolve_drop_in_place(tcx, ty), ); let mut components: Vec<_> = vec![Some(drop_in_place_fn), None, None];