@@ -15,6 +15,7 @@ use hir_def::{
1515use la_arena:: { Idx , RawIdx } ;
1616use rustc_abi:: AddressSpace ;
1717use rustc_index:: { IndexSlice , IndexVec } ;
18+ use rustc_hashes:: Hash64 ;
1819
1920use triomphe:: Arc ;
2021
@@ -178,7 +179,7 @@ fn layout_of_simd_ty(
178179 . size
179180 . checked_mul ( e_len, dl)
180181 . ok_or ( LayoutError :: BadCalc ( LayoutCalculatorError :: SizeOverflow ) ) ?;
181- let align = dl. vector_align ( size) ;
182+ let align = dl. llvmlike_vector_align ( size) ;
182183 let size = size. align_to ( align. abi ) ;
183184
184185 // Compute the placement of the vector fields:
@@ -193,11 +194,12 @@ fn layout_of_simd_ty(
193194 fields,
194195 backend_repr : BackendRepr :: Vector { element : e_abi, count : e_len } ,
195196 largest_niche : e_ly. largest_niche ,
197+ uninhabited : false ,
196198 size,
197199 align,
198200 max_repr_align : None ,
199201 unadjusted_abi_align : align. abi ,
200- randomization_seed : 0 ,
202+ randomization_seed : Hash64 :: ZERO ,
201203 } ) )
202204}
203205
@@ -296,25 +298,22 @@ pub fn layout_of_ty_query(
296298 . checked_mul ( count, dl)
297299 . ok_or ( LayoutError :: BadCalc ( LayoutCalculatorError :: SizeOverflow ) ) ?;
298300
299- let backend_repr =
300- if count != 0 && matches ! ( element. backend_repr, BackendRepr :: Uninhabited ) {
301- BackendRepr :: Uninhabited
302- } else {
303- BackendRepr :: Memory { sized : true }
304- } ;
301+ let backend_repr = BackendRepr :: Memory { sized : true } ;
305302
306303 let largest_niche = if count != 0 { element. largest_niche } else { None } ;
304+ let uninhabited = if count != 0 { element. uninhabited } else { false } ;
307305
308306 Layout {
309307 variants : Variants :: Single { index : struct_variant_idx ( ) } ,
310308 fields : FieldsShape :: Array { stride : element. size , count } ,
311309 backend_repr,
312310 largest_niche,
311+ uninhabited,
313312 align : element. align ,
314313 size,
315314 max_repr_align : None ,
316315 unadjusted_abi_align : element. align . abi ,
317- randomization_seed : 0 ,
316+ randomization_seed : Hash64 :: ZERO ,
318317 }
319318 }
320319 TyKind :: Slice ( element) => {
@@ -324,23 +323,25 @@ pub fn layout_of_ty_query(
324323 fields : FieldsShape :: Array { stride : element. size , count : 0 } ,
325324 backend_repr : BackendRepr :: Memory { sized : false } ,
326325 largest_niche : None ,
326+ uninhabited : false ,
327327 align : element. align ,
328328 size : Size :: ZERO ,
329329 max_repr_align : None ,
330330 unadjusted_abi_align : element. align . abi ,
331- randomization_seed : 0 ,
331+ randomization_seed : Hash64 :: ZERO ,
332332 }
333333 }
334334 TyKind :: Str => Layout {
335335 variants : Variants :: Single { index : struct_variant_idx ( ) } ,
336336 fields : FieldsShape :: Array { stride : Size :: from_bytes ( 1 ) , count : 0 } ,
337337 backend_repr : BackendRepr :: Memory { sized : false } ,
338338 largest_niche : None ,
339+ uninhabited : false ,
339340 align : dl. i8_align ,
340341 size : Size :: ZERO ,
341342 max_repr_align : None ,
342343 unadjusted_abi_align : dl. i8_align . abi ,
343- randomization_seed : 0 ,
344+ randomization_seed : Hash64 :: ZERO ,
344345 } ,
345346 // Potentially-wide pointers.
346347 TyKind :: Ref ( _, _, pointee) | TyKind :: Raw ( _, pointee) => {
0 commit comments