@@ -4,12 +4,9 @@ use std::mem;
44use log:: trace;
55
66use 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 } ;
128use rustc_hir:: def_id:: { DefId , CRATE_DEF_INDEX } ;
9+ use rustc_target:: abi:: { LayoutOf , Size , FieldsShape , Variants } ;
1310
1411use 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 }
0 commit comments