@@ -6,7 +6,7 @@ use crate::codegen_cx::CodegenCx;
6
6
use crate :: spirv_type:: SpirvType ;
7
7
use itertools:: Itertools ;
8
8
use rspirv:: spirv:: { Dim , ImageFormat , StorageClass , Word } ;
9
- use rustc_abi:: ExternAbi as Abi ;
9
+ use rustc_abi:: { AbiAlign , ExternAbi as Abi } ;
10
10
use rustc_abi:: {
11
11
Align , BackendRepr , FieldIdx , FieldsShape , LayoutData , Primitive , ReprFlags , ReprOptions ,
12
12
Scalar , Size , TagEncoding , VariantIdx , Variants ,
@@ -223,8 +223,8 @@ pub(crate) fn provide(providers: &mut Providers) {
223
223
224
224
// Compute the size and alignment of the vector:
225
225
let size = e_ly. size . checked_mul ( e_len, & cx) . unwrap ( ) ;
226
- let align = e_ly. align ;
227
- let size = size. align_to ( align. abi ) ;
226
+ let align = adt_def . repr ( ) . align . unwrap_or ( e_ly. align . abi ) ;
227
+ let size = size. align_to ( align) ;
228
228
229
229
let layout = tcx. mk_layout ( LayoutData {
230
230
variants : Variants :: Single {
@@ -241,9 +241,9 @@ pub(crate) fn provide(providers: &mut Providers) {
241
241
largest_niche : e_ly. largest_niche ,
242
242
uninhabited : false ,
243
243
size,
244
- align,
244
+ align : AbiAlign :: new ( align ) ,
245
245
max_repr_align : None ,
246
- unadjusted_abi_align : align. abi ,
246
+ unadjusted_abi_align : align,
247
247
randomization_seed : e_ly. randomization_seed . wrapping_add ( Hash64 :: new ( e_len) ) ,
248
248
} ) ;
249
249
@@ -324,7 +324,7 @@ pub(crate) fn provide(providers: &mut Providers) {
324
324
let valid_non_array_simd_struct = trivial_struct. is_some_and ( |adt_def| {
325
325
let ReprOptions {
326
326
int : None ,
327
- align : None ,
327
+ align : _ ,
328
328
pack : None ,
329
329
flags : ReprFlags :: IS_SIMD ,
330
330
field_shuffle_seed : _,
0 commit comments