File tree Expand file tree Collapse file tree 1 file changed +6
-10
lines changed Expand file tree Collapse file tree 1 file changed +6
-10
lines changed Original file line number Diff line number Diff line change @@ -871,16 +871,12 @@ fn univariant(
871
871
// the field ordering to try and catch some code making assumptions about layouts
872
872
// we don't guarantee.
873
873
if repr. can_randomize_type_layout ( ) && cfg ! ( feature = "randomize" ) {
874
- #[ cfg( feature = "randomize" ) ]
875
- {
876
- // `ReprOptions.layout_seed` is a deterministic seed we can use to randomize field
877
- // ordering.
878
- let mut rng = Xoshiro128StarStar :: seed_from_u64 ( repr. field_shuffle_seed . as_u64 ( ) ) ;
879
-
880
- // Shuffle the ordering of the fields.
881
- optimizing. shuffle ( & mut rng) ;
882
- }
883
- // Otherwise we just leave things alone and actually optimize the type's fields
874
+ // `ReprOptions.layout_seed` is a deterministic seed we can use to randomize field
875
+ // ordering.
876
+ let mut rng = Xoshiro128StarStar :: seed_from_u64 ( repr. field_shuffle_seed . as_u64 ( ) ) ;
877
+
878
+ // Shuffle the ordering of the fields.
879
+ optimizing. shuffle ( & mut rng) ;
884
880
} else {
885
881
// To allow unsizing `&Foo<Type>` -> `&Foo<dyn Trait>`, the layout of the struct must
886
882
// not depend on the layout of the tail.
You can’t perform that action at this time.
0 commit comments