File tree Expand file tree Collapse file tree 4 files changed +6
-7
lines changed Expand file tree Collapse file tree 4 files changed +6
-7
lines changed Original file line number Diff line number Diff line change @@ -907,7 +907,7 @@ fn univariant<
907907 // `ReprOptions.layout_seed` is a deterministic seed we can use to randomize field
908908 // ordering.
909909 let mut rng = rand_xoshiro:: Xoshiro128StarStar :: seed_from_u64 (
910- repr. field_shuffle_seed . as_u64 ( ) ,
910+ repr. field_shuffle_seed ,
911911 ) ;
912912
913913 // Shuffle the ordering of the fields.
Original file line number Diff line number Diff line change @@ -76,15 +76,14 @@ pub struct ReprOptions {
7676 pub align : Option < Align > ,
7777 pub pack : Option < Align > ,
7878 pub flags : ReprFlags ,
79- #[ cfg( feature = "randomize" ) ]
8079 /// The seed to be used for randomizing a type's layout
8180 ///
82- /// Note: This could technically be a `Hash128 ` which would
81+ /// Note: This could technically be a `u128 ` which would
8382 /// be the "most accurate" hash as it'd encompass the item and crate
8483 /// hash without loss, but it does pay the price of being larger.
8584 /// Everything's a tradeoff, a 64-bit seed should be sufficient for our
8685 /// purposes (primarily `-Z randomize-layout`)
87- pub field_shuffle_seed : rustc_data_structures :: stable_hasher :: Hash64 ,
86+ pub field_shuffle_seed : u64 ,
8887}
8988
9089impl ReprOptions {
Original file line number Diff line number Diff line change @@ -2011,7 +2011,7 @@ impl<'tcx> TyCtxt<'tcx> {
20112011
20122012 // Generate a deterministically-derived seed from the item's path hash
20132013 // to allow for cross-crate compilation to actually work
2014- let mut field_shuffle_seed = self . def_path_hash ( did) . 0 . to_smaller_hash ( ) ;
2014+ let mut field_shuffle_seed = self . def_path_hash ( did) . 0 . to_smaller_hash ( ) . as_u64 ( ) ;
20152015
20162016 // If the user defined a custom seed for layout randomization, xor the item's
20172017 // path hash with the user defined seed, this will allowing determinism while
Original file line number Diff line number Diff line change @@ -7,7 +7,7 @@ use rustc_middle::mir::visit::*;
77use rustc_middle:: mir:: * ;
88use rustc_middle:: ty:: { self , Ty , TyCtxt } ;
99use rustc_mir_dataflow:: value_analysis:: { excluded_locals, iter_fields} ;
10- use rustc_target:: abi:: { FieldIdx , ReprFlags , FIRST_VARIANT } ;
10+ use rustc_target:: abi:: { FieldIdx , FIRST_VARIANT } ;
1111
1212pub struct ScalarReplacementOfAggregates ;
1313
@@ -66,7 +66,7 @@ fn escaping_locals<'tcx>(
6666 return true ;
6767 }
6868 if let ty:: Adt ( def, _args) = ty. kind ( ) {
69- if def. repr ( ) . flags . contains ( ReprFlags :: IS_SIMD ) {
69+ if def. repr ( ) . simd ( ) {
7070 // Exclude #[repr(simd)] types so that they are not de-optimized into an array
7171 return true ;
7272 }
You can’t perform that action at this time.
0 commit comments