@@ -8,8 +8,8 @@ use itertools::Itertools;
8
8
use rspirv:: spirv:: { Dim , ImageFormat , StorageClass , Word } ;
9
9
use rustc_abi:: ExternAbi as Abi ;
10
10
use 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 ,
13
13
} ;
14
14
use rustc_data_structures:: fx:: FxHashMap ;
15
15
use rustc_errors:: ErrorGuaranteed ;
@@ -205,10 +205,9 @@ pub(crate) fn provide(providers: &mut Providers) {
205
205
tcx,
206
206
key. typing_env . with_post_analysis_normalized ( tcx) ,
207
207
) ;
208
- let dl = cx. data_layout ( ) ;
209
208
210
209
// 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) ?;
212
211
let BackendRepr :: Scalar ( e_repr) = e_ly. backend_repr else {
213
212
// This error isn't caught in typeck, e.g., if
214
213
// the element type of the vector is generic.
@@ -223,8 +222,8 @@ pub(crate) fn provide(providers: &mut Providers) {
223
222
} ;
224
223
225
224
// 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 ;
228
227
let size = size. align_to ( align. abi ) ;
229
228
230
229
let layout = tcx. mk_layout ( LayoutData {
0 commit comments