1
+ use rustc_abi:: { Endian , HasDataLayout , Integer , Size , TagEncoding , Variants } ;
1
2
use rustc_data_structures:: fx:: FxHashMap ;
2
3
use rustc_middle:: mir:: interpret:: AllocId ;
3
4
use rustc_middle:: mir:: * ;
4
5
use rustc_middle:: ty:: util:: IntTypeExt ;
5
6
use rustc_middle:: ty:: { self , AdtDef , ParamEnv , Ty , TyCtxt } ;
6
7
use rustc_session:: Session ;
7
- use rustc_target:: abi:: { HasDataLayout , Size , TagEncoding , Variants } ;
8
8
9
9
/// A pass that seeks to optimize unnecessary moves of large enum types, if there is a large
10
10
/// enough discrepancy between them.
@@ -249,8 +249,8 @@ impl EnumSizeOpt {
249
249
macro_rules! encode_store {
250
250
( $curr_idx: expr, $endian: expr, $bytes: expr) => {
251
251
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( ) ,
254
254
} ;
255
255
for ( i, b) in bytes. into_iter( ) . enumerate( ) {
256
256
data[ $curr_idx + i] = b;
@@ -263,10 +263,10 @@ impl EnumSizeOpt {
263
263
target_bytes * adt_def. discriminant_for_variant ( tcx, var_idx) . val as usize ;
264
264
let sz = layout. size ;
265
265
match ptr_sized_int {
266
- rustc_target :: abi :: Integer :: I32 => {
266
+ Integer :: I32 => {
267
267
encode_store ! ( curr_idx, data_layout. endian, sz. bytes( ) as u32 ) ;
268
268
}
269
- rustc_target :: abi :: Integer :: I64 => {
269
+ Integer :: I64 => {
270
270
encode_store ! ( curr_idx, data_layout. endian, sz. bytes( ) ) ;
271
271
}
272
272
_ => unreachable ! ( ) ,
0 commit comments