File tree 2 files changed +7
-7
lines changed
compiler/rustc_middle/src/ty
2 files changed +7
-7
lines changed Original file line number Diff line number Diff line change @@ -347,10 +347,6 @@ impl<'tcx> LayoutCx<'tcx, TyCtxt<'tcx>> {
347
347
348
348
let mut inverse_memory_index: Vec < u32 > = ( 0 ..fields. len ( ) as u32 ) . collect ( ) ;
349
349
350
- // `ReprOptions.layout_seed` is a deterministic seed that we can use to
351
- // randomize field ordering with
352
- let mut rng = Xoshiro128StarStar :: seed_from_u64 ( repr. field_shuffle_seed ) ;
353
-
354
350
let optimize = !repr. inhibit_struct_field_reordering_opt ( ) ;
355
351
if optimize {
356
352
let end =
@@ -364,6 +360,10 @@ impl<'tcx> LayoutCx<'tcx, TyCtxt<'tcx>> {
364
360
// the field ordering to try and catch some code making assumptions about layouts
365
361
// we don't guarantee
366
362
if repr. can_randomize_type_layout ( ) {
363
+ // `ReprOptions.layout_seed` is a deterministic seed that we can use to
364
+ // randomize field ordering with
365
+ let mut rng = Xoshiro128StarStar :: seed_from_u64 ( repr. field_shuffle_seed ) ;
366
+
367
367
// Shuffle the ordering of the fields
368
368
optimizing. shuffle ( & mut rng) ;
369
369
Original file line number Diff line number Diff line change @@ -1608,9 +1608,9 @@ bitflags! {
1608
1608
// the seed stored in `ReprOptions.layout_seed`
1609
1609
const RANDOMIZE_LAYOUT = 1 << 5 ;
1610
1610
// Any of these flags being set prevent field reordering optimisation.
1611
- const IS_UNOPTIMISABLE = ReprFlags :: IS_C . bits |
1612
- ReprFlags :: IS_SIMD . bits |
1613
- ReprFlags :: IS_LINEAR . bits;
1611
+ const IS_UNOPTIMISABLE = ReprFlags :: IS_C . bits
1612
+ | ReprFlags :: IS_SIMD . bits
1613
+ | ReprFlags :: IS_LINEAR . bits;
1614
1614
}
1615
1615
}
1616
1616
You can’t perform that action at this time.
0 commit comments