@@ -53,7 +53,7 @@ use rustc_errors::{Diag, DiagCtxtHandle, Diagnostic, EmissionGuarantee, Level, m
5353use rustc_hashes:: Hash64 ;
5454use rustc_index:: { Idx , IndexSlice , IndexVec } ;
5555#[ cfg( feature = "nightly" ) ]
56- use rustc_macros:: { Decodable_NoContext , Encodable_NoContext , HashStable_Generic } ;
56+ use rustc_macros:: { Decodable_NoContext , Encodable_NoContext , HashStable } ;
5757#[ cfg( feature = "nightly" ) ]
5858use rustc_span:: { Symbol , sym} ;
5959
@@ -74,10 +74,7 @@ pub use layout::{FIRST_VARIANT, FieldIdx, LayoutCalculator, LayoutCalculatorErro
7474pub use layout:: { Layout , TyAbiInterface , TyAndLayout } ;
7575
7676#[ derive( Clone , Copy , PartialEq , Eq , Default ) ]
77- #[ cfg_attr(
78- feature = "nightly" ,
79- derive( Encodable_NoContext , Decodable_NoContext , HashStable_Generic )
80- ) ]
77+ #[ cfg_attr( feature = "nightly" , derive( Encodable_NoContext , Decodable_NoContext , HashStable ) ) ]
8178pub struct ReprFlags ( u8 ) ;
8279
8380bitflags ! {
@@ -114,10 +111,7 @@ impl std::fmt::Debug for ReprFlags {
114111}
115112
116113#[ derive( Copy , Clone , Debug , Eq , PartialEq ) ]
117- #[ cfg_attr(
118- feature = "nightly" ,
119- derive( Encodable_NoContext , Decodable_NoContext , HashStable_Generic )
120- ) ]
114+ #[ cfg_attr( feature = "nightly" , derive( Encodable_NoContext , Decodable_NoContext , HashStable ) ) ]
121115pub enum IntegerType {
122116 /// Pointer-sized integer type, i.e. `isize` and `usize`. The field shows signedness, e.g.
123117 /// `Pointer(true)` means `isize`.
@@ -137,10 +131,7 @@ impl IntegerType {
137131}
138132
139133#[ derive( Copy , Clone , Debug , Eq , PartialEq ) ]
140- #[ cfg_attr(
141- feature = "nightly" ,
142- derive( Encodable_NoContext , Decodable_NoContext , HashStable_Generic )
143- ) ]
134+ #[ cfg_attr( feature = "nightly" , derive( Encodable_NoContext , Decodable_NoContext , HashStable ) ) ]
144135pub enum ScalableElt {
145136 /// `N` in `rustc_scalable_vector(N)` - the element count of the scalable vector
146137 ElementCount ( u16 ) ,
@@ -151,10 +142,7 @@ pub enum ScalableElt {
151142
152143/// Represents the repr options provided by the user.
153144#[ derive( Copy , Clone , Debug , Eq , PartialEq , Default ) ]
154- #[ cfg_attr(
155- feature = "nightly" ,
156- derive( Encodable_NoContext , Decodable_NoContext , HashStable_Generic )
157- ) ]
145+ #[ cfg_attr( feature = "nightly" , derive( Encodable_NoContext , Decodable_NoContext , HashStable ) ) ]
158146pub struct ReprOptions {
159147 pub int : Option < IntegerType > ,
160148 pub align : Option < Align > ,
@@ -804,10 +792,7 @@ impl FromStr for Endian {
804792
805793/// Size of a type in bytes.
806794#[ derive( Copy , Clone , PartialEq , Eq , PartialOrd , Ord , Hash ) ]
807- #[ cfg_attr(
808- feature = "nightly" ,
809- derive( Encodable_NoContext , Decodable_NoContext , HashStable_Generic )
810- ) ]
795+ #[ cfg_attr( feature = "nightly" , derive( Encodable_NoContext , Decodable_NoContext , HashStable ) ) ]
811796pub struct Size {
812797 raw : u64 ,
813798}
@@ -1032,10 +1017,7 @@ impl Step for Size {
10321017
10331018/// Alignment of a type in bytes (always a power of two).
10341019#[ derive( Copy , Clone , PartialEq , Eq , PartialOrd , Ord , Hash ) ]
1035- #[ cfg_attr(
1036- feature = "nightly" ,
1037- derive( Encodable_NoContext , Decodable_NoContext , HashStable_Generic )
1038- ) ]
1020+ #[ cfg_attr( feature = "nightly" , derive( Encodable_NoContext , Decodable_NoContext , HashStable ) ) ]
10391021pub struct Align {
10401022 pow2 : u8 ,
10411023}
@@ -1168,7 +1150,7 @@ impl Align {
11681150/// An example of a rare thing actually affected by preferred alignment is aligning of statics.
11691151/// It is of effectively no consequence for layout in structs and on the stack.
11701152#[ derive( Copy , Clone , PartialEq , Eq , Hash , Debug ) ]
1171- #[ cfg_attr( feature = "nightly" , derive( HashStable_Generic ) ) ]
1153+ #[ cfg_attr( feature = "nightly" , derive( HashStable ) ) ]
11721154pub struct AbiAlign {
11731155 pub abi : Align ,
11741156}
@@ -1200,10 +1182,7 @@ impl Deref for AbiAlign {
12001182
12011183/// Integers, also used for enum discriminants.
12021184#[ derive( Copy , Clone , PartialEq , Eq , PartialOrd , Ord , Hash , Debug ) ]
1203- #[ cfg_attr(
1204- feature = "nightly" ,
1205- derive( Encodable_NoContext , Decodable_NoContext , HashStable_Generic )
1206- ) ]
1185+ #[ cfg_attr( feature = "nightly" , derive( Encodable_NoContext , Decodable_NoContext , HashStable ) ) ]
12071186pub enum Integer {
12081187 I8 ,
12091188 I16 ,
@@ -1363,7 +1342,7 @@ impl Integer {
13631342
13641343/// Floating-point types.
13651344#[ derive( Copy , Clone , PartialEq , Eq , PartialOrd , Ord , Hash , Debug ) ]
1366- #[ cfg_attr( feature = "nightly" , derive( HashStable_Generic ) ) ]
1345+ #[ cfg_attr( feature = "nightly" , derive( HashStable ) ) ]
13671346pub enum Float {
13681347 F16 ,
13691348 F32 ,
@@ -1398,7 +1377,7 @@ impl Float {
13981377
13991378/// Fundamental unit of memory access and layout.
14001379#[ derive( Copy , Clone , PartialEq , Eq , Hash , Debug ) ]
1401- #[ cfg_attr( feature = "nightly" , derive( HashStable_Generic ) ) ]
1380+ #[ cfg_attr( feature = "nightly" , derive( HashStable ) ) ]
14021381pub enum Primitive {
14031382 /// The `bool` is the signedness of the `Integer` type.
14041383 ///
@@ -1446,7 +1425,7 @@ impl Primitive {
14461425///
14471426/// This is intended specifically to mirror LLVM’s `!range` metadata semantics.
14481427#[ derive( Clone , Copy , PartialEq , Eq , Hash ) ]
1449- #[ cfg_attr( feature = "nightly" , derive( HashStable_Generic ) ) ]
1428+ #[ cfg_attr( feature = "nightly" , derive( HashStable ) ) ]
14501429pub struct WrappingRange {
14511430 pub start : u128 ,
14521431 pub end : u128 ,
@@ -1558,7 +1537,7 @@ impl fmt::Debug for WrappingRange {
15581537
15591538/// Information about one scalar component of a Rust type.
15601539#[ derive( Clone , Copy , PartialEq , Eq , Hash , Debug ) ]
1561- #[ cfg_attr( feature = "nightly" , derive( HashStable_Generic ) ) ]
1540+ #[ cfg_attr( feature = "nightly" , derive( HashStable ) ) ]
15621541pub enum Scalar {
15631542 Initialized {
15641543 value : Primitive ,
@@ -1662,7 +1641,7 @@ impl Scalar {
16621641// NOTE: This struct is generic over the FieldIdx for rust-analyzer usage.
16631642/// Describes how the fields of a type are located in memory.
16641643#[ derive( PartialEq , Eq , Hash , Clone , Debug ) ]
1665- #[ cfg_attr( feature = "nightly" , derive( HashStable_Generic ) ) ]
1644+ #[ cfg_attr( feature = "nightly" , derive( HashStable ) ) ]
16661645pub enum FieldsShape < FieldIdx : Idx > {
16671646 /// Scalar primitives and `!`, which never have fields.
16681647 Primitive ,
@@ -1747,7 +1726,7 @@ impl<FieldIdx: Idx> FieldsShape<FieldIdx> {
17471726/// should operate on. Special address spaces have an effect on code generation,
17481727/// depending on the target and the address spaces it implements.
17491728#[ derive( Copy , Clone , Debug , PartialEq , Eq , PartialOrd , Ord , Hash ) ]
1750- #[ cfg_attr( feature = "nightly" , derive( HashStable_Generic ) ) ]
1729+ #[ cfg_attr( feature = "nightly" , derive( HashStable ) ) ]
17511730pub struct AddressSpace ( pub u32 ) ;
17521731
17531732impl AddressSpace {
@@ -1760,7 +1739,7 @@ impl AddressSpace {
17601739
17611740/// How many scalable vectors are in a `BackendRepr::ScalableVector`?
17621741#[ derive( Clone , Copy , PartialEq , Eq , Hash , Debug ) ]
1763- #[ cfg_attr( feature = "nightly" , derive( HashStable_Generic ) ) ]
1742+ #[ cfg_attr( feature = "nightly" , derive( HashStable ) ) ]
17641743pub struct NumScalableVectors ( pub u8 ) ;
17651744
17661745impl NumScalableVectors {
@@ -1809,7 +1788,7 @@ impl IntoDiagArg for NumScalableVectors {
18091788/// Generally, a codegen backend will prefer to handle smaller values as a scalar or short vector,
18101789/// and larger values will usually prefer to be represented as memory.
18111790#[ derive( Clone , Copy , PartialEq , Eq , Hash , Debug ) ]
1812- #[ cfg_attr( feature = "nightly" , derive( HashStable_Generic ) ) ]
1791+ #[ cfg_attr( feature = "nightly" , derive( HashStable ) ) ]
18131792pub enum BackendRepr {
18141793 Scalar ( Scalar ) ,
18151794 ScalarPair ( Scalar , Scalar ) ,
@@ -1953,7 +1932,7 @@ impl BackendRepr {
19531932
19541933// NOTE: This struct is generic over the FieldIdx and VariantIdx for rust-analyzer usage.
19551934#[ derive( PartialEq , Eq , Hash , Clone , Debug ) ]
1956- #[ cfg_attr( feature = "nightly" , derive( HashStable_Generic ) ) ]
1935+ #[ cfg_attr( feature = "nightly" , derive( HashStable ) ) ]
19571936pub enum Variants < FieldIdx : Idx , VariantIdx : Idx > {
19581937 /// A type with no valid variants. Must be uninhabited.
19591938 Empty ,
@@ -1980,7 +1959,7 @@ pub enum Variants<FieldIdx: Idx, VariantIdx: Idx> {
19801959
19811960// NOTE: This struct is generic over the VariantIdx for rust-analyzer usage.
19821961#[ derive( PartialEq , Eq , Hash , Clone , Debug ) ]
1983- #[ cfg_attr( feature = "nightly" , derive( HashStable_Generic ) ) ]
1962+ #[ cfg_attr( feature = "nightly" , derive( HashStable ) ) ]
19841963pub enum TagEncoding < VariantIdx : Idx > {
19851964 /// The tag directly stores the discriminant, but possibly with a smaller layout
19861965 /// (so converting the tag to the discriminant can require sign extension).
@@ -2021,7 +2000,7 @@ pub enum TagEncoding<VariantIdx: Idx> {
20212000}
20222001
20232002#[ derive( Clone , Copy , PartialEq , Eq , Hash , Debug ) ]
2024- #[ cfg_attr( feature = "nightly" , derive( HashStable_Generic ) ) ]
2003+ #[ cfg_attr( feature = "nightly" , derive( HashStable ) ) ]
20252004pub struct Niche {
20262005 pub offset : Size ,
20272006 pub value : Primitive ,
@@ -2118,7 +2097,7 @@ impl Niche {
21182097
21192098// NOTE: This struct is generic over the FieldIdx and VariantIdx for rust-analyzer usage.
21202099#[ derive( PartialEq , Eq , Hash , Clone ) ]
2121- #[ cfg_attr( feature = "nightly" , derive( HashStable_Generic ) ) ]
2100+ #[ cfg_attr( feature = "nightly" , derive( HashStable ) ) ]
21222101pub struct LayoutData < FieldIdx : Idx , VariantIdx : Idx > {
21232102 /// Says where the fields are located within the layout.
21242103 pub fields : FieldsShape < FieldIdx > ,
0 commit comments