@@ -740,10 +740,7 @@ impl FieldPlacement {
740
740
#[ derive( Copy , Clone , PartialEq , Eq , Hash , Debug ) ]
741
741
pub enum Abi {
742
742
Scalar ( Primitive ) ,
743
- Vector {
744
- element : Primitive ,
745
- count : u64
746
- } ,
743
+ Vector ,
747
744
Aggregate {
748
745
/// If true, the size is exact, otherwise it's only a lower bound.
749
746
sized : bool ,
@@ -755,15 +752,15 @@ impl Abi {
755
752
/// Returns true if the layout corresponds to an unsized type.
756
753
pub fn is_unsized ( & self ) -> bool {
757
754
match * self {
758
- Abi :: Scalar ( _) | Abi :: Vector { .. } => false ,
755
+ Abi :: Scalar ( _) | Abi :: Vector => false ,
759
756
Abi :: Aggregate { sized, .. } => !sized
760
757
}
761
758
}
762
759
763
760
/// Returns true if the fields of the layout are packed.
764
761
pub fn is_packed ( & self ) -> bool {
765
762
match * self {
766
- Abi :: Scalar ( _) | Abi :: Vector { .. } => false ,
763
+ Abi :: Scalar ( _) | Abi :: Vector => false ,
767
764
Abi :: Aggregate { packed, .. } => packed
768
765
}
769
766
}
@@ -1202,14 +1199,14 @@ impl<'a, 'tcx> CachedLayout {
1202
1199
ty:: TyAdt ( def, ..) if def. repr . simd ( ) => {
1203
1200
let count = ty. simd_size ( tcx) as u64 ;
1204
1201
let element = cx. layout_of ( ty. simd_type ( tcx) ) ?;
1205
- let element_scalar = match element. abi {
1206
- Abi :: Scalar ( value ) => value ,
1202
+ match element. abi {
1203
+ Abi :: Scalar ( _ ) => { }
1207
1204
_ => {
1208
1205
tcx. sess . fatal ( & format ! ( "monomorphising SIMD type `{}` with \
1209
1206
a non-machine element type `{}`",
1210
1207
ty, element. ty) ) ;
1211
1208
}
1212
- } ;
1209
+ }
1213
1210
let size = element. size . checked_mul ( count, dl)
1214
1211
. ok_or ( LayoutError :: SizeOverflow ( ty) ) ?;
1215
1212
let align = dl. vector_align ( size) ;
@@ -1221,10 +1218,7 @@ impl<'a, 'tcx> CachedLayout {
1221
1218
stride : element. size ,
1222
1219
count
1223
1220
} ,
1224
- abi : Abi :: Vector {
1225
- element : element_scalar,
1226
- count
1227
- } ,
1221
+ abi : Abi :: Vector ,
1228
1222
size,
1229
1223
align,
1230
1224
primitive_align : align
@@ -2076,7 +2070,7 @@ impl<'a, 'tcx> TyLayout<'tcx> {
2076
2070
pub fn is_zst ( & self ) -> bool {
2077
2071
match self . abi {
2078
2072
Abi :: Scalar ( _) => false ,
2079
- Abi :: Vector { count , .. } => count == 0 ,
2073
+ Abi :: Vector => self . size . bytes ( ) == 0 ,
2080
2074
Abi :: Aggregate { sized, .. } => sized && self . size . bytes ( ) == 0
2081
2075
}
2082
2076
}
@@ -2233,10 +2227,7 @@ impl<'gcx> HashStable<StableHashingContext<'gcx>> for Abi {
2233
2227
Scalar ( ref value) => {
2234
2228
value. hash_stable ( hcx, hasher) ;
2235
2229
}
2236
- Vector { ref element, count } => {
2237
- element. hash_stable ( hcx, hasher) ;
2238
- count. hash_stable ( hcx, hasher) ;
2239
- }
2230
+ Vector => { }
2240
2231
Aggregate { packed, sized } => {
2241
2232
packed. hash_stable ( hcx, hasher) ;
2242
2233
sized. hash_stable ( hcx, hasher) ;
0 commit comments