Skip to content

Commit 11053d8

Browse files
committed
Remove redundant "randomize" feature gate.
It comes immediately after another gate.
1 parent 2369adc commit 11053d8

File tree

1 file changed

+6
-10
lines changed

1 file changed

+6
-10
lines changed

compiler/rustc_abi/src/layout.rs

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -871,16 +871,12 @@ fn univariant(
871871
// the field ordering to try and catch some code making assumptions about layouts
872872
// we don't guarantee.
873873
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);
884880
} else {
885881
// To allow unsizing `&Foo<Type>` -> `&Foo<dyn Trait>`, the layout of the struct must
886882
// not depend on the layout of the tail.

0 commit comments

Comments
 (0)