@@ -6,7 +6,7 @@ use crate::codegen_cx::CodegenCx;
66use crate :: spirv_type:: SpirvType ;
77use itertools:: Itertools ;
88use rspirv:: spirv:: { Dim , ImageFormat , StorageClass , Word } ;
9- use rustc_abi:: ExternAbi as Abi ;
9+ use rustc_abi:: { AbiAlign , ExternAbi as Abi } ;
1010use rustc_abi:: {
1111 Align , BackendRepr , FieldIdx , FieldsShape , LayoutData , Primitive , ReprFlags , ReprOptions ,
1212 Scalar , Size , TagEncoding , VariantIdx , Variants ,
@@ -223,8 +223,8 @@ pub(crate) fn provide(providers: &mut Providers) {
223223
224224 // Compute the size and alignment of the vector:
225225 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) ;
228228
229229 let layout = tcx. mk_layout ( LayoutData {
230230 variants : Variants :: Single {
@@ -241,9 +241,9 @@ pub(crate) fn provide(providers: &mut Providers) {
241241 largest_niche : e_ly. largest_niche ,
242242 uninhabited : false ,
243243 size,
244- align,
244+ align : AbiAlign :: new ( align ) ,
245245 max_repr_align : None ,
246- unadjusted_abi_align : align. abi ,
246+ unadjusted_abi_align : align,
247247 randomization_seed : e_ly. randomization_seed . wrapping_add ( Hash64 :: new ( e_len) ) ,
248248 } ) ;
249249
@@ -324,7 +324,7 @@ pub(crate) fn provide(providers: &mut Providers) {
324324 let valid_non_array_simd_struct = trivial_struct. is_some_and ( |adt_def| {
325325 let ReprOptions {
326326 int : None ,
327- align : None ,
327+ align : _ ,
328328 pack : None ,
329329 flags : ReprFlags :: IS_SIMD ,
330330 field_shuffle_seed : _,
0 commit comments