1+ use rustc_abi:: { Endian , HasDataLayout , Integer , Size , TagEncoding , Variants } ;
12use rustc_data_structures:: fx:: FxHashMap ;
23use rustc_middle:: mir:: interpret:: AllocId ;
34use rustc_middle:: mir:: * ;
45use rustc_middle:: ty:: util:: IntTypeExt ;
56use rustc_middle:: ty:: { self , AdtDef , ParamEnv , Ty , TyCtxt } ;
67use rustc_session:: Session ;
7- use rustc_target:: abi:: { HasDataLayout , Size , TagEncoding , Variants } ;
88
99/// A pass that seeks to optimize unnecessary moves of large enum types, if there is a large
1010/// enough discrepancy between them.
@@ -249,8 +249,8 @@ impl EnumSizeOpt {
249249 macro_rules! encode_store {
250250 ( $curr_idx: expr, $endian: expr, $bytes: expr) => {
251251 let bytes = match $endian {
252- rustc_target :: abi :: Endian :: Little => $bytes. to_le_bytes( ) ,
253- rustc_target :: abi :: Endian :: Big => $bytes. to_be_bytes( ) ,
252+ Endian :: Little => $bytes. to_le_bytes( ) ,
253+ Endian :: Big => $bytes. to_be_bytes( ) ,
254254 } ;
255255 for ( i, b) in bytes. into_iter( ) . enumerate( ) {
256256 data[ $curr_idx + i] = b;
@@ -263,10 +263,10 @@ impl EnumSizeOpt {
263263 target_bytes * adt_def. discriminant_for_variant ( tcx, var_idx) . val as usize ;
264264 let sz = layout. size ;
265265 match ptr_sized_int {
266- rustc_target :: abi :: Integer :: I32 => {
266+ Integer :: I32 => {
267267 encode_store ! ( curr_idx, data_layout. endian, sz. bytes( ) as u32 ) ;
268268 }
269- rustc_target :: abi :: Integer :: I64 => {
269+ Integer :: I64 => {
270270 encode_store ! ( curr_idx, data_layout. endian, sz. bytes( ) ) ;
271271 }
272272 _ => unreachable ! ( ) ,
0 commit comments