Auto merge of #1299 - RalfJung:rustup, r=RalfJung
rustup for import changes
This commit is contained in:
commit
147ea8f400
@ -1 +1 @@
|
||||
127a11a344eb59b5aea1464e98257c262dcba967
|
||||
537ccdf3ac44c8c7a8d36cbdbe6fb224afabb7ae
|
||||
|
@ -6,7 +6,7 @@
|
||||
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;
|
||||
|
||||
|
@ -4,12 +4,9 @@
|
||||
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 @@ fn visit_value(&mut self, v: MPlaceTy<'tcx, Tag>) -> InterpResult<'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 @@ fn visit_value(&mut self, v: MPlaceTy<'tcx, Tag>) -> InterpResult<'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 @@ fn visit_aggregate(
|
||||
fields: impl Iterator<Item = InterpResult<'tcx, MPlaceTy<'tcx, Tag>>>,
|
||||
) -> 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::<InterpResult<'tcx, Vec<MPlaceTy<'tcx, Tag>>>>()?;
|
||||
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")
|
||||
}
|
||||
|
@ -6,9 +6,8 @@
|
||||
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};
|
||||
|
||||
|
@ -11,12 +11,8 @@
|
||||
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 @@ fn binary_ptr_op(
|
||||
bin_op: mir::BinOp,
|
||||
left: ImmTy<'tcx, Tag>,
|
||||
right: ImmTy<'tcx, Tag>,
|
||||
) -> InterpResult<'tcx, (Scalar<Tag>, bool, Ty<'tcx>)> {
|
||||
) -> InterpResult<'tcx, (Scalar<Tag>, bool, ty::Ty<'tcx>)> {
|
||||
ecx.binary_ptr_op(bin_op, left, right)
|
||||
}
|
||||
|
||||
|
@ -2,11 +2,8 @@
|
||||
|
||||
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::*;
|
||||
|
||||
|
@ -7,7 +7,7 @@
|
||||
|
||||
use std::ops;
|
||||
|
||||
use rustc_middle::ty::layout::Size;
|
||||
use rustc_target::abi::Size;
|
||||
|
||||
#[derive(Clone, Debug)]
|
||||
struct Elem<T> {
|
||||
|
@ -2,14 +2,12 @@
|
||||
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.
|
||||
|
@ -4,9 +4,8 @@
|
||||
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;
|
||||
|
@ -7,7 +7,7 @@
|
||||
|
||||
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> {
|
||||
|
@ -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(
|
||||
|
@ -6,7 +6,7 @@
|
||||
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::*;
|
||||
|
@ -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::*;
|
||||
|
||||
|
@ -9,7 +9,7 @@
|
||||
#[cfg(windows)]
|
||||
use std::os::windows::ffi::{OsStrExt, OsStringExt};
|
||||
|
||||
use rustc_middle::ty::layout::LayoutOf;
|
||||
use rustc_target::abi::LayoutOf;
|
||||
|
||||
use crate::*;
|
||||
|
||||
|
@ -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::*;
|
||||
|
||||
|
@ -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)
|
||||
|
@ -4,8 +4,8 @@
|
||||
|
||||
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};
|
||||
|
||||
|
@ -10,7 +10,8 @@
|
||||
|
||||
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::*;
|
||||
|
Loading…
Reference in New Issue
Block a user