@@ -6,8 +6,9 @@ use base_db::ra_salsa::Cycle;
66use chalk_ir:: { AdtId , FloatTy , IntTy , TyKind , UintTy } ;
77use hir_def:: {
88 layout:: {
9- Abi , FieldsShape , Float , Integer , LayoutCalculator , LayoutCalculatorError , LayoutData ,
10- Primitive , ReprOptions , Scalar , Size , StructKind , TargetDataLayout , WrappingRange ,
9+ BackendRepr , FieldsShape , Float , Integer , LayoutCalculator , LayoutCalculatorError ,
10+ LayoutData , Primitive , ReprOptions , Scalar , Size , StructKind , TargetDataLayout ,
11+ WrappingRange ,
1112 } ,
1213 LocalFieldId , StructId ,
1314} ;
@@ -168,7 +169,7 @@ fn layout_of_simd_ty(
168169
169170 // Compute the ABI of the element type:
170171 let e_ly = db. layout_of_ty ( e_ty, env) ?;
171- let Abi :: Scalar ( e_abi) = e_ly. abi else {
172+ let BackendRepr :: Scalar ( e_abi) = e_ly. backend_repr else {
172173 return Err ( LayoutError :: Unknown ) ;
173174 } ;
174175
@@ -190,7 +191,7 @@ fn layout_of_simd_ty(
190191 Ok ( Arc :: new ( Layout {
191192 variants : Variants :: Single { index : struct_variant_idx ( ) } ,
192193 fields,
193- abi : Abi :: Vector { element : e_abi, count : e_len } ,
194+ backend_repr : BackendRepr :: Vector { element : e_abi, count : e_len } ,
194195 largest_niche : e_ly. largest_niche ,
195196 size,
196197 align,
@@ -294,18 +295,19 @@ pub fn layout_of_ty_query(
294295 . checked_mul ( count, dl)
295296 . ok_or ( LayoutError :: BadCalc ( LayoutCalculatorError :: SizeOverflow ) ) ?;
296297
297- let abi = if count != 0 && matches ! ( element. abi, Abi :: Uninhabited ) {
298- Abi :: Uninhabited
299- } else {
300- Abi :: Aggregate { sized : true }
301- } ;
298+ let backend_repr =
299+ if count != 0 && matches ! ( element. backend_repr, BackendRepr :: Uninhabited ) {
300+ BackendRepr :: Uninhabited
301+ } else {
302+ BackendRepr :: Memory { sized : true }
303+ } ;
302304
303305 let largest_niche = if count != 0 { element. largest_niche } else { None } ;
304306
305307 Layout {
306308 variants : Variants :: Single { index : struct_variant_idx ( ) } ,
307309 fields : FieldsShape :: Array { stride : element. size , count } ,
308- abi ,
310+ backend_repr ,
309311 largest_niche,
310312 align : element. align ,
311313 size,
@@ -318,7 +320,7 @@ pub fn layout_of_ty_query(
318320 Layout {
319321 variants : Variants :: Single { index : struct_variant_idx ( ) } ,
320322 fields : FieldsShape :: Array { stride : element. size , count : 0 } ,
321- abi : Abi :: Aggregate { sized : false } ,
323+ backend_repr : BackendRepr :: Memory { sized : false } ,
322324 largest_niche : None ,
323325 align : element. align ,
324326 size : Size :: ZERO ,
@@ -329,7 +331,7 @@ pub fn layout_of_ty_query(
329331 TyKind :: Str => Layout {
330332 variants : Variants :: Single { index : struct_variant_idx ( ) } ,
331333 fields : FieldsShape :: Array { stride : Size :: from_bytes ( 1 ) , count : 0 } ,
332- abi : Abi :: Aggregate { sized : false } ,
334+ backend_repr : BackendRepr :: Memory { sized : false } ,
333335 largest_niche : None ,
334336 align : dl. i8_align ,
335337 size : Size :: ZERO ,
@@ -379,8 +381,8 @@ pub fn layout_of_ty_query(
379381 TyKind :: Never => cx. calc . layout_of_never_type ( ) ,
380382 TyKind :: Dyn ( _) | TyKind :: Foreign ( _) => {
381383 let mut unit = layout_of_unit ( & cx) ?;
382- match & mut unit. abi {
383- Abi :: Aggregate { sized } => * sized = false ,
384+ match & mut unit. backend_repr {
385+ BackendRepr :: Memory { sized } => * sized = false ,
384386 _ => return Err ( LayoutError :: Unknown ) ,
385387 }
386388 unit
0 commit comments