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

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
127a11a344eb59b5aea1464e98257c262dcba967
1+
537ccdf3ac44c8c7a8d36cbdbe6fb224afabb7ae

src/eval.rs

+1-1
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

+7-10
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

+1-2
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

+3-7
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

+2-5
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

+1-1
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

+3-5
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

+2-3
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

+1-1
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> {

src/shims/foreign_items/windows.rs

+5-3
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
1-
use crate::*;
2-
use rustc_middle::mir;
3-
use rustc_middle::ty::layout::Size;
41
use std::iter;
52

3+
use rustc_middle::mir;
4+
use rustc_target::abi::Size;
5+
6+
use crate::*;
7+
68
impl<'mir, 'tcx> EvalContextExt<'mir, 'tcx> for crate::MiriEvalContext<'mir, 'tcx> {}
79
pub trait EvalContextExt<'mir, 'tcx: 'mir>: crate::MiriEvalContextExt<'mir, 'tcx> {
810
fn emulate_foreign_item_by_name(

src/shims/fs.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ use std::path::Path;
66
use std::time::SystemTime;
77

88
use rustc_data_structures::fx::FxHashMap;
9-
use rustc_middle::ty::layout::{Align, LayoutOf, Size};
9+
use rustc_target::abi::{Align, LayoutOf, Size};
1010

1111
use crate::stacked_borrows::Tag;
1212
use crate::*;

src/shims/intrinsics.rs

+2-3
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,9 @@
11
use std::iter;
22
use std::convert::TryFrom;
33

4-
use rustc_middle::mir;
5-
use rustc_middle::ty;
6-
use rustc_middle::ty::layout::{Align, LayoutOf};
4+
use rustc_middle::{mir, ty};
75
use rustc_apfloat::Float;
6+
use rustc_target::abi::{Align, LayoutOf};
87

98
use crate::*;
109

src/shims/os_str.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ use std::os::unix::ffi::{OsStrExt, OsStringExt};
99
#[cfg(windows)]
1010
use std::os::windows::ffi::{OsStrExt, OsStringExt};
1111

12-
use rustc_middle::ty::layout::LayoutOf;
12+
use rustc_target::abi::LayoutOf;
1313

1414
use crate::*;
1515

src/shims/panic.rs

+2-3
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,8 @@
1313
1414
use log::trace;
1515

16-
use rustc_middle::mir;
17-
use rustc_middle::ty::{self, layout::LayoutOf};
18-
use rustc_target::spec::PanicStrategy;
16+
use rustc_middle::{mir, ty};
17+
use rustc_target::{spec::PanicStrategy, abi::LayoutOf};
1918

2019
use crate::*;
2120

src/shims/time.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
use std::time::{Duration, SystemTime, Instant};
22
use std::convert::TryFrom;
33

4+
use rustc_target::abi::LayoutOf;
5+
46
use crate::stacked_borrows::Tag;
57
use crate::*;
68
use helpers::{immty_from_int_checked, immty_from_uint_checked};
79

8-
use rustc_middle::ty::layout::LayoutOf;
9-
1010
/// Returns the time elapsed between the provided time and the unix epoch as a `Duration`.
1111
pub fn system_time_to_duration<'tcx>(time: &SystemTime) -> InterpResult<'tcx, Duration> {
1212
time.duration_since(SystemTime::UNIX_EPOCH)

src/shims/tls.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@ use std::collections::BTreeMap;
44

55
use log::trace;
66

7-
use rustc_middle::{ty, ty::layout::{Size, HasDataLayout}};
8-
use rustc_target::abi::LayoutOf;
7+
use rustc_middle::ty;
8+
use rustc_target::abi::{LayoutOf, Size, HasDataLayout};
99

1010
use crate::{HelpersEvalContextExt, InterpResult, MPlaceTy, Scalar, StackPopCleanup, Tag};
1111

src/stacked_borrows.rs

+2-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,8 @@ use log::trace;
1010

1111
use rustc_data_structures::fx::{FxHashMap, FxHashSet};
1212
use rustc_middle::mir::RetagKind;
13-
use rustc_middle::ty::{self, layout::Size};
13+
use rustc_middle::ty;
14+
use rustc_target::abi::Size;
1415
use rustc_hir::Mutability;
1516

1617
use crate::*;

0 commit comments

Comments
 (0)