@@ -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 } ;
56+ use rustc_macros:: { Decodable_NoContext , Encodable_NoContext , StableHash } ;
5757#[ cfg( feature = "nightly" ) ]
5858use rustc_span:: { Symbol , sym} ;
5959
@@ -74,7 +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( feature = "nightly" , derive( Encodable_NoContext , Decodable_NoContext , HashStable ) ) ]
77+ #[ cfg_attr( feature = "nightly" , derive( Encodable_NoContext , Decodable_NoContext , StableHash ) ) ]
7878pub struct ReprFlags ( u8 ) ;
7979
8080bitflags ! {
@@ -111,7 +111,7 @@ impl std::fmt::Debug for ReprFlags {
111111}
112112
113113#[ derive( Copy , Clone , Debug , Eq , PartialEq ) ]
114- #[ cfg_attr( feature = "nightly" , derive( Encodable_NoContext , Decodable_NoContext , HashStable ) ) ]
114+ #[ cfg_attr( feature = "nightly" , derive( Encodable_NoContext , Decodable_NoContext , StableHash ) ) ]
115115pub enum IntegerType {
116116 /// Pointer-sized integer type, i.e. `isize` and `usize`. The field shows signedness, e.g.
117117 /// `Pointer(true)` means `isize`.
@@ -131,7 +131,7 @@ impl IntegerType {
131131}
132132
133133#[ derive( Copy , Clone , Debug , Eq , PartialEq ) ]
134- #[ cfg_attr( feature = "nightly" , derive( Encodable_NoContext , Decodable_NoContext , HashStable ) ) ]
134+ #[ cfg_attr( feature = "nightly" , derive( Encodable_NoContext , Decodable_NoContext , StableHash ) ) ]
135135pub enum ScalableElt {
136136 /// `N` in `rustc_scalable_vector(N)` - the element count of the scalable vector
137137 ElementCount ( u16 ) ,
@@ -142,7 +142,7 @@ pub enum ScalableElt {
142142
143143/// Represents the repr options provided by the user.
144144#[ derive( Copy , Clone , Debug , Eq , PartialEq , Default ) ]
145- #[ cfg_attr( feature = "nightly" , derive( Encodable_NoContext , Decodable_NoContext , HashStable ) ) ]
145+ #[ cfg_attr( feature = "nightly" , derive( Encodable_NoContext , Decodable_NoContext , StableHash ) ) ]
146146pub struct ReprOptions {
147147 pub int : Option < IntegerType > ,
148148 pub align : Option < Align > ,
@@ -792,7 +792,7 @@ impl FromStr for Endian {
792792
793793/// Size of a type in bytes.
794794#[ derive( Copy , Clone , PartialEq , Eq , PartialOrd , Ord , Hash ) ]
795- #[ cfg_attr( feature = "nightly" , derive( Encodable_NoContext , Decodable_NoContext , HashStable ) ) ]
795+ #[ cfg_attr( feature = "nightly" , derive( Encodable_NoContext , Decodable_NoContext , StableHash ) ) ]
796796pub struct Size {
797797 raw : u64 ,
798798}
@@ -1017,7 +1017,7 @@ impl Step for Size {
10171017
10181018/// Alignment of a type in bytes (always a power of two).
10191019#[ derive( Copy , Clone , PartialEq , Eq , PartialOrd , Ord , Hash ) ]
1020- #[ cfg_attr( feature = "nightly" , derive( Encodable_NoContext , Decodable_NoContext , HashStable ) ) ]
1020+ #[ cfg_attr( feature = "nightly" , derive( Encodable_NoContext , Decodable_NoContext , StableHash ) ) ]
10211021pub struct Align {
10221022 pow2 : u8 ,
10231023}
@@ -1150,7 +1150,7 @@ impl Align {
11501150/// An example of a rare thing actually affected by preferred alignment is aligning of statics.
11511151/// It is of effectively no consequence for layout in structs and on the stack.
11521152#[ derive( Copy , Clone , PartialEq , Eq , Hash , Debug ) ]
1153- #[ cfg_attr( feature = "nightly" , derive( HashStable ) ) ]
1153+ #[ cfg_attr( feature = "nightly" , derive( StableHash ) ) ]
11541154pub struct AbiAlign {
11551155 pub abi : Align ,
11561156}
@@ -1182,7 +1182,7 @@ impl Deref for AbiAlign {
11821182
11831183/// Integers, also used for enum discriminants.
11841184#[ derive( Copy , Clone , PartialEq , Eq , PartialOrd , Ord , Hash , Debug ) ]
1185- #[ cfg_attr( feature = "nightly" , derive( Encodable_NoContext , Decodable_NoContext , HashStable ) ) ]
1185+ #[ cfg_attr( feature = "nightly" , derive( Encodable_NoContext , Decodable_NoContext , StableHash ) ) ]
11861186pub enum Integer {
11871187 I8 ,
11881188 I16 ,
@@ -1342,7 +1342,7 @@ impl Integer {
13421342
13431343/// Floating-point types.
13441344#[ derive( Copy , Clone , PartialEq , Eq , PartialOrd , Ord , Hash , Debug ) ]
1345- #[ cfg_attr( feature = "nightly" , derive( HashStable ) ) ]
1345+ #[ cfg_attr( feature = "nightly" , derive( StableHash ) ) ]
13461346pub enum Float {
13471347 F16 ,
13481348 F32 ,
@@ -1377,7 +1377,7 @@ impl Float {
13771377
13781378/// Fundamental unit of memory access and layout.
13791379#[ derive( Copy , Clone , PartialEq , Eq , Hash , Debug ) ]
1380- #[ cfg_attr( feature = "nightly" , derive( HashStable ) ) ]
1380+ #[ cfg_attr( feature = "nightly" , derive( StableHash ) ) ]
13811381pub enum Primitive {
13821382 /// The `bool` is the signedness of the `Integer` type.
13831383 ///
@@ -1425,7 +1425,7 @@ impl Primitive {
14251425///
14261426/// This is intended specifically to mirror LLVM’s `!range` metadata semantics.
14271427#[ derive( Clone , Copy , PartialEq , Eq , Hash ) ]
1428- #[ cfg_attr( feature = "nightly" , derive( HashStable ) ) ]
1428+ #[ cfg_attr( feature = "nightly" , derive( StableHash ) ) ]
14291429pub struct WrappingRange {
14301430 pub start : u128 ,
14311431 pub end : u128 ,
@@ -1537,7 +1537,7 @@ impl fmt::Debug for WrappingRange {
15371537
15381538/// Information about one scalar component of a Rust type.
15391539#[ derive( Clone , Copy , PartialEq , Eq , Hash , Debug ) ]
1540- #[ cfg_attr( feature = "nightly" , derive( HashStable ) ) ]
1540+ #[ cfg_attr( feature = "nightly" , derive( StableHash ) ) ]
15411541pub enum Scalar {
15421542 Initialized {
15431543 value : Primitive ,
@@ -1641,7 +1641,7 @@ impl Scalar {
16411641// NOTE: This struct is generic over the FieldIdx for rust-analyzer usage.
16421642/// Describes how the fields of a type are located in memory.
16431643#[ derive( PartialEq , Eq , Hash , Clone , Debug ) ]
1644- #[ cfg_attr( feature = "nightly" , derive( HashStable ) ) ]
1644+ #[ cfg_attr( feature = "nightly" , derive( StableHash ) ) ]
16451645pub enum FieldsShape < FieldIdx : Idx > {
16461646 /// Scalar primitives and `!`, which never have fields.
16471647 Primitive ,
@@ -1726,7 +1726,7 @@ impl<FieldIdx: Idx> FieldsShape<FieldIdx> {
17261726/// should operate on. Special address spaces have an effect on code generation,
17271727/// depending on the target and the address spaces it implements.
17281728#[ derive( Copy , Clone , Debug , PartialEq , Eq , PartialOrd , Ord , Hash ) ]
1729- #[ cfg_attr( feature = "nightly" , derive( HashStable ) ) ]
1729+ #[ cfg_attr( feature = "nightly" , derive( StableHash ) ) ]
17301730pub struct AddressSpace ( pub u32 ) ;
17311731
17321732impl AddressSpace {
@@ -1739,7 +1739,7 @@ impl AddressSpace {
17391739
17401740/// How many scalable vectors are in a `BackendRepr::ScalableVector`?
17411741#[ derive( Clone , Copy , PartialEq , Eq , Hash , Debug ) ]
1742- #[ cfg_attr( feature = "nightly" , derive( HashStable ) ) ]
1742+ #[ cfg_attr( feature = "nightly" , derive( StableHash ) ) ]
17431743pub struct NumScalableVectors ( pub u8 ) ;
17441744
17451745impl NumScalableVectors {
@@ -1788,7 +1788,7 @@ impl IntoDiagArg for NumScalableVectors {
17881788/// Generally, a codegen backend will prefer to handle smaller values as a scalar or short vector,
17891789/// and larger values will usually prefer to be represented as memory.
17901790#[ derive( Clone , Copy , PartialEq , Eq , Hash , Debug ) ]
1791- #[ cfg_attr( feature = "nightly" , derive( HashStable ) ) ]
1791+ #[ cfg_attr( feature = "nightly" , derive( StableHash ) ) ]
17921792pub enum BackendRepr {
17931793 Scalar ( Scalar ) ,
17941794 ScalarPair ( Scalar , Scalar ) ,
@@ -1932,7 +1932,7 @@ impl BackendRepr {
19321932
19331933// NOTE: This struct is generic over the FieldIdx and VariantIdx for rust-analyzer usage.
19341934#[ derive( PartialEq , Eq , Hash , Clone , Debug ) ]
1935- #[ cfg_attr( feature = "nightly" , derive( HashStable ) ) ]
1935+ #[ cfg_attr( feature = "nightly" , derive( StableHash ) ) ]
19361936pub enum Variants < FieldIdx : Idx , VariantIdx : Idx > {
19371937 /// A type with no valid variants. Must be uninhabited.
19381938 Empty ,
@@ -1959,7 +1959,7 @@ pub enum Variants<FieldIdx: Idx, VariantIdx: Idx> {
19591959
19601960// NOTE: This struct is generic over the VariantIdx for rust-analyzer usage.
19611961#[ derive( PartialEq , Eq , Hash , Clone , Debug ) ]
1962- #[ cfg_attr( feature = "nightly" , derive( HashStable ) ) ]
1962+ #[ cfg_attr( feature = "nightly" , derive( StableHash ) ) ]
19631963pub enum TagEncoding < VariantIdx : Idx > {
19641964 /// The tag directly stores the discriminant, but possibly with a smaller layout
19651965 /// (so converting the tag to the discriminant can require sign extension).
@@ -2000,7 +2000,7 @@ pub enum TagEncoding<VariantIdx: Idx> {
20002000}
20012001
20022002#[ derive( Clone , Copy , PartialEq , Eq , Hash , Debug ) ]
2003- #[ cfg_attr( feature = "nightly" , derive( HashStable ) ) ]
2003+ #[ cfg_attr( feature = "nightly" , derive( StableHash ) ) ]
20042004pub struct Niche {
20052005 pub offset : Size ,
20062006 pub value : Primitive ,
@@ -2097,7 +2097,7 @@ impl Niche {
20972097
20982098// NOTE: This struct is generic over the FieldIdx and VariantIdx for rust-analyzer usage.
20992099#[ derive( PartialEq , Eq , Hash , Clone ) ]
2100- #[ cfg_attr( feature = "nightly" , derive( HashStable ) ) ]
2100+ #[ cfg_attr( feature = "nightly" , derive( StableHash ) ) ]
21012101pub struct LayoutData < FieldIdx : Idx , VariantIdx : Idx > {
21022102 /// Says where the fields are located within the layout.
21032103 pub fields : FieldsShape < FieldIdx > ,
0 commit comments