From 3fedc7b249fd5f9450b6c2d2df28a5b828166ac9 Mon Sep 17 00:00:00 2001 From: hyd-dev Date: Mon, 6 Sep 2021 23:05:48 +0800 Subject: [PATCH] `rustc_target::abi::LayoutOf` -> `rustc_middle::ty::layout::LayoutOf` --- rust-version | 2 +- src/eval.rs | 7 +++++-- src/helpers.rs | 8 ++++++-- src/machine.rs | 4 ++-- src/shims/backtrace.rs | 2 +- src/shims/env.rs | 3 ++- src/shims/intrinsics.rs | 4 ++-- src/shims/os_str.rs | 3 ++- src/shims/posix/foreign_items.rs | 3 ++- src/shims/posix/fs.rs | 4 ++-- src/shims/posix/thread.rs | 2 +- src/stacked_borrows.rs | 4 ++-- 12 files changed, 28 insertions(+), 18 deletions(-) diff --git a/rust-version b/rust-version index 4dab723fbdd..33be6b9182b 100644 --- a/rust-version +++ b/rust-version @@ -1 +1 @@ -6cfa773583bb5123e630668f5bfe466716225546 +1c858ba5bf7bd06c1a970efbf77053c8380b3151 diff --git a/src/eval.rs b/src/eval.rs index 2b8fc0f5ade..f6adbd48cd5 100644 --- a/src/eval.rs +++ b/src/eval.rs @@ -6,8 +6,11 @@ use std::ffi::OsStr; use log::info; use rustc_hir::def_id::DefId; -use rustc_middle::ty::{self, layout::LayoutCx, TyCtxt}; -use rustc_target::abi::LayoutOf; +use rustc_middle::ty::{ + self, + layout::{LayoutCx, LayoutOf}, + TyCtxt, +}; use rustc_target::spec::abi::Abi; use crate::*; diff --git a/src/helpers.rs b/src/helpers.rs index 1b683169023..081712dddc8 100644 --- a/src/helpers.rs +++ b/src/helpers.rs @@ -7,9 +7,13 @@ use log::trace; use rustc_hir::def_id::{DefId, CRATE_DEF_INDEX}; use rustc_middle::mir; -use rustc_middle::ty::{self, layout::TyAndLayout, List, TyCtxt}; +use rustc_middle::ty::{ + self, + layout::{LayoutOf, TyAndLayout}, + List, TyCtxt, +}; use rustc_span::Symbol; -use rustc_target::abi::{Align, FieldsShape, LayoutOf, Size, Variants}; +use rustc_target::abi::{Align, FieldsShape, Size, Variants}; use rustc_target::spec::abi::Abi; use rand::RngCore; diff --git a/src/machine.rs b/src/machine.rs index 62c1a93079c..fb39503b538 100644 --- a/src/machine.rs +++ b/src/machine.rs @@ -16,13 +16,13 @@ use rustc_middle::{ mir, ty::{ self, - layout::{LayoutCx, LayoutError, TyAndLayout}, + layout::{LayoutCx, LayoutError, LayoutOf, TyAndLayout}, Instance, TyCtxt, }, }; use rustc_span::def_id::DefId; use rustc_span::symbol::{sym, Symbol}; -use rustc_target::abi::{LayoutOf, Size}; +use rustc_target::abi::Size; use rustc_target::spec::abi::Abi; use crate::*; diff --git a/src/shims/backtrace.rs b/src/shims/backtrace.rs index 1ac3a22f7ed..eb25cfd9935 100644 --- a/src/shims/backtrace.rs +++ b/src/shims/backtrace.rs @@ -1,6 +1,6 @@ -use crate::rustc_target::abi::LayoutOf as _; use crate::*; use rustc_ast::ast::Mutability; +use rustc_middle::ty::layout::LayoutOf as _; use rustc_middle::ty::{self, TypeAndMut}; use rustc_span::{BytePos, Symbol}; use rustc_target::{abi::Size, spec::abi::Abi}; diff --git a/src/shims/env.rs b/src/shims/env.rs index 9290ec022b5..74c0b56e467 100644 --- a/src/shims/env.rs +++ b/src/shims/env.rs @@ -4,8 +4,9 @@ use std::ffi::{OsStr, OsString}; use std::io::ErrorKind; use rustc_data_structures::fx::FxHashMap; +use rustc_middle::ty::layout::LayoutOf; use rustc_mir::interpret::Pointer; -use rustc_target::abi::{LayoutOf, Size}; +use rustc_target::abi::Size; use crate::*; diff --git a/src/shims/intrinsics.rs b/src/shims/intrinsics.rs index fd1a3f3e598..f2f046a3ada 100644 --- a/src/shims/intrinsics.rs +++ b/src/shims/intrinsics.rs @@ -3,9 +3,9 @@ use std::iter; use log::trace; use rustc_apfloat::{Float, Round}; -use rustc_middle::ty::layout::IntegerExt; +use rustc_middle::ty::layout::{IntegerExt, LayoutOf}; use rustc_middle::{mir, mir::BinOp, ty, ty::FloatTy}; -use rustc_target::abi::{Align, Integer, LayoutOf}; +use rustc_target::abi::{Align, Integer}; use crate::*; use helpers::check_arg_count; diff --git a/src/shims/os_str.rs b/src/shims/os_str.rs index 83bb344982c..ede29d04d6b 100644 --- a/src/shims/os_str.rs +++ b/src/shims/os_str.rs @@ -9,7 +9,8 @@ use std::os::unix::ffi::{OsStrExt, OsStringExt}; #[cfg(windows)] use std::os::windows::ffi::{OsStrExt, OsStringExt}; -use rustc_target::abi::{Align, LayoutOf, Size}; +use rustc_middle::ty::layout::LayoutOf; +use rustc_target::abi::{Align, Size}; use crate::*; diff --git a/src/shims/posix/foreign_items.rs b/src/shims/posix/foreign_items.rs index 09dd7d9c7b8..6d417fd0967 100644 --- a/src/shims/posix/foreign_items.rs +++ b/src/shims/posix/foreign_items.rs @@ -1,8 +1,9 @@ use log::trace; use rustc_middle::mir; +use rustc_middle::ty::layout::LayoutOf; use rustc_span::Symbol; -use rustc_target::abi::{Align, LayoutOf, Size}; +use rustc_target::abi::{Align, Size}; use rustc_target::spec::abi::Abi; use crate::*; diff --git a/src/shims/posix/fs.rs b/src/shims/posix/fs.rs index ac6e878da96..36c07603770 100644 --- a/src/shims/posix/fs.rs +++ b/src/shims/posix/fs.rs @@ -11,8 +11,8 @@ use std::time::SystemTime; use log::trace; use rustc_data_structures::fx::FxHashMap; -use rustc_middle::ty; -use rustc_target::abi::{Align, LayoutOf, Size}; +use rustc_middle::ty::{self, layout::LayoutOf}; +use rustc_target::abi::{Align, Size}; use crate::*; use helpers::{check_arg_count, immty_from_int_checked, immty_from_uint_checked}; diff --git a/src/shims/posix/thread.rs b/src/shims/posix/thread.rs index 9926c36c49a..e64ef3b23c6 100644 --- a/src/shims/posix/thread.rs +++ b/src/shims/posix/thread.rs @@ -1,7 +1,7 @@ use std::convert::TryInto; use crate::*; -use rustc_target::abi::LayoutOf; +use rustc_middle::ty::layout::LayoutOf; use rustc_target::spec::abi::Abi; impl<'mir, 'tcx> EvalContextExt<'mir, 'tcx> for crate::MiriEvalContext<'mir, 'tcx> {} diff --git a/src/stacked_borrows.rs b/src/stacked_borrows.rs index e04de65ac3f..65678b6f01f 100644 --- a/src/stacked_borrows.rs +++ b/src/stacked_borrows.rs @@ -9,8 +9,8 @@ use std::num::NonZeroU64; use rustc_data_structures::fx::{FxHashMap, FxHashSet}; use rustc_hir::Mutability; use rustc_middle::mir::RetagKind; -use rustc_middle::ty; -use rustc_target::abi::{LayoutOf, Size}; +use rustc_middle::ty::{self, layout::LayoutOf}; +use rustc_target::abi::Size; use crate::*;