Skip to content

Commit 147ea8f

Browse files
committed
Auto merge of #1299 - RalfJung:rustup, r=RalfJung
rustup for import changes
2 parents 4955ce3 + 9f3383d commit 147ea8f

18 files changed

+39
-52
lines changed

rust-version

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
127a11a344eb59b5aea1464e98257c262dcba967
1+
537ccdf3ac44c8c7a8d36cbdbe6fb224afabb7ae

src/eval.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ use std::convert::TryFrom;
66
use rand::rngs::StdRng;
77
use rand::SeedableRng;
88

9-
use rustc_middle::ty::layout::LayoutOf;
9+
use rustc_target::abi::LayoutOf;
1010
use rustc_middle::ty::{self, TyCtxt};
1111
use rustc_hir::def_id::DefId;
1212

src/helpers.rs

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,9 @@ use std::mem;
44
use log::trace;
55

66
use rustc_middle::mir;
7-
use rustc_middle::ty::{
8-
self,
9-
layout::{self, LayoutOf, Size, TyAndLayout},
10-
List, TyCtxt,
11-
};
7+
use rustc_middle::ty::{self, List, TyCtxt, layout::TyAndLayout};
128
use rustc_hir::def_id::{DefId, CRATE_DEF_INDEX};
9+
use rustc_target::abi::{LayoutOf, Size, FieldsShape, Variants};
1310

1411
use rand::RngCore;
1512

@@ -298,7 +295,7 @@ pub trait EvalContextExt<'mir, 'tcx: 'mir>: crate::MiriEvalContextExt<'mir, 'tcx
298295
// walking this value, we have to make sure it is not a
299296
// `Variants::Multiple`.
300297
match v.layout.variants {
301-
layout::Variants::Multiple { .. } => {
298+
Variants::Multiple { .. } => {
302299
// A multi-variant enum, or generator, or so.
303300
// Treat this like a union: without reading from memory,
304301
// we cannot determine the variant we are in. Reading from
@@ -308,7 +305,7 @@ pub trait EvalContextExt<'mir, 'tcx: 'mir>: crate::MiriEvalContextExt<'mir, 'tcx
308305
// `UnsafeCell` action.
309306
(self.unsafe_cell_action)(v)
310307
}
311-
layout::Variants::Single { .. } => {
308+
Variants::Single { .. } => {
312309
// Proceed further, try to find where exactly that `UnsafeCell`
313310
// is hiding.
314311
self.walk_value(v)
@@ -324,19 +321,19 @@ pub trait EvalContextExt<'mir, 'tcx: 'mir>: crate::MiriEvalContextExt<'mir, 'tcx
324321
fields: impl Iterator<Item = InterpResult<'tcx, MPlaceTy<'tcx, Tag>>>,
325322
) -> InterpResult<'tcx> {
326323
match place.layout.fields {
327-
layout::FieldsShape::Array { .. } => {
324+
FieldsShape::Array { .. } => {
328325
// For the array layout, we know the iterator will yield sorted elements so
329326
// we can avoid the allocation.
330327
self.walk_aggregate(place, fields)
331328
}
332-
layout::FieldsShape::Arbitrary { .. } => {
329+
FieldsShape::Arbitrary { .. } => {
333330
// Gather the subplaces and sort them before visiting.
334331
let mut places =
335332
fields.collect::<InterpResult<'tcx, Vec<MPlaceTy<'tcx, Tag>>>>()?;
336333
places.sort_by_key(|place| place.ptr.assert_ptr().offset);
337334
self.walk_aggregate(place, places.into_iter().map(Ok))
338335
}
339-
layout::FieldsShape::Union { .. } => {
336+
FieldsShape::Union { .. } => {
340337
// Uh, what?
341338
bug!("a union is not an aggregate we should ever visit")
342339
}

src/intptrcast.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,8 @@ use log::trace;
66
use rand::Rng;
77

88
use rustc_data_structures::fx::FxHashMap;
9-
use rustc_middle::ty::layout::HasDataLayout;
109
use rustc_mir::interpret::{AllocCheck, AllocId, InterpResult, Memory, Machine, Pointer, PointerArithmetic};
11-
use rustc_target::abi::Size;
10+
use rustc_target::abi::{Size, HasDataLayout};
1211

1312
use crate::{Evaluator, Tag, STACK_ADDR};
1413

src/machine.rs

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,8 @@ use log::trace;
1111
use rand::rngs::StdRng;
1212

1313
use rustc_data_structures::fx::FxHashMap;
14-
use rustc_middle::mir;
15-
use rustc_middle::ty::{
16-
self,
17-
layout::{LayoutOf, Size},
18-
Ty,
19-
};
14+
use rustc_middle::{mir, ty};
15+
use rustc_target::abi::{LayoutOf, Size};
2016
use rustc_ast::attr;
2117
use rustc_span::symbol::{sym, Symbol};
2218

@@ -303,7 +299,7 @@ impl<'mir, 'tcx> Machine<'mir, 'tcx> for Evaluator<'tcx> {
303299
bin_op: mir::BinOp,
304300
left: ImmTy<'tcx, Tag>,
305301
right: ImmTy<'tcx, Tag>,
306-
) -> InterpResult<'tcx, (Scalar<Tag>, bool, Ty<'tcx>)> {
302+
) -> InterpResult<'tcx, (Scalar<Tag>, bool, ty::Ty<'tcx>)> {
307303
ecx.binary_ptr_op(bin_op, left, right)
308304
}
309305

src/operator.rs

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,8 @@ use std::convert::TryFrom;
22

33
use log::trace;
44

5-
use rustc_middle::mir;
6-
use rustc_middle::ty::{
7-
layout::{LayoutOf, Size},
8-
Ty,
9-
};
5+
use rustc_middle::{mir, ty::Ty};
6+
use rustc_target::abi::{LayoutOf, Size};
107

118
use crate::*;
129

src/range_map.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
88
use std::ops;
99

10-
use rustc_middle::ty::layout::Size;
10+
use rustc_target::abi::Size;
1111

1212
#[derive(Clone, Debug)]
1313
struct Elem<T> {

src/shims/env.rs

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,12 @@ use std::ffi::{OsString, OsStr};
22
use std::env;
33
use std::convert::TryFrom;
44

5-
use crate::stacked_borrows::Tag;
6-
use crate::rustc_target::abi::LayoutOf;
7-
use crate::*;
8-
5+
use rustc_target::abi::{Size, LayoutOf};
96
use rustc_data_structures::fx::FxHashMap;
10-
use rustc_middle::ty::layout::Size;
117
use rustc_mir::interpret::Pointer;
128

9+
use crate::*;
10+
1311
/// Check whether an operation that writes to a target buffer was successful.
1412
/// Accordingly select return value.
1513
/// Local helper function to be used in Windows shims.

src/shims/foreign_items.rs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,8 @@ mod posix;
44
use std::{convert::{TryInto, TryFrom}, iter};
55

66
use rustc_hir::def_id::DefId;
7-
use rustc_middle::mir;
8-
use rustc_middle::ty;
9-
use rustc_middle::ty::layout::{Align, Size};
7+
use rustc_middle::{mir, ty};
8+
use rustc_target::abi::{Align, Size};
109
use rustc_apfloat::Float;
1110
use rustc_span::symbol::sym;
1211
use rustc_ast::attr;

src/shims/foreign_items/posix.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ use log::trace;
77

88
use crate::*;
99
use rustc_middle::mir;
10-
use rustc_middle::ty::layout::{Align, LayoutOf, Size};
10+
use rustc_target::abi::{Align, LayoutOf, Size};
1111

1212
impl<'mir, 'tcx> EvalContextExt<'mir, 'tcx> for crate::MiriEvalContext<'mir, 'tcx> {}
1313
pub trait EvalContextExt<'mir, 'tcx: 'mir>: crate::MiriEvalContextExt<'mir, 'tcx> {

0 commit comments

Comments
 (0)