@@ -49,7 +49,7 @@ use rustc_data_structures::stable_hasher::StableOrd;
4949use rustc_hashes:: Hash64 ;
5050use rustc_index:: { Idx , IndexSlice , IndexVec } ;
5151#[ cfg( feature = "nightly" ) ]
52- use rustc_macros:: { Decodable_NoContext , Encodable_NoContext , HashStable_Generic } ;
52+ use rustc_macros:: { Decodable_NoContext , Encodable_NoContext , HashStable } ;
5353
5454mod callconv;
5555mod canon_abi;
@@ -68,10 +68,7 @@ pub use layout::{FIRST_VARIANT, FieldIdx, LayoutCalculator, LayoutCalculatorErro
6868pub use layout:: { Layout , TyAbiInterface , TyAndLayout } ;
6969
7070#[ derive( Clone , Copy , PartialEq , Eq , Default ) ]
71- #[ cfg_attr(
72- feature = "nightly" ,
73- derive( Encodable_NoContext , Decodable_NoContext , HashStable_Generic )
74- ) ]
71+ #[ cfg_attr( feature = "nightly" , derive( Encodable_NoContext , Decodable_NoContext , HashStable ) ) ]
7572pub struct ReprFlags ( u8 ) ;
7673
7774bitflags ! {
@@ -108,10 +105,7 @@ impl std::fmt::Debug for ReprFlags {
108105}
109106
110107#[ derive( Copy , Clone , Debug , Eq , PartialEq ) ]
111- #[ cfg_attr(
112- feature = "nightly" ,
113- derive( Encodable_NoContext , Decodable_NoContext , HashStable_Generic )
114- ) ]
108+ #[ cfg_attr( feature = "nightly" , derive( Encodable_NoContext , Decodable_NoContext , HashStable ) ) ]
115109pub enum IntegerType {
116110 /// Pointer-sized integer type, i.e. `isize` and `usize`. The field shows signedness, e.g.
117111 /// `Pointer(true)` means `isize`.
@@ -131,10 +125,7 @@ impl IntegerType {
131125}
132126
133127#[ derive( Copy , Clone , Debug , Eq , PartialEq ) ]
134- #[ cfg_attr(
135- feature = "nightly" ,
136- derive( Encodable_NoContext , Decodable_NoContext , HashStable_Generic )
137- ) ]
128+ #[ cfg_attr( feature = "nightly" , derive( Encodable_NoContext , Decodable_NoContext , HashStable ) ) ]
138129pub enum ScalableElt {
139130 /// `N` in `rustc_scalable_vector(N)` - the element count of the scalable vector
140131 ElementCount ( u16 ) ,
@@ -145,10 +136,7 @@ pub enum ScalableElt {
145136
146137/// Represents the repr options provided by the user.
147138#[ derive( Copy , Clone , Debug , Eq , PartialEq , Default ) ]
148- #[ cfg_attr(
149- feature = "nightly" ,
150- derive( Encodable_NoContext , Decodable_NoContext , HashStable_Generic )
151- ) ]
139+ #[ cfg_attr( feature = "nightly" , derive( Encodable_NoContext , Decodable_NoContext , HashStable ) ) ]
152140pub struct ReprOptions {
153141 pub int : Option < IntegerType > ,
154142 pub align : Option < Align > ,
@@ -745,10 +733,7 @@ impl FromStr for Endian {
745733
746734/// Size of a type in bytes.
747735#[ derive( Copy , Clone , PartialEq , Eq , PartialOrd , Ord , Hash ) ]
748- #[ cfg_attr(
749- feature = "nightly" ,
750- derive( Encodable_NoContext , Decodable_NoContext , HashStable_Generic )
751- ) ]
736+ #[ cfg_attr( feature = "nightly" , derive( Encodable_NoContext , Decodable_NoContext , HashStable ) ) ]
752737pub struct Size {
753738 raw : u64 ,
754739}
@@ -973,10 +958,7 @@ impl Step for Size {
973958
974959/// Alignment of a type in bytes (always a power of two).
975960#[ derive( Copy , Clone , PartialEq , Eq , PartialOrd , Ord , Hash ) ]
976- #[ cfg_attr(
977- feature = "nightly" ,
978- derive( Encodable_NoContext , Decodable_NoContext , HashStable_Generic )
979- ) ]
961+ #[ cfg_attr( feature = "nightly" , derive( Encodable_NoContext , Decodable_NoContext , HashStable ) ) ]
980962pub struct Align {
981963 pow2 : u8 ,
982964}
@@ -1109,7 +1091,7 @@ impl Align {
11091091/// An example of a rare thing actually affected by preferred alignment is aligning of statics.
11101092/// It is of effectively no consequence for layout in structs and on the stack.
11111093#[ derive( Copy , Clone , PartialEq , Eq , Hash , Debug ) ]
1112- #[ cfg_attr( feature = "nightly" , derive( HashStable_Generic ) ) ]
1094+ #[ cfg_attr( feature = "nightly" , derive( HashStable ) ) ]
11131095pub struct AbiAlign {
11141096 pub abi : Align ,
11151097}
@@ -1141,10 +1123,7 @@ impl Deref for AbiAlign {
11411123
11421124/// Integers, also used for enum discriminants.
11431125#[ derive( Copy , Clone , PartialEq , Eq , PartialOrd , Ord , Hash , Debug ) ]
1144- #[ cfg_attr(
1145- feature = "nightly" ,
1146- derive( Encodable_NoContext , Decodable_NoContext , HashStable_Generic )
1147- ) ]
1126+ #[ cfg_attr( feature = "nightly" , derive( Encodable_NoContext , Decodable_NoContext , HashStable ) ) ]
11481127pub enum Integer {
11491128 I8 ,
11501129 I16 ,
@@ -1304,7 +1283,7 @@ impl Integer {
13041283
13051284/// Floating-point types.
13061285#[ derive( Copy , Clone , PartialEq , Eq , PartialOrd , Ord , Hash , Debug ) ]
1307- #[ cfg_attr( feature = "nightly" , derive( HashStable_Generic ) ) ]
1286+ #[ cfg_attr( feature = "nightly" , derive( HashStable ) ) ]
13081287pub enum Float {
13091288 F16 ,
13101289 F32 ,
@@ -1339,7 +1318,7 @@ impl Float {
13391318
13401319/// Fundamental unit of memory access and layout.
13411320#[ derive( Copy , Clone , PartialEq , Eq , Hash , Debug ) ]
1342- #[ cfg_attr( feature = "nightly" , derive( HashStable_Generic ) ) ]
1321+ #[ cfg_attr( feature = "nightly" , derive( HashStable ) ) ]
13431322pub enum Primitive {
13441323 /// The `bool` is the signedness of the `Integer` type.
13451324 ///
@@ -1387,7 +1366,7 @@ impl Primitive {
13871366///
13881367/// This is intended specifically to mirror LLVM’s `!range` metadata semantics.
13891368#[ derive( Clone , Copy , PartialEq , Eq , Hash ) ]
1390- #[ cfg_attr( feature = "nightly" , derive( HashStable_Generic ) ) ]
1369+ #[ cfg_attr( feature = "nightly" , derive( HashStable ) ) ]
13911370pub struct WrappingRange {
13921371 pub start : u128 ,
13931372 pub end : u128 ,
@@ -1499,7 +1478,7 @@ impl fmt::Debug for WrappingRange {
14991478
15001479/// Information about one scalar component of a Rust type.
15011480#[ derive( Clone , Copy , PartialEq , Eq , Hash , Debug ) ]
1502- #[ cfg_attr( feature = "nightly" , derive( HashStable_Generic ) ) ]
1481+ #[ cfg_attr( feature = "nightly" , derive( HashStable ) ) ]
15031482pub enum Scalar {
15041483 Initialized {
15051484 value : Primitive ,
@@ -1603,7 +1582,7 @@ impl Scalar {
16031582// NOTE: This struct is generic over the FieldIdx for rust-analyzer usage.
16041583/// Describes how the fields of a type are located in memory.
16051584#[ derive( PartialEq , Eq , Hash , Clone , Debug ) ]
1606- #[ cfg_attr( feature = "nightly" , derive( HashStable_Generic ) ) ]
1585+ #[ cfg_attr( feature = "nightly" , derive( HashStable ) ) ]
16071586pub enum FieldsShape < FieldIdx : Idx > {
16081587 /// Scalar primitives and `!`, which never have fields.
16091588 Primitive ,
@@ -1688,7 +1667,7 @@ impl<FieldIdx: Idx> FieldsShape<FieldIdx> {
16881667/// should operate on. Special address spaces have an effect on code generation,
16891668/// depending on the target and the address spaces it implements.
16901669#[ derive( Copy , Clone , Debug , PartialEq , Eq , PartialOrd , Ord , Hash ) ]
1691- #[ cfg_attr( feature = "nightly" , derive( HashStable_Generic ) ) ]
1670+ #[ cfg_attr( feature = "nightly" , derive( HashStable ) ) ]
16921671pub struct AddressSpace ( pub u32 ) ;
16931672
16941673impl AddressSpace {
@@ -1698,7 +1677,7 @@ impl AddressSpace {
16981677
16991678/// How many scalable vectors are in a `BackendRepr::ScalableVector`?
17001679#[ derive( Clone , Copy , PartialEq , Eq , Hash , Debug ) ]
1701- #[ cfg_attr( feature = "nightly" , derive( HashStable_Generic ) ) ]
1680+ #[ cfg_attr( feature = "nightly" , derive( HashStable ) ) ]
17021681pub struct NumScalableVectors ( pub u8 ) ;
17031682
17041683impl NumScalableVectors {
@@ -1729,7 +1708,7 @@ impl NumScalableVectors {
17291708/// Generally, a codegen backend will prefer to handle smaller values as a scalar or short vector,
17301709/// and larger values will usually prefer to be represented as memory.
17311710#[ derive( Clone , Copy , PartialEq , Eq , Hash , Debug ) ]
1732- #[ cfg_attr( feature = "nightly" , derive( HashStable_Generic ) ) ]
1711+ #[ cfg_attr( feature = "nightly" , derive( HashStable ) ) ]
17331712pub enum BackendRepr {
17341713 Scalar ( Scalar ) ,
17351714 ScalarPair ( Scalar , Scalar ) ,
@@ -1873,7 +1852,7 @@ impl BackendRepr {
18731852
18741853// NOTE: This struct is generic over the FieldIdx and VariantIdx for rust-analyzer usage.
18751854#[ derive( PartialEq , Eq , Hash , Clone , Debug ) ]
1876- #[ cfg_attr( feature = "nightly" , derive( HashStable_Generic ) ) ]
1855+ #[ cfg_attr( feature = "nightly" , derive( HashStable ) ) ]
18771856pub enum Variants < FieldIdx : Idx , VariantIdx : Idx > {
18781857 /// A type with no valid variants. Must be uninhabited.
18791858 Empty ,
@@ -1900,7 +1879,7 @@ pub enum Variants<FieldIdx: Idx, VariantIdx: Idx> {
19001879
19011880// NOTE: This struct is generic over the VariantIdx for rust-analyzer usage.
19021881#[ derive( PartialEq , Eq , Hash , Clone , Debug ) ]
1903- #[ cfg_attr( feature = "nightly" , derive( HashStable_Generic ) ) ]
1882+ #[ cfg_attr( feature = "nightly" , derive( HashStable ) ) ]
19041883pub enum TagEncoding < VariantIdx : Idx > {
19051884 /// The tag directly stores the discriminant, but possibly with a smaller layout
19061885 /// (so converting the tag to the discriminant can require sign extension).
@@ -1941,7 +1920,7 @@ pub enum TagEncoding<VariantIdx: Idx> {
19411920}
19421921
19431922#[ derive( Clone , Copy , PartialEq , Eq , Hash , Debug ) ]
1944- #[ cfg_attr( feature = "nightly" , derive( HashStable_Generic ) ) ]
1923+ #[ cfg_attr( feature = "nightly" , derive( HashStable ) ) ]
19451924pub struct Niche {
19461925 pub offset : Size ,
19471926 pub value : Primitive ,
@@ -2028,7 +2007,7 @@ impl Niche {
20282007
20292008// NOTE: This struct is generic over the FieldIdx and VariantIdx for rust-analyzer usage.
20302009#[ derive( PartialEq , Eq , Hash , Clone ) ]
2031- #[ cfg_attr( feature = "nightly" , derive( HashStable_Generic ) ) ]
2010+ #[ cfg_attr( feature = "nightly" , derive( HashStable ) ) ]
20322011pub struct LayoutData < FieldIdx : Idx , VariantIdx : Idx > {
20332012 /// Says where the fields are located within the layout.
20342013 pub fields : FieldsShape < FieldIdx > ,
0 commit comments