diff --git a/rust-toolchain b/rust-toolchain index 8746986fb4f..cd37a8d267e 100644 --- a/rust-toolchain +++ b/rust-toolchain @@ -1 +1 @@ -nightly-2020-03-30 +nightly-2020-03-31 diff --git a/src/abi/comments.rs b/src/abi/comments.rs index 773b49f8e44..fb95a25606f 100644 --- a/src/abi/comments.rs +++ b/src/abi/comments.rs @@ -1,6 +1,6 @@ use std::borrow::Cow; -use rustc::mir; +use rustc_middle::mir; use crate::abi::pass_mode::*; use crate::prelude::*; diff --git a/src/allocator.rs b/src/allocator.rs index 0b40af9de54..2ea4a1659f8 100644 --- a/src/allocator.rs +++ b/src/allocator.rs @@ -15,7 +15,7 @@ use rustc_ast::expand::allocator::{AllocatorKind, AllocatorTy, ALLOCATOR_METHODS /// Returns whether an allocator shim was created pub(crate) fn codegen(tcx: TyCtxt<'_>, module: &mut Module) -> bool { let any_dynamic_crate = tcx.dependency_formats(LOCAL_CRATE).iter().any(|(_, list)| { - use rustc::middle::dependency_format::Linkage; + use rustc_middle::middle::dependency_format::Linkage; list.iter().any(|&linkage| linkage == Linkage::Dynamic) }); if any_dynamic_crate { diff --git a/src/analyze.rs b/src/analyze.rs index b82e16217ef..afb8ac409fe 100644 --- a/src/analyze.rs +++ b/src/analyze.rs @@ -1,6 +1,6 @@ use crate::prelude::*; -use rustc::mir::StatementKind::*; +use rustc_middle::mir::StatementKind::*; use rustc_index::vec::IndexVec; #[derive(Copy, Clone, Debug, PartialEq, Eq, Hash)] diff --git a/src/base.rs b/src/base.rs index d2841b25f5e..cc7692a6795 100644 --- a/src/base.rs +++ b/src/base.rs @@ -1,4 +1,4 @@ -use rustc::ty::adjustment::PointerCast; +use rustc_middle::ty::adjustment::PointerCast; use rustc_index::vec::IndexVec; use crate::prelude::*; @@ -592,7 +592,7 @@ fn trans_stmt<'tcx>( lval.write_cvalue(fx, CValue::by_val(len, usize_layout)); } Rvalue::NullaryOp(NullOp::Box, content_ty) => { - use rustc::middle::lang_items::ExchangeMallocFnLangItem; + use rustc_middle::middle::lang_items::ExchangeMallocFnLangItem; let usize_type = fx.clif_type(fx.tcx.types.usize).unwrap(); let content_ty = fx.monomorphize(content_ty); diff --git a/src/common.rs b/src/common.rs index 1d3fdfc75bf..4c0e314d3ff 100644 --- a/src/common.rs +++ b/src/common.rs @@ -1,4 +1,4 @@ -use rustc::ty::layout::{Integer, Primitive}; +use rustc_middle::ty::layout::{Integer, Primitive}; use rustc_target::spec::{HasTargetSpec, Target}; use rustc_index::vec::IndexVec; diff --git a/src/constant.rs b/src/constant.rs index 306f61aa074..1d98404c75f 100644 --- a/src/constant.rs +++ b/src/constant.rs @@ -2,11 +2,11 @@ use std::borrow::Cow; use rustc_span::DUMMY_SP; -use rustc::middle::codegen_fn_attrs::CodegenFnAttrFlags; -use rustc::mir::interpret::{ +use rustc_middle::middle::codegen_fn_attrs::CodegenFnAttrFlags; +use rustc_middle::mir::interpret::{ read_target_uint, AllocId, Allocation, ConstValue, GlobalAlloc, InterpResult, Scalar, }; -use rustc::ty::{layout::Align, Const, ConstKind}; +use rustc_middle::ty::{layout::Align, Const, ConstKind}; use rustc_data_structures::fx::FxHashSet; use rustc_mir::interpret::{ ImmTy, InterpCx, Machine, Memory, MemoryKind, OpTy, PlaceTy, Pointer, diff --git a/src/debuginfo/mod.rs b/src/debuginfo/mod.rs index 95fde120a9c..226d67fe044 100644 --- a/src/debuginfo/mod.rs +++ b/src/debuginfo/mod.rs @@ -16,7 +16,7 @@ use gimli::{Encoding, Format, LineEncoding, Register, RunTimeEndian, X86_64}; pub(crate) use emit::{DebugReloc, DebugRelocName}; fn target_endian(tcx: TyCtxt) -> RunTimeEndian { - use rustc::ty::layout::Endian; + use rustc_middle::ty::layout::Endian; match tcx.data_layout.endian { Endian::Big => RunTimeEndian::Big, diff --git a/src/driver/aot.rs b/src/driver/aot.rs index 71876816f39..b4f0a03bbd5 100644 --- a/src/driver/aot.rs +++ b/src/driver/aot.rs @@ -1,6 +1,6 @@ -use rustc::dep_graph::{WorkProduct, WorkProductFileKind, WorkProductId}; -use rustc::middle::cstore::EncodedMetadata; -use rustc::mir::mono::CodegenUnit; +use rustc_middle::dep_graph::{WorkProduct, WorkProductFileKind, WorkProductId}; +use rustc_middle::middle::cstore::EncodedMetadata; +use rustc_middle::mir::mono::CodegenUnit; use rustc_session::config::{DebugInfo, OutputType}; use rustc_session::cgu_reuse_tracker::CguReuse; use rustc_codegen_ssa::back::linker::LinkerInfo; @@ -170,7 +170,7 @@ pub(super) fn run_aot( let dep_node = cgu.codegen_dep_node(tcx); let (ModuleCodegenResult(module, work_product), _) = - tcx.dep_graph.with_task(dep_node, tcx, cgu.name(), module_codegen, rustc::dep_graph::hash_result); + tcx.dep_graph.with_task(dep_node, tcx, cgu.name(), module_codegen, rustc_middle::dep_graph::hash_result); if let Some((id, product)) = work_product { work_products.insert(id, product); @@ -207,7 +207,7 @@ pub(super) fn run_aot( let metadata_module = if need_metadata_module { let _timer = tcx.prof.generic_activity("codegen crate metadata"); let (metadata_cgu_name, tmp_file) = tcx.sess.time("write compressed metadata", || { - use rustc::mir::mono::CodegenUnitNameBuilder; + use rustc_middle::mir::mono::CodegenUnitNameBuilder; let cgu_name_builder = &mut CodegenUnitNameBuilder::new(tcx); let metadata_cgu_name = cgu_name_builder diff --git a/src/driver/jit.rs b/src/driver/jit.rs index d4582e6f1ff..b4d16011cad 100644 --- a/src/driver/jit.rs +++ b/src/driver/jit.rs @@ -81,7 +81,7 @@ pub(super) fn run_jit(tcx: TyCtxt<'_>) -> ! { } fn load_imported_symbols_for_jit(tcx: TyCtxt<'_>) -> Vec<(String, *const u8)> { - use rustc::middle::dependency_format::Linkage; + use rustc_middle::middle::dependency_format::Linkage; let mut dylib_paths = Vec::new(); diff --git a/src/driver/mod.rs b/src/driver/mod.rs index 7f46150252e..6aa736d18ce 100644 --- a/src/driver/mod.rs +++ b/src/driver/mod.rs @@ -1,7 +1,7 @@ use std::any::Any; -use rustc::middle::cstore::EncodedMetadata; -use rustc::mir::mono::{Linkage as RLinkage, MonoItem, Visibility}; +use rustc_middle::middle::cstore::EncodedMetadata; +use rustc_middle::mir::mono::{Linkage as RLinkage, MonoItem, Visibility}; use crate::prelude::*; diff --git a/src/intrinsics/llvm.rs b/src/intrinsics/llvm.rs index e1a0066fc48..b99a3dffa11 100644 --- a/src/intrinsics/llvm.rs +++ b/src/intrinsics/llvm.rs @@ -1,7 +1,7 @@ use crate::intrinsics::*; use crate::prelude::*; -use rustc::ty::subst::SubstsRef; +use rustc_middle::ty::subst::SubstsRef; pub(crate) fn codegen_llvm_intrinsic_call<'tcx>( fx: &mut FunctionCx<'_, 'tcx, impl Backend>, diff --git a/src/intrinsics/simd.rs b/src/intrinsics/simd.rs index d5c618a604d..cf7decb0464 100644 --- a/src/intrinsics/simd.rs +++ b/src/intrinsics/simd.rs @@ -67,7 +67,7 @@ pub(super) fn codegen_simd_intrinsic_call<'tcx>( let total_len = lane_count * 2; let indexes = { - use rustc::mir::interpret::*; + use rustc_middle::mir::interpret::*; let idx_const = crate::constant::mir_operand_get_const_val(fx, idx).expect("simd_shuffle* idx not const"); let idx_bytes = match idx_const.val { @@ -81,7 +81,7 @@ pub(super) fn codegen_simd_intrinsic_call<'tcx>( (0..ret_lane_count).map(|i| { let i = usize::try_from(i).unwrap(); - let idx = rustc::mir::interpret::read_target_uint( + let idx = rustc_middle::mir::interpret::read_target_uint( fx.tcx.data_layout.endian, &idx_bytes[4*i.. 4*i + 4], ).expect("read_target_uint"); diff --git a/src/lib.rs b/src/lib.rs index fb062071339..b23e74cd5bf 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -4,7 +4,7 @@ extern crate flate2; extern crate libc; extern crate tempfile; -extern crate rustc; +extern crate rustc_middle; extern crate rustc_codegen_ssa; extern crate rustc_data_structures; extern crate rustc_driver; @@ -21,11 +21,11 @@ extern crate rustc_ast; use std::any::Any; -use rustc::dep_graph::{DepGraph, WorkProduct, WorkProductId}; -use rustc::middle::cstore::{EncodedMetadata, MetadataLoader}; +use rustc_middle::dep_graph::{DepGraph, WorkProduct, WorkProductId}; +use rustc_middle::middle::cstore::{EncodedMetadata, MetadataLoader}; use rustc_session::config::OutputFilenames; -use rustc::ty::query::Providers; -use rustc::util::common::ErrorReported; +use rustc_middle::ty::query::Providers; +use rustc_middle::util::common::ErrorReported; use rustc_codegen_ssa::traits::CodegenBackend; use cranelift_codegen::settings; @@ -68,12 +68,12 @@ mod prelude { pub(crate) use rustc_ast::ast::{FloatTy, IntTy, UintTy}; pub(crate) use rustc_span::Span; - pub(crate) use rustc::bug; + pub(crate) use rustc_middle::bug; pub(crate) use rustc_hir::def_id::{DefId, LOCAL_CRATE}; - pub(crate) use rustc::mir::{self, *}; + pub(crate) use rustc_middle::mir::{self, *}; pub(crate) use rustc_session::Session; - pub(crate) use rustc::ty::layout::{self, Abi, LayoutOf, Scalar, Size, TyAndLayout, VariantIdx}; - pub(crate) use rustc::ty::{ + pub(crate) use rustc_middle::ty::layout::{self, Abi, LayoutOf, Scalar, Size, TyAndLayout, VariantIdx}; + pub(crate) use rustc_middle::ty::{ self, FnSig, Instance, InstanceDef, ParamEnv, Ty, TyCtxt, TypeAndMut, TypeFoldable, }; diff --git a/src/linkage.rs b/src/linkage.rs index 6b4c4353964..893ec851f10 100644 --- a/src/linkage.rs +++ b/src/linkage.rs @@ -1,4 +1,4 @@ -use rustc::mir::mono::{Linkage as RLinkage, MonoItem, Visibility}; +use rustc_middle::mir::mono::{Linkage as RLinkage, MonoItem, Visibility}; use crate::prelude::*; diff --git a/src/main_shim.rs b/src/main_shim.rs index ab264f2e85a..193d1cde163 100644 --- a/src/main_shim.rs +++ b/src/main_shim.rs @@ -3,7 +3,7 @@ use crate::prelude::*; /// Create the `main` function which will initialize the rust runtime and call /// users main function. pub(crate) fn maybe_create_entry_wrapper(tcx: TyCtxt<'_>, module: &mut Module) { - use rustc::middle::lang_items::StartFnLangItem; + use rustc_middle::middle::lang_items::StartFnLangItem; use rustc_session::config::EntryFnType; let (main_def_id, use_start_lang_item) = match tcx.entry_fn(LOCAL_CRATE) { diff --git a/src/metadata.rs b/src/metadata.rs index 748d4075a70..daf2127a376 100644 --- a/src/metadata.rs +++ b/src/metadata.rs @@ -2,9 +2,9 @@ use std::convert::TryFrom; use std::fs::File; use std::path::Path; -use rustc::middle::cstore::{EncodedMetadata, MetadataLoader}; +use rustc_middle::middle::cstore::{EncodedMetadata, MetadataLoader}; use rustc_session::config; -use rustc::ty::TyCtxt; +use rustc_middle::ty::TyCtxt; use rustc_codegen_ssa::METADATA_FILENAME; use rustc_data_structures::owning_ref::{self, OwningRef}; use rustc_data_structures::rustc_erase_owner; @@ -104,7 +104,7 @@ pub(crate) fn write_metadata(tcx: TyCtxt<'_>, product: &mut P) .unwrap(); product.add_rustc_section( - rustc::middle::exported_symbols::metadata_symbol_name(tcx), + rustc_middle::middle::exported_symbols::metadata_symbol_name(tcx), compressed, tcx.sess.target.target.options.is_like_osx, ); diff --git a/src/value_and_place.rs b/src/value_and_place.rs index 226c78ed01c..4f196d6f056 100644 --- a/src/value_and_place.rs +++ b/src/value_and_place.rs @@ -225,7 +225,7 @@ impl<'tcx> CValue<'tcx> { .iconst(clif_ty, u64::try_from(const_val).expect("uint") as i64) } ty::TyKind::Int(_) => { - let const_val = rustc::mir::interpret::sign_extend(const_val, layout.size); + let const_val = rustc_middle::mir::interpret::sign_extend(const_val, layout.size); fx.bcx.ins().iconst(clif_ty, i64::try_from(const_val as i128).unwrap()) } ty::TyKind::Float(FloatTy::F32) => {