diff --git a/rust-version b/rust-version index 2cb1f848a68..e3dc200835f 100644 --- a/rust-version +++ b/rust-version @@ -1 +1 @@ -127a11a344eb59b5aea1464e98257c262dcba967 +537ccdf3ac44c8c7a8d36cbdbe6fb224afabb7ae diff --git a/src/eval.rs b/src/eval.rs index a4867bd5de4..46e66bc0a81 100644 --- a/src/eval.rs +++ b/src/eval.rs @@ -6,7 +6,7 @@ use std::convert::TryFrom; use rand::rngs::StdRng; use rand::SeedableRng; -use rustc_middle::ty::layout::LayoutOf; +use rustc_target::abi::LayoutOf; use rustc_middle::ty::{self, TyCtxt}; use rustc_hir::def_id::DefId; diff --git a/src/helpers.rs b/src/helpers.rs index 7b1ac1aacfc..9f46a0c1ce2 100644 --- a/src/helpers.rs +++ b/src/helpers.rs @@ -4,12 +4,9 @@ use std::mem; use log::trace; use rustc_middle::mir; -use rustc_middle::ty::{ - self, - layout::{self, LayoutOf, Size, TyAndLayout}, - List, TyCtxt, -}; +use rustc_middle::ty::{self, List, TyCtxt, layout::TyAndLayout}; use rustc_hir::def_id::{DefId, CRATE_DEF_INDEX}; +use rustc_target::abi::{LayoutOf, Size, FieldsShape, Variants}; use rand::RngCore; @@ -298,7 +295,7 @@ pub trait EvalContextExt<'mir, 'tcx: 'mir>: crate::MiriEvalContextExt<'mir, 'tcx // walking this value, we have to make sure it is not a // `Variants::Multiple`. match v.layout.variants { - layout::Variants::Multiple { .. } => { + Variants::Multiple { .. } => { // A multi-variant enum, or generator, or so. // Treat this like a union: without reading from memory, // we cannot determine the variant we are in. Reading from @@ -308,7 +305,7 @@ pub trait EvalContextExt<'mir, 'tcx: 'mir>: crate::MiriEvalContextExt<'mir, 'tcx // `UnsafeCell` action. (self.unsafe_cell_action)(v) } - layout::Variants::Single { .. } => { + Variants::Single { .. } => { // Proceed further, try to find where exactly that `UnsafeCell` // is hiding. self.walk_value(v) @@ -324,19 +321,19 @@ pub trait EvalContextExt<'mir, 'tcx: 'mir>: crate::MiriEvalContextExt<'mir, 'tcx fields: impl Iterator>>, ) -> InterpResult<'tcx> { match place.layout.fields { - layout::FieldsShape::Array { .. } => { + FieldsShape::Array { .. } => { // For the array layout, we know the iterator will yield sorted elements so // we can avoid the allocation. self.walk_aggregate(place, fields) } - layout::FieldsShape::Arbitrary { .. } => { + FieldsShape::Arbitrary { .. } => { // Gather the subplaces and sort them before visiting. let mut places = fields.collect::>>>()?; places.sort_by_key(|place| place.ptr.assert_ptr().offset); self.walk_aggregate(place, places.into_iter().map(Ok)) } - layout::FieldsShape::Union { .. } => { + FieldsShape::Union { .. } => { // Uh, what? bug!("a union is not an aggregate we should ever visit") } diff --git a/src/intptrcast.rs b/src/intptrcast.rs index 8eb28e4f470..ac27138d763 100644 --- a/src/intptrcast.rs +++ b/src/intptrcast.rs @@ -6,9 +6,8 @@ use log::trace; use rand::Rng; use rustc_data_structures::fx::FxHashMap; -use rustc_middle::ty::layout::HasDataLayout; use rustc_mir::interpret::{AllocCheck, AllocId, InterpResult, Memory, Machine, Pointer, PointerArithmetic}; -use rustc_target::abi::Size; +use rustc_target::abi::{Size, HasDataLayout}; use crate::{Evaluator, Tag, STACK_ADDR}; diff --git a/src/machine.rs b/src/machine.rs index 61c9f71407b..f794453228b 100644 --- a/src/machine.rs +++ b/src/machine.rs @@ -11,12 +11,8 @@ use log::trace; use rand::rngs::StdRng; use rustc_data_structures::fx::FxHashMap; -use rustc_middle::mir; -use rustc_middle::ty::{ - self, - layout::{LayoutOf, Size}, - Ty, -}; +use rustc_middle::{mir, ty}; +use rustc_target::abi::{LayoutOf, Size}; use rustc_ast::attr; use rustc_span::symbol::{sym, Symbol}; @@ -303,7 +299,7 @@ impl<'mir, 'tcx> Machine<'mir, 'tcx> for Evaluator<'tcx> { bin_op: mir::BinOp, left: ImmTy<'tcx, Tag>, right: ImmTy<'tcx, Tag>, - ) -> InterpResult<'tcx, (Scalar, bool, Ty<'tcx>)> { + ) -> InterpResult<'tcx, (Scalar, bool, ty::Ty<'tcx>)> { ecx.binary_ptr_op(bin_op, left, right) } diff --git a/src/operator.rs b/src/operator.rs index 2232be713ed..a28a0098e92 100644 --- a/src/operator.rs +++ b/src/operator.rs @@ -2,11 +2,8 @@ use std::convert::TryFrom; use log::trace; -use rustc_middle::mir; -use rustc_middle::ty::{ - layout::{LayoutOf, Size}, - Ty, -}; +use rustc_middle::{mir, ty::Ty}; +use rustc_target::abi::{LayoutOf, Size}; use crate::*; diff --git a/src/range_map.rs b/src/range_map.rs index 1d12d8a1ba6..16ad5fd7c2b 100644 --- a/src/range_map.rs +++ b/src/range_map.rs @@ -7,7 +7,7 @@ use std::ops; -use rustc_middle::ty::layout::Size; +use rustc_target::abi::Size; #[derive(Clone, Debug)] struct Elem { diff --git a/src/shims/env.rs b/src/shims/env.rs index 3ffe4fc421f..44016827229 100644 --- a/src/shims/env.rs +++ b/src/shims/env.rs @@ -2,14 +2,12 @@ use std::ffi::{OsString, OsStr}; use std::env; use std::convert::TryFrom; -use crate::stacked_borrows::Tag; -use crate::rustc_target::abi::LayoutOf; -use crate::*; - +use rustc_target::abi::{Size, LayoutOf}; use rustc_data_structures::fx::FxHashMap; -use rustc_middle::ty::layout::Size; use rustc_mir::interpret::Pointer; +use crate::*; + /// Check whether an operation that writes to a target buffer was successful. /// Accordingly select return value. /// Local helper function to be used in Windows shims. diff --git a/src/shims/foreign_items.rs b/src/shims/foreign_items.rs index da2f9d439c7..7e7f17b0dbd 100644 --- a/src/shims/foreign_items.rs +++ b/src/shims/foreign_items.rs @@ -4,9 +4,8 @@ mod posix; use std::{convert::{TryInto, TryFrom}, iter}; use rustc_hir::def_id::DefId; -use rustc_middle::mir; -use rustc_middle::ty; -use rustc_middle::ty::layout::{Align, Size}; +use rustc_middle::{mir, ty}; +use rustc_target::abi::{Align, Size}; use rustc_apfloat::Float; use rustc_span::symbol::sym; use rustc_ast::attr; diff --git a/src/shims/foreign_items/posix.rs b/src/shims/foreign_items/posix.rs index 28161592985..c9fd59c6932 100644 --- a/src/shims/foreign_items/posix.rs +++ b/src/shims/foreign_items/posix.rs @@ -7,7 +7,7 @@ use log::trace; use crate::*; use rustc_middle::mir; -use rustc_middle::ty::layout::{Align, LayoutOf, Size}; +use rustc_target::abi::{Align, LayoutOf, Size}; impl<'mir, 'tcx> EvalContextExt<'mir, 'tcx> for crate::MiriEvalContext<'mir, 'tcx> {} pub trait EvalContextExt<'mir, 'tcx: 'mir>: crate::MiriEvalContextExt<'mir, 'tcx> { diff --git a/src/shims/foreign_items/windows.rs b/src/shims/foreign_items/windows.rs index ee39773d71f..276dd8fda9f 100644 --- a/src/shims/foreign_items/windows.rs +++ b/src/shims/foreign_items/windows.rs @@ -1,8 +1,10 @@ -use crate::*; -use rustc_middle::mir; -use rustc_middle::ty::layout::Size; use std::iter; +use rustc_middle::mir; +use rustc_target::abi::Size; + +use crate::*; + impl<'mir, 'tcx> EvalContextExt<'mir, 'tcx> for crate::MiriEvalContext<'mir, 'tcx> {} pub trait EvalContextExt<'mir, 'tcx: 'mir>: crate::MiriEvalContextExt<'mir, 'tcx> { fn emulate_foreign_item_by_name( diff --git a/src/shims/fs.rs b/src/shims/fs.rs index 89d067be860..52244dcfc84 100644 --- a/src/shims/fs.rs +++ b/src/shims/fs.rs @@ -6,7 +6,7 @@ use std::path::Path; use std::time::SystemTime; use rustc_data_structures::fx::FxHashMap; -use rustc_middle::ty::layout::{Align, LayoutOf, Size}; +use rustc_target::abi::{Align, LayoutOf, Size}; use crate::stacked_borrows::Tag; use crate::*; diff --git a/src/shims/intrinsics.rs b/src/shims/intrinsics.rs index b7900bfaa5d..844eac398de 100644 --- a/src/shims/intrinsics.rs +++ b/src/shims/intrinsics.rs @@ -1,10 +1,9 @@ use std::iter; use std::convert::TryFrom; -use rustc_middle::mir; -use rustc_middle::ty; -use rustc_middle::ty::layout::{Align, LayoutOf}; +use rustc_middle::{mir, ty}; use rustc_apfloat::Float; +use rustc_target::abi::{Align, LayoutOf}; use crate::*; diff --git a/src/shims/os_str.rs b/src/shims/os_str.rs index 704994da4bd..c24d6df41e3 100644 --- a/src/shims/os_str.rs +++ b/src/shims/os_str.rs @@ -9,7 +9,7 @@ use std::os::unix::ffi::{OsStrExt, OsStringExt}; #[cfg(windows)] use std::os::windows::ffi::{OsStrExt, OsStringExt}; -use rustc_middle::ty::layout::LayoutOf; +use rustc_target::abi::LayoutOf; use crate::*; diff --git a/src/shims/panic.rs b/src/shims/panic.rs index 3474945980a..33e47147a33 100644 --- a/src/shims/panic.rs +++ b/src/shims/panic.rs @@ -13,9 +13,8 @@ use log::trace; -use rustc_middle::mir; -use rustc_middle::ty::{self, layout::LayoutOf}; -use rustc_target::spec::PanicStrategy; +use rustc_middle::{mir, ty}; +use rustc_target::{spec::PanicStrategy, abi::LayoutOf}; use crate::*; diff --git a/src/shims/time.rs b/src/shims/time.rs index 735b52528fd..a7fca5e0dde 100644 --- a/src/shims/time.rs +++ b/src/shims/time.rs @@ -1,12 +1,12 @@ use std::time::{Duration, SystemTime, Instant}; use std::convert::TryFrom; +use rustc_target::abi::LayoutOf; + use crate::stacked_borrows::Tag; use crate::*; use helpers::{immty_from_int_checked, immty_from_uint_checked}; -use rustc_middle::ty::layout::LayoutOf; - /// Returns the time elapsed between the provided time and the unix epoch as a `Duration`. pub fn system_time_to_duration<'tcx>(time: &SystemTime) -> InterpResult<'tcx, Duration> { time.duration_since(SystemTime::UNIX_EPOCH) diff --git a/src/shims/tls.rs b/src/shims/tls.rs index 76f946f724e..36ad4bd9b69 100644 --- a/src/shims/tls.rs +++ b/src/shims/tls.rs @@ -4,8 +4,8 @@ use std::collections::BTreeMap; use log::trace; -use rustc_middle::{ty, ty::layout::{Size, HasDataLayout}}; -use rustc_target::abi::LayoutOf; +use rustc_middle::ty; +use rustc_target::abi::{LayoutOf, Size, HasDataLayout}; use crate::{HelpersEvalContextExt, InterpResult, MPlaceTy, Scalar, StackPopCleanup, Tag}; diff --git a/src/stacked_borrows.rs b/src/stacked_borrows.rs index 90920069c5e..89b2a8bb3e2 100644 --- a/src/stacked_borrows.rs +++ b/src/stacked_borrows.rs @@ -10,7 +10,8 @@ use log::trace; use rustc_data_structures::fx::{FxHashMap, FxHashSet}; use rustc_middle::mir::RetagKind; -use rustc_middle::ty::{self, layout::Size}; +use rustc_middle::ty; +use rustc_target::abi::Size; use rustc_hir::Mutability; use crate::*;