From 161c8aa5cf129d98b2c0b52744b7ef5385f9701c Mon Sep 17 00:00:00 2001 From: bjorn3 Date: Thu, 6 Jun 2019 20:31:09 +0200 Subject: [PATCH] Rustup to rustc 1.37.0-nightly (7cdaffd79 2019-06-05) --- src/base.rs | 4 ++-- src/constant.rs | 31 ++++++++++--------------------- src/driver.rs | 1 - src/lib.rs | 4 ++-- src/vtable.rs | 2 +- 5 files changed, 15 insertions(+), 27 deletions(-) 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 trans_stmt<'a, 'tcx: 'a>( 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::mir::interpret::{ }; 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 @@ impl<'a, 'mir, 'tcx> Machine<'a, 'mir, 'tcx> for TransPlaceInterpreter { fn find_foreign_static( _: DefId, _: ::rustc::ty::query::TyCtxtAt<'a, 'tcx, 'tcx>, - _: &(), ) -> EvalResult<'tcx, Cow<'tcx, Allocation>> { panic!(); } @@ -393,27 +392,17 @@ impl<'a, 'mir, 'tcx> Machine<'a, 'mir, 'tcx> for TransPlaceInterpreter { 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::mir::mono::{Linkage as RLinkage, Visibility}; 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];