File tree 1 file changed +2
-10
lines changed
compiler/rustc_target/src/abi
1 file changed +2
-10
lines changed Original file line number Diff line number Diff line change @@ -753,11 +753,7 @@ impl FieldsShape {
753
753
match * self {
754
754
FieldsShape :: Primitive => 0 ,
755
755
FieldsShape :: Union ( count) => count. get ( ) ,
756
- FieldsShape :: Array { count, .. } => {
757
- let usize_count = count as usize ;
758
- assert_eq ! ( usize_count as u64 , count) ;
759
- usize_count
760
- }
756
+ FieldsShape :: Array { count, .. } => count. try_into ( ) . unwrap ( ) ,
761
757
FieldsShape :: Arbitrary { ref offsets, .. } => offsets. len ( ) ,
762
758
}
763
759
}
@@ -791,11 +787,7 @@ impl FieldsShape {
791
787
unreachable ! ( "FieldsShape::memory_index: `Primitive`s have no fields" )
792
788
}
793
789
FieldsShape :: Union ( _) | FieldsShape :: Array { .. } => i,
794
- FieldsShape :: Arbitrary { ref memory_index, .. } => {
795
- let r = memory_index[ i] ;
796
- assert_eq ! ( r as usize as u32 , r) ;
797
- r as usize
798
- }
790
+ FieldsShape :: Arbitrary { ref memory_index, .. } => memory_index[ i] . try_into ( ) . unwrap ( ) ,
799
791
}
800
792
}
801
793
You can’t perform that action at this time.
0 commit comments