@@ -19,7 +19,7 @@ use syntax_pos::{Span, DUMMY_SP};
19
19
use rustc:: ty:: subst:: InternalSubsts ;
20
20
use rustc_data_structures:: indexed_vec:: IndexVec ;
21
21
use rustc:: ty:: layout:: {
22
- LayoutOf , TyLayout , LayoutError , HasTyCtxt , TargetDataLayout , HasDataLayout , Size ,
22
+ LayoutOf , TyLayout , LayoutError , HasTyCtxt , TargetDataLayout , HasDataLayout ,
23
23
} ;
24
24
25
25
use crate :: interpret:: {
@@ -396,30 +396,21 @@ impl<'mir, 'tcx> ConstPropagator<'mir, 'tcx> {
396
396
if let ty:: Slice ( _) = mplace. layout . ty . sty {
397
397
let len = mplace. meta . unwrap ( ) . to_usize ( & self . ecx ) . unwrap ( ) ;
398
398
399
- Some ( ImmTy {
400
- imm : Immediate :: Scalar (
401
- Scalar :: from_uint (
402
- len,
403
- Size :: from_bits (
404
- self . tcx . sess . target . usize_ty . bit_width ( ) . unwrap ( ) as u64
405
- )
406
- ) . into ( ) ,
407
- ) ,
408
- layout : self . tcx . layout_of ( self . param_env . and ( self . tcx . types . usize ) ) . ok ( ) ?,
409
- } . into ( ) )
399
+ Some ( ImmTy :: from_uint (
400
+ len,
401
+ self . tcx . layout_of ( self . param_env . and ( self . tcx . types . usize ) ) . ok ( ) ?,
402
+ ) . into ( ) )
410
403
} else {
411
404
trace ! ( "not slice: {:?}" , mplace. layout. ty. sty) ;
412
405
None
413
406
}
414
407
} ,
415
408
Rvalue :: NullaryOp ( NullOp :: SizeOf , ty) => {
416
409
type_size_of ( self . tcx , self . param_env , ty) . and_then ( |n| Some (
417
- ImmTy {
418
- imm : Immediate :: Scalar (
419
- Scalar :: from_uint ( n, self . tcx . data_layout . pointer_size ) . into ( )
420
- ) ,
421
- layout : self . tcx . layout_of ( self . param_env . and ( self . tcx . types . usize ) ) . ok ( ) ?,
422
- } . into ( )
410
+ ImmTy :: from_uint (
411
+ n,
412
+ self . tcx . layout_of ( self . param_env . and ( self . tcx . types . usize ) ) . ok ( ) ?,
413
+ ) . into ( )
423
414
) )
424
415
}
425
416
Rvalue :: UnaryOp ( op, ref arg) => {
0 commit comments