@@ -8,8 +8,8 @@ use itertools::Itertools;
88use rspirv:: spirv:: { Dim , ImageFormat , StorageClass , Word } ;
99use rustc_abi:: ExternAbi as Abi ;
1010use rustc_abi:: {
11- Align , BackendRepr , FieldIdx , FieldsShape , HasDataLayout as _ , LayoutData , Primitive ,
12- ReprFlags , ReprOptions , Scalar , Size , TagEncoding , VariantIdx , Variants ,
11+ Align , BackendRepr , FieldIdx , FieldsShape , LayoutData , Primitive , ReprFlags , ReprOptions ,
12+ Scalar , Size , TagEncoding , VariantIdx , Variants ,
1313} ;
1414use rustc_data_structures:: fx:: FxHashMap ;
1515use rustc_errors:: ErrorGuaranteed ;
@@ -205,10 +205,9 @@ pub(crate) fn provide(providers: &mut Providers) {
205205 tcx,
206206 key. typing_env . with_post_analysis_normalized ( tcx) ,
207207 ) ;
208- let dl = cx. data_layout ( ) ;
209208
210209 // Compute the ABI of the element type:
211- let e_ly = cx. layout_of ( e_ty) ?;
210+ let e_ly: TyAndLayout < ' _ > = cx. layout_of ( e_ty) ?;
212211 let BackendRepr :: Scalar ( e_repr) = e_ly. backend_repr else {
213212 // This error isn't caught in typeck, e.g., if
214213 // the element type of the vector is generic.
@@ -223,8 +222,8 @@ pub(crate) fn provide(providers: &mut Providers) {
223222 } ;
224223
225224 // Compute the size and alignment of the vector:
226- let size = e_ly. size . checked_mul ( e_len, dl ) . unwrap ( ) ;
227- let align = dl . llvmlike_vector_align ( size ) ;
225+ let size = e_ly. size . checked_mul ( e_len, & cx ) . unwrap ( ) ;
226+ let align = e_ly . align ;
228227 let size = size. align_to ( align. abi ) ;
229228
230229 let layout = tcx. mk_layout ( LayoutData {
0 commit comments