From 087b422ec7caa6358653d8707db55488c2a4d8aa Mon Sep 17 00:00:00 2001 From: Nicholas Nethercote Date: Wed, 8 Apr 2026 13:40:45 +1000 Subject: [PATCH] Remove `derive(HashStable_Generic)`. It's now just a synonym for `derive(HashStable)`. --- compiler/rustc_abi/src/callconv/reg.rs | 6 +- compiler/rustc_abi/src/canon_abi.rs | 10 +- compiler/rustc_abi/src/layout/ty.rs | 6 +- compiler/rustc_abi/src/lib.rs | 63 ++-- compiler/rustc_ast/src/ast.rs | 72 ++--- .../rustc_ast/src/attr/data_structures.rs | 4 +- compiler/rustc_ast/src/attr/version.rs | 4 +- compiler/rustc_ast/src/expand/allocator.rs | 4 +- .../rustc_ast/src/expand/autodiff_attrs.rs | 6 +- compiler/rustc_ast/src/expand/mod.rs | 2 +- compiler/rustc_ast/src/expand/typetree.rs | 10 +- compiler/rustc_ast/src/token.rs | 28 +- compiler/rustc_ast/src/tokenstream.rs | 10 +- compiler/rustc_error_messages/src/lib.rs | 6 +- .../rustc_hir/src/attrs/data_structures.rs | 112 +++---- compiler/rustc_hir/src/attrs/diagnostic.rs | 24 +- compiler/rustc_hir/src/def.rs | 18 +- compiler/rustc_hir/src/diagnostic_items.rs | 4 +- compiler/rustc_hir/src/hir.rs | 282 +++++++++--------- compiler/rustc_hir/src/lang_items.rs | 4 +- compiler/rustc_hir/src/limit.rs | 4 +- compiler/rustc_hir/src/stability.rs | 16 +- compiler/rustc_hir/src/target.rs | 8 +- compiler/rustc_hir_id/src/lib.rs | 4 +- compiler/rustc_index_macros/src/lib.rs | 3 +- compiler/rustc_lint_defs/src/lib.rs | 14 +- compiler/rustc_macros/src/lib.rs | 4 - compiler/rustc_session/src/config.rs | 16 +- compiler/rustc_session/src/cstore.rs | 22 +- compiler/rustc_session/src/search_paths.rs | 4 +- compiler/rustc_session/src/session.rs | 4 +- compiler/rustc_session/src/utils.rs | 4 +- compiler/rustc_span/src/def_id.rs | 10 +- compiler/rustc_span/src/edition.rs | 4 +- compiler/rustc_span/src/hygiene.rs | 16 +- compiler/rustc_span/src/lib.rs | 28 +- compiler/rustc_span/src/symbol.rs | 4 +- compiler/rustc_target/src/asm/mod.rs | 14 +- compiler/rustc_target/src/callconv/mod.rs | 22 +- compiler/rustc_target/src/spec/mod.rs | 10 +- compiler/rustc_target/src/target_features.rs | 4 +- 41 files changed, 412 insertions(+), 478 deletions(-) diff --git a/compiler/rustc_abi/src/callconv/reg.rs b/compiler/rustc_abi/src/callconv/reg.rs index c30425fb703a..397fa7d65365 100644 --- a/compiler/rustc_abi/src/callconv/reg.rs +++ b/compiler/rustc_abi/src/callconv/reg.rs @@ -1,9 +1,9 @@ #[cfg(feature = "nightly")] -use rustc_macros::HashStable_Generic; +use rustc_macros::HashStable; use crate::{Align, HasDataLayout, Integer, Primitive, Size}; -#[cfg_attr(feature = "nightly", derive(HashStable_Generic))] +#[cfg_attr(feature = "nightly", derive(HashStable))] #[derive(Copy, Clone, PartialEq, Eq, Hash, Debug)] pub enum RegKind { Integer, @@ -16,7 +16,7 @@ pub enum RegKind { }, } -#[cfg_attr(feature = "nightly", derive(HashStable_Generic))] +#[cfg_attr(feature = "nightly", derive(HashStable))] #[derive(Copy, Clone, PartialEq, Eq, Hash, Debug)] pub struct Reg { pub kind: RegKind, diff --git a/compiler/rustc_abi/src/canon_abi.rs b/compiler/rustc_abi/src/canon_abi.rs index fd45f0ea0e9e..fc81a5911edd 100644 --- a/compiler/rustc_abi/src/canon_abi.rs +++ b/compiler/rustc_abi/src/canon_abi.rs @@ -1,7 +1,7 @@ use std::fmt; #[cfg(feature = "nightly")] -use rustc_macros::HashStable_Generic; +use rustc_macros::HashStable; use crate::ExternAbi; @@ -18,7 +18,7 @@ /// rather than picking the "actual" ABI. #[derive(Copy, Clone, Debug)] #[derive(PartialOrd, Ord, PartialEq, Eq, Hash)] -#[cfg_attr(feature = "nightly", derive(HashStable_Generic))] +#[cfg_attr(feature = "nightly", derive(HashStable))] pub enum CanonAbi { // NOTE: the use of nested variants for some ABIs is for many targets they don't matter, // and this pushes the complexity of their reasoning to target-specific code, @@ -111,7 +111,7 @@ fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { /// These only affect callee codegen. making their categorization as distinct ABIs a bit peculiar. #[derive(Copy, Clone, Debug)] #[derive(PartialOrd, Ord, PartialEq, Eq, Hash)] -#[cfg_attr(feature = "nightly", derive(HashStable_Generic))] +#[cfg_attr(feature = "nightly", derive(HashStable))] pub enum InterruptKind { Avr, AvrNonBlocking, @@ -126,7 +126,7 @@ pub enum InterruptKind { /// One of SysV64 or Win64 may alias the C ABI, and arguably Win64 is cross-platform now? #[derive(Clone, Copy, Debug)] #[derive(PartialOrd, Ord, PartialEq, Eq, Hash)] -#[cfg_attr(feature = "nightly", derive(HashStable_Generic))] +#[cfg_attr(feature = "nightly", derive(HashStable))] pub enum X86Call { /// "fastcall" has both GNU and Windows variants Fastcall, @@ -141,7 +141,7 @@ pub enum X86Call { /// ABIs defined for 32-bit Arm #[derive(Copy, Clone, Debug)] #[derive(PartialOrd, Ord, PartialEq, Eq, Hash)] -#[cfg_attr(feature = "nightly", derive(HashStable_Generic))] +#[cfg_attr(feature = "nightly", derive(HashStable))] pub enum ArmCall { Aapcs, CCmseNonSecureCall, diff --git a/compiler/rustc_abi/src/layout/ty.rs b/compiler/rustc_abi/src/layout/ty.rs index 7698a40629da..b394f9f4f86d 100644 --- a/compiler/rustc_abi/src/layout/ty.rs +++ b/compiler/rustc_abi/src/layout/ty.rs @@ -2,7 +2,7 @@ use std::ops::Deref; use rustc_data_structures::intern::Interned; -use rustc_macros::HashStable_Generic; +use rustc_macros::HashStable; use crate::layout::{FieldIdx, VariantIdx}; use crate::{ @@ -12,7 +12,7 @@ // Explicitly import `Float` to avoid ambiguity with `Primitive::Float`. -#[derive(Copy, Clone, PartialEq, Eq, Hash, HashStable_Generic)] +#[derive(Copy, Clone, PartialEq, Eq, Hash, HashStable)] #[rustc_pass_by_value] pub struct Layout<'a>(pub Interned<'a, LayoutData>); @@ -71,7 +71,7 @@ pub fn unadjusted_abi_align(self) -> Align { /// to that obtained from `layout_of(ty)`, as we need to produce /// layouts for which Rust types do not exist, such as enum variants /// or synthetic fields of enums (i.e., discriminants) and wide pointers. -#[derive(Copy, Clone, PartialEq, Eq, Hash, HashStable_Generic)] +#[derive(Copy, Clone, PartialEq, Eq, Hash, HashStable)] pub struct TyAndLayout<'a, Ty> { pub ty: Ty, pub layout: Layout<'a>, diff --git a/compiler/rustc_abi/src/lib.rs b/compiler/rustc_abi/src/lib.rs index 22300fda5f69..2e6141722cd8 100644 --- a/compiler/rustc_abi/src/lib.rs +++ b/compiler/rustc_abi/src/lib.rs @@ -53,7 +53,7 @@ use rustc_hashes::Hash64; use rustc_index::{Idx, IndexSlice, IndexVec}; #[cfg(feature = "nightly")] -use rustc_macros::{Decodable_NoContext, Encodable_NoContext, HashStable_Generic}; +use rustc_macros::{Decodable_NoContext, Encodable_NoContext, HashStable}; #[cfg(feature = "nightly")] use rustc_span::{Symbol, sym}; @@ -74,10 +74,7 @@ pub use layout::{Layout, TyAbiInterface, TyAndLayout}; #[derive(Clone, Copy, PartialEq, Eq, Default)] -#[cfg_attr( - feature = "nightly", - derive(Encodable_NoContext, Decodable_NoContext, HashStable_Generic) -)] +#[cfg_attr(feature = "nightly", derive(Encodable_NoContext, Decodable_NoContext, HashStable))] pub struct ReprFlags(u8); bitflags! { @@ -114,10 +111,7 @@ fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { } #[derive(Copy, Clone, Debug, Eq, PartialEq)] -#[cfg_attr( - feature = "nightly", - derive(Encodable_NoContext, Decodable_NoContext, HashStable_Generic) -)] +#[cfg_attr(feature = "nightly", derive(Encodable_NoContext, Decodable_NoContext, HashStable))] pub enum IntegerType { /// Pointer-sized integer type, i.e. `isize` and `usize`. The field shows signedness, e.g. /// `Pointer(true)` means `isize`. @@ -137,10 +131,7 @@ pub fn is_signed(&self) -> bool { } #[derive(Copy, Clone, Debug, Eq, PartialEq)] -#[cfg_attr( - feature = "nightly", - derive(Encodable_NoContext, Decodable_NoContext, HashStable_Generic) -)] +#[cfg_attr(feature = "nightly", derive(Encodable_NoContext, Decodable_NoContext, HashStable))] pub enum ScalableElt { /// `N` in `rustc_scalable_vector(N)` - the element count of the scalable vector ElementCount(u16), @@ -151,10 +142,7 @@ pub enum ScalableElt { /// Represents the repr options provided by the user. #[derive(Copy, Clone, Debug, Eq, PartialEq, Default)] -#[cfg_attr( - feature = "nightly", - derive(Encodable_NoContext, Decodable_NoContext, HashStable_Generic) -)] +#[cfg_attr(feature = "nightly", derive(Encodable_NoContext, Decodable_NoContext, HashStable))] pub struct ReprOptions { pub int: Option, pub align: Option, @@ -804,10 +792,7 @@ fn from_str(s: &str) -> Result { /// Size of a type in bytes. #[derive(Copy, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)] -#[cfg_attr( - feature = "nightly", - derive(Encodable_NoContext, Decodable_NoContext, HashStable_Generic) -)] +#[cfg_attr(feature = "nightly", derive(Encodable_NoContext, Decodable_NoContext, HashStable))] pub struct Size { raw: u64, } @@ -1032,10 +1017,7 @@ unsafe fn backward_unchecked(start: Self, count: usize) -> Self { /// Alignment of a type in bytes (always a power of two). #[derive(Copy, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)] -#[cfg_attr( - feature = "nightly", - derive(Encodable_NoContext, Decodable_NoContext, HashStable_Generic) -)] +#[cfg_attr(feature = "nightly", derive(Encodable_NoContext, Decodable_NoContext, HashStable))] pub struct Align { pow2: u8, } @@ -1168,7 +1150,7 @@ pub fn restrict_for_offset(self, size: Size) -> Align { /// An example of a rare thing actually affected by preferred alignment is aligning of statics. /// It is of effectively no consequence for layout in structs and on the stack. #[derive(Copy, Clone, PartialEq, Eq, Hash, Debug)] -#[cfg_attr(feature = "nightly", derive(HashStable_Generic))] +#[cfg_attr(feature = "nightly", derive(HashStable))] pub struct AbiAlign { pub abi: Align, } @@ -1200,10 +1182,7 @@ fn deref(&self) -> &Self::Target { /// Integers, also used for enum discriminants. #[derive(Copy, Clone, PartialEq, Eq, PartialOrd, Ord, Hash, Debug)] -#[cfg_attr( - feature = "nightly", - derive(Encodable_NoContext, Decodable_NoContext, HashStable_Generic) -)] +#[cfg_attr(feature = "nightly", derive(Encodable_NoContext, Decodable_NoContext, HashStable))] pub enum Integer { I8, I16, @@ -1363,7 +1342,7 @@ pub fn from_size(size: Size) -> Result { /// Floating-point types. #[derive(Copy, Clone, PartialEq, Eq, PartialOrd, Ord, Hash, Debug)] -#[cfg_attr(feature = "nightly", derive(HashStable_Generic))] +#[cfg_attr(feature = "nightly", derive(HashStable))] pub enum Float { F16, F32, @@ -1398,7 +1377,7 @@ pub fn align(self, cx: &C) -> AbiAlign { /// Fundamental unit of memory access and layout. #[derive(Copy, Clone, PartialEq, Eq, Hash, Debug)] -#[cfg_attr(feature = "nightly", derive(HashStable_Generic))] +#[cfg_attr(feature = "nightly", derive(HashStable))] pub enum Primitive { /// The `bool` is the signedness of the `Integer` type. /// @@ -1446,7 +1425,7 @@ pub fn align(self, cx: &C) -> AbiAlign { /// /// This is intended specifically to mirror LLVM’s `!range` metadata semantics. #[derive(Clone, Copy, PartialEq, Eq, Hash)] -#[cfg_attr(feature = "nightly", derive(HashStable_Generic))] +#[cfg_attr(feature = "nightly", derive(HashStable))] pub struct WrappingRange { pub start: u128, pub end: u128, @@ -1558,7 +1537,7 @@ fn fmt(&self, fmt: &mut fmt::Formatter<'_>) -> fmt::Result { /// Information about one scalar component of a Rust type. #[derive(Clone, Copy, PartialEq, Eq, Hash, Debug)] -#[cfg_attr(feature = "nightly", derive(HashStable_Generic))] +#[cfg_attr(feature = "nightly", derive(HashStable))] pub enum Scalar { Initialized { value: Primitive, @@ -1662,7 +1641,7 @@ pub fn is_signed(&self) -> bool { // NOTE: This struct is generic over the FieldIdx for rust-analyzer usage. /// Describes how the fields of a type are located in memory. #[derive(PartialEq, Eq, Hash, Clone, Debug)] -#[cfg_attr(feature = "nightly", derive(HashStable_Generic))] +#[cfg_attr(feature = "nightly", derive(HashStable))] pub enum FieldsShape { /// Scalar primitives and `!`, which never have fields. Primitive, @@ -1747,7 +1726,7 @@ pub fn index_by_increasing_offset(&self) -> impl ExactSizeIterator /// should operate on. Special address spaces have an effect on code generation, /// depending on the target and the address spaces it implements. #[derive(Copy, Clone, Debug, PartialEq, Eq, PartialOrd, Ord, Hash)] -#[cfg_attr(feature = "nightly", derive(HashStable_Generic))] +#[cfg_attr(feature = "nightly", derive(HashStable))] pub struct AddressSpace(pub u32); impl AddressSpace { @@ -1760,7 +1739,7 @@ impl AddressSpace { /// How many scalable vectors are in a `BackendRepr::ScalableVector`? #[derive(Clone, Copy, PartialEq, Eq, Hash, Debug)] -#[cfg_attr(feature = "nightly", derive(HashStable_Generic))] +#[cfg_attr(feature = "nightly", derive(HashStable))] pub struct NumScalableVectors(pub u8); impl NumScalableVectors { @@ -1809,7 +1788,7 @@ fn into_diag_arg(self, _: &mut Option) -> DiagArgValue { /// Generally, a codegen backend will prefer to handle smaller values as a scalar or short vector, /// and larger values will usually prefer to be represented as memory. #[derive(Clone, Copy, PartialEq, Eq, Hash, Debug)] -#[cfg_attr(feature = "nightly", derive(HashStable_Generic))] +#[cfg_attr(feature = "nightly", derive(HashStable))] pub enum BackendRepr { Scalar(Scalar), ScalarPair(Scalar, Scalar), @@ -1953,7 +1932,7 @@ pub fn eq_up_to_validity(&self, other: &Self) -> bool { // NOTE: This struct is generic over the FieldIdx and VariantIdx for rust-analyzer usage. #[derive(PartialEq, Eq, Hash, Clone, Debug)] -#[cfg_attr(feature = "nightly", derive(HashStable_Generic))] +#[cfg_attr(feature = "nightly", derive(HashStable))] pub enum Variants { /// A type with no valid variants. Must be uninhabited. Empty, @@ -1980,7 +1959,7 @@ pub enum Variants { // NOTE: This struct is generic over the VariantIdx for rust-analyzer usage. #[derive(PartialEq, Eq, Hash, Clone, Debug)] -#[cfg_attr(feature = "nightly", derive(HashStable_Generic))] +#[cfg_attr(feature = "nightly", derive(HashStable))] pub enum TagEncoding { /// The tag directly stores the discriminant, but possibly with a smaller layout /// (so converting the tag to the discriminant can require sign extension). @@ -2021,7 +2000,7 @@ pub enum TagEncoding { } #[derive(Clone, Copy, PartialEq, Eq, Hash, Debug)] -#[cfg_attr(feature = "nightly", derive(HashStable_Generic))] +#[cfg_attr(feature = "nightly", derive(HashStable))] pub struct Niche { pub offset: Size, pub value: Primitive, @@ -2118,7 +2097,7 @@ pub fn reserve(&self, cx: &C, count: u128) -> Option<(u128, Sc // NOTE: This struct is generic over the FieldIdx and VariantIdx for rust-analyzer usage. #[derive(PartialEq, Eq, Hash, Clone)] -#[cfg_attr(feature = "nightly", derive(HashStable_Generic))] +#[cfg_attr(feature = "nightly", derive(HashStable))] pub struct LayoutData { /// Says where the fields are located within the layout. pub fields: FieldsShape, diff --git a/compiler/rustc_ast/src/ast.rs b/compiler/rustc_ast/src/ast.rs index 417c4c31fc87..a768beedba31 100644 --- a/compiler/rustc_ast/src/ast.rs +++ b/compiler/rustc_ast/src/ast.rs @@ -28,7 +28,7 @@ use rustc_data_structures::stable_hasher::{HashStable, HashStableContext, StableHasher}; use rustc_data_structures::stack::ensure_sufficient_stack; use rustc_data_structures::tagged_ptr::Tag; -use rustc_macros::{Decodable, Encodable, HashStable_Generic, Walkable}; +use rustc_macros::{Decodable, Encodable, HashStable, Walkable}; pub use rustc_span::AttrId; use rustc_span::{ ByteSymbol, DUMMY_SP, ErrorGuaranteed, Ident, Span, Spanned, Symbol, kw, respan, sym, @@ -52,7 +52,7 @@ /// ``` /// /// `'outer` is a label. -#[derive(Clone, Encodable, Decodable, Copy, HashStable_Generic, Eq, PartialEq, Walkable)] +#[derive(Clone, Encodable, Decodable, Copy, HashStable, Eq, PartialEq, Walkable)] pub struct Label { pub ident: Ident, } @@ -564,7 +564,7 @@ pub struct Crate { /// for most built-in attributes. /// /// E.g., `#[test]`, `#[derive(..)]`, `#[rustfmt::skip]` or `#[feature = "foo"]`. -#[derive(Clone, Encodable, Decodable, Debug, HashStable_Generic)] +#[derive(Clone, Encodable, Decodable, Debug, HashStable)] pub struct MetaItem { pub unsafety: Safety, pub path: Path, @@ -573,7 +573,7 @@ pub struct MetaItem { } /// The meta item kind, containing the data after the initial path. -#[derive(Clone, Encodable, Decodable, Debug, HashStable_Generic)] +#[derive(Clone, Encodable, Decodable, Debug, HashStable)] pub enum MetaItemKind { /// Word meta item. /// @@ -594,7 +594,7 @@ pub enum MetaItemKind { /// Values inside meta item lists. /// /// E.g., each of `Clone`, `Copy` in `#[derive(Clone, Copy)]`. -#[derive(Clone, Encodable, Decodable, Debug, HashStable_Generic)] +#[derive(Clone, Encodable, Decodable, Debug, HashStable)] pub enum MetaItemInner { /// A full MetaItem, for recursive meta items. MetaItem(MetaItem), @@ -792,7 +792,7 @@ pub struct PatField { } #[derive(Clone, Copy, Debug, Eq, PartialEq)] -#[derive(Encodable, Decodable, HashStable_Generic, Walkable)] +#[derive(Encodable, Decodable, HashStable, Walkable)] pub enum ByRef { Yes(Pinnedness, Mutability), No, @@ -814,7 +814,7 @@ pub fn cap_ref_mutability(mut self, mutbl: Mutability) -> Self { /// `.0` is the by-reference mode (`ref`, `ref mut`, or by value), /// `.1` is the mutability of the binding. #[derive(Clone, Copy, Debug, Eq, PartialEq)] -#[derive(Encodable, Decodable, HashStable_Generic, Walkable)] +#[derive(Encodable, Decodable, HashStable, Walkable)] pub struct BindingMode(pub ByRef, pub Mutability); impl BindingMode { @@ -964,7 +964,7 @@ pub enum PatFieldsRest { /// The kind of borrow in an `AddrOf` expression, /// e.g., `&place` or `&raw const place`. #[derive(Clone, Copy, PartialEq, Eq, Debug)] -#[derive(Encodable, Decodable, HashStable_Generic, Walkable)] +#[derive(Encodable, Decodable, HashStable, Walkable)] pub enum BorrowKind { /// A normal borrow, `&$expr` or `&mut $expr`. /// The resulting type is either `&'a T` or `&'a mut T` @@ -980,7 +980,7 @@ pub enum BorrowKind { Pin, } -#[derive(Clone, Copy, Debug, PartialEq, Encodable, Decodable, HashStable_Generic, Walkable)] +#[derive(Clone, Copy, Debug, PartialEq, Encodable, Decodable, HashStable, Walkable)] pub enum BinOpKind { /// The `+` operator (addition) Add, @@ -1110,7 +1110,7 @@ fn from(op: AssignOpKind) -> BinOpKind { } } -#[derive(Clone, Copy, Debug, PartialEq, Encodable, Decodable, HashStable_Generic, Walkable)] +#[derive(Clone, Copy, Debug, PartialEq, Encodable, Decodable, HashStable, Walkable)] pub enum AssignOpKind { /// The `+=` operator (addition) AddAssign, @@ -1162,7 +1162,7 @@ pub fn is_by_value(self) -> bool { /// Unary operator. /// /// Note that `&data` is not an operator, it's an `AddrOf` expression. -#[derive(Clone, Copy, Debug, PartialEq, Encodable, Decodable, HashStable_Generic, Walkable)] +#[derive(Clone, Copy, Debug, PartialEq, Encodable, Decodable, HashStable, Walkable)] pub enum UnOp { /// The `*` operator for dereferencing Deref, @@ -1961,7 +1961,7 @@ pub fn modifier(&self) -> &'static str { /// Whether we're unwrapping or wrapping an unsafe binder #[derive(Copy, Clone, Debug, PartialEq, Eq, Hash)] -#[derive(Encodable, Decodable, HashStable_Generic, Walkable)] +#[derive(Encodable, Decodable, HashStable, Walkable)] pub enum UnsafeBinderCastKind { // e.g. `&i32` -> `unsafe<'a> &'a i32` Wrap, @@ -1995,7 +1995,7 @@ pub struct QSelf { } /// A capture clause used in closures and `async` blocks. -#[derive(Clone, Copy, PartialEq, Encodable, Decodable, Debug, HashStable_Generic, Walkable)] +#[derive(Clone, Copy, PartialEq, Encodable, Decodable, Debug, HashStable, Walkable)] pub enum CaptureBy { /// `move |x| y + x`. Value { @@ -2090,7 +2090,7 @@ pub fn inner_tokens(&self) -> TokenStream { } /// Delimited arguments, as used in `#[attr()/[]/{}]` or `mac!()/[]/{}`. -#[derive(Clone, Encodable, Decodable, Debug, HashStable_Generic, Walkable)] +#[derive(Clone, Encodable, Decodable, Debug, HashStable, Walkable)] pub struct DelimArgs { pub dspan: DelimSpan, pub delim: Delimiter, // Note: `Delimiter::Invisible` never occurs @@ -2106,7 +2106,7 @@ pub fn need_semicolon(&self) -> bool { } /// Represents a macro definition. -#[derive(Clone, Encodable, Decodable, Debug, HashStable_Generic, Walkable)] +#[derive(Clone, Encodable, Decodable, Debug, HashStable, Walkable)] pub struct MacroDef { pub body: Box, /// `true` if macro was defined with `macro_rules`. @@ -2120,7 +2120,7 @@ pub struct MacroDef { pub eii_declaration: Option, } -#[derive(Clone, Encodable, Decodable, Debug, HashStable_Generic, Walkable)] +#[derive(Clone, Encodable, Decodable, Debug, HashStable, Walkable)] pub struct EiiDecl { /// path to the extern item we're targeting pub foreign_item: Path, @@ -2128,7 +2128,7 @@ pub struct EiiDecl { } #[derive(Clone, Encodable, Decodable, Debug, Copy, Hash, Eq, PartialEq)] -#[derive(HashStable_Generic, Walkable)] +#[derive(HashStable, Walkable)] pub enum StrStyle { /// A regular string, like `"foo"`. Cooked, @@ -2186,7 +2186,7 @@ pub const fn same_kind(&self, other: &Self) -> bool { } /// A literal in a meta item. -#[derive(Clone, Copy, Encodable, Decodable, Debug, HashStable_Generic)] +#[derive(Clone, Copy, Encodable, Decodable, Debug, HashStable)] pub struct MetaItemLit { /// The original literal as written in the source code. pub symbol: Symbol, @@ -2223,7 +2223,7 @@ pub fn as_token_lit(&self) -> token::Lit { /// Type of the integer literal based on provided suffix. #[derive(Clone, Copy, Encodable, Decodable, Debug, Hash, Eq, PartialEq)] -#[derive(HashStable_Generic)] +#[derive(HashStable)] pub enum LitIntType { /// e.g. `42_i32`. Signed(IntTy), @@ -2235,7 +2235,7 @@ pub enum LitIntType { /// Type of the float literal based on provided suffix. #[derive(Clone, Copy, Encodable, Decodable, Debug, Hash, Eq, PartialEq)] -#[derive(HashStable_Generic)] +#[derive(HashStable)] pub enum LitFloatType { /// A float literal with a suffix (`1f32` or `1E10f32`). Suffixed(FloatTy), @@ -2249,7 +2249,7 @@ pub enum LitFloatType { /// deciding the `LitKind`. This means that float literals like `1f32` are /// classified by this type as `Float`. This is different to `token::LitKind` /// which does *not* consider the suffix. -#[derive(Clone, Copy, Encodable, Decodable, Debug, Hash, Eq, PartialEq, HashStable_Generic)] +#[derive(Clone, Copy, Encodable, Decodable, Debug, Hash, Eq, PartialEq, HashStable)] pub enum LitKind { /// A string literal (`"foo"`). The symbol is unescaped, and so may differ /// from the original token's symbol. @@ -2652,7 +2652,7 @@ pub enum TyPatKind { } /// Syntax used to declare a trait object. -#[derive(Clone, Copy, PartialEq, Encodable, Decodable, Debug, HashStable_Generic, Walkable)] +#[derive(Clone, Copy, PartialEq, Encodable, Decodable, Debug, HashStable, Walkable)] #[repr(u8)] pub enum TraitObjectSyntax { // SAFETY: When adding new variants make sure to update the `Tag` impl. @@ -2696,7 +2696,7 @@ pub enum InlineAsmRegOrRegClass { RegClass(Symbol), } -#[derive(Clone, Copy, PartialEq, Eq, Hash, Encodable, Decodable, HashStable_Generic)] +#[derive(Clone, Copy, PartialEq, Eq, Hash, Encodable, Decodable, HashStable)] pub struct InlineAsmOptions(u16); bitflags::bitflags! { impl InlineAsmOptions: u16 { @@ -2759,7 +2759,7 @@ fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { } } -#[derive(Clone, PartialEq, Encodable, Decodable, Debug, Hash, HashStable_Generic, Walkable)] +#[derive(Clone, PartialEq, Encodable, Decodable, Debug, Hash, HashStable, Walkable)] pub enum InlineAsmTemplatePiece { String(Cow<'static, str>), Placeholder { operand_idx: usize, modifier: Option, span: Span }, @@ -2862,7 +2862,7 @@ pub fn reg(&self) -> Option<&InlineAsmRegOrRegClass> { } } -#[derive(Clone, Copy, Encodable, Decodable, Debug, HashStable_Generic, Walkable, PartialEq, Eq)] +#[derive(Clone, Copy, Encodable, Decodable, Debug, HashStable, Walkable, PartialEq, Eq)] pub enum AsmMacro { /// The `asm!` macro Asm, @@ -3060,7 +3060,7 @@ pub fn c_variadic(&self) -> bool { } /// Is the trait definition an auto trait? -#[derive(Copy, Clone, PartialEq, Encodable, Decodable, Debug, HashStable_Generic, Walkable)] +#[derive(Copy, Clone, PartialEq, Encodable, Decodable, Debug, HashStable, Walkable)] pub enum IsAuto { Yes, No, @@ -3068,7 +3068,7 @@ pub enum IsAuto { /// Safety of items. #[derive(Copy, Clone, PartialEq, Eq, Hash, Encodable, Decodable, Debug)] -#[derive(HashStable_Generic, Walkable)] +#[derive(HashStable, Walkable)] pub enum Safety { /// `unsafe` an item is explicitly marked as `unsafe`. Unsafe(Span), @@ -3133,7 +3133,7 @@ pub fn return_id(self) -> (NodeId, Span) { } #[derive(Copy, Clone, PartialEq, Eq, Hash, Encodable, Decodable, Debug)] -#[derive(HashStable_Generic, Walkable)] +#[derive(HashStable, Walkable)] pub enum Const { Yes(Span), No, @@ -3141,7 +3141,7 @@ pub enum Const { /// Item defaultness. /// For details see the [RFC #2532](https://github.com/rust-lang/rfcs/pull/2532). -#[derive(Copy, Clone, PartialEq, Encodable, Decodable, Debug, HashStable_Generic, Walkable)] +#[derive(Copy, Clone, PartialEq, Encodable, Decodable, Debug, HashStable, Walkable)] pub enum Defaultness { /// Item is unmarked. Implicitly determined based off of position. /// For impls, this is `final`; for traits, this is `default`. @@ -3155,7 +3155,7 @@ pub enum Defaultness { Final(Span), } -#[derive(Copy, Clone, PartialEq, Encodable, Decodable, HashStable_Generic, Walkable)] +#[derive(Copy, Clone, PartialEq, Encodable, Decodable, HashStable, Walkable)] pub enum ImplPolarity { /// `impl Trait for Type` Positive, @@ -3174,7 +3174,7 @@ fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { /// The polarity of a trait bound. #[derive(Copy, Clone, PartialEq, Eq, Encodable, Decodable, Debug, Hash)] -#[derive(HashStable_Generic, Walkable)] +#[derive(HashStable, Walkable)] pub enum BoundPolarity { /// `Type: Trait` Positive, @@ -3196,7 +3196,7 @@ pub fn as_str(self) -> &'static str { /// The constness of a trait bound. #[derive(Copy, Clone, PartialEq, Eq, Encodable, Decodable, Debug, Hash)] -#[derive(HashStable_Generic, Walkable)] +#[derive(HashStable, Walkable)] pub enum BoundConstness { /// `Type: Trait` Never, @@ -3218,7 +3218,7 @@ pub fn as_str(self) -> &'static str { /// The asyncness of a trait bound. #[derive(Copy, Clone, PartialEq, Eq, Encodable, Decodable, Debug)] -#[derive(HashStable_Generic, Walkable)] +#[derive(HashStable, Walkable)] pub enum BoundAsyncness { /// `Type: Trait` Normal, @@ -3387,7 +3387,7 @@ pub fn hi_span(&self) -> Span { /// are contained as statements within items. These two cases need to be /// distinguished for pretty-printing. #[derive(Clone, PartialEq, Eq, Hash, Debug, Copy)] -#[derive(Encodable, Decodable, HashStable_Generic, Walkable)] +#[derive(Encodable, Decodable, HashStable, Walkable)] pub enum AttrStyle { Outer, Inner, @@ -3484,7 +3484,7 @@ pub fn span(&self) -> Option { /// /// Currently all early parsed attributes are excluded from pretty printing at rustc_ast_pretty::pprust::state::print_attribute_inline. /// When adding new early parsed attributes, consider whether they should be pretty printed. -#[derive(Clone, Encodable, Decodable, Debug, HashStable_Generic)] +#[derive(Clone, Encodable, Decodable, Debug, HashStable)] pub enum EarlyParsedAttribute { CfgTrace(CfgEntry), CfgAttrTrace, @@ -3607,7 +3607,7 @@ pub struct FieldDef { } /// Was parsing recovery performed? -#[derive(Copy, Clone, Debug, Encodable, Decodable, HashStable_Generic, Walkable)] +#[derive(Copy, Clone, Debug, Encodable, Decodable, HashStable, Walkable)] pub enum Recovered { No, Yes(ErrorGuaranteed), diff --git a/compiler/rustc_ast/src/attr/data_structures.rs b/compiler/rustc_ast/src/attr/data_structures.rs index 2eab91801cd6..36d0352b7f8a 100644 --- a/compiler/rustc_ast/src/attr/data_structures.rs +++ b/compiler/rustc_ast/src/attr/data_structures.rs @@ -1,12 +1,12 @@ use std::fmt; -use rustc_macros::{Decodable, Encodable, HashStable_Generic}; +use rustc_macros::{Decodable, Encodable, HashStable}; use rustc_span::{Span, Symbol}; use thin_vec::ThinVec; use crate::attr::version::RustcVersion; -#[derive(Encodable, Decodable, Clone, Debug, PartialEq, Eq, Hash, HashStable_Generic)] +#[derive(Encodable, Decodable, Clone, Debug, PartialEq, Eq, Hash, HashStable)] pub enum CfgEntry { All(ThinVec, Span), Any(ThinVec, Span), diff --git a/compiler/rustc_ast/src/attr/version.rs b/compiler/rustc_ast/src/attr/version.rs index 59deee40ae28..c695ba5b8a05 100644 --- a/compiler/rustc_ast/src/attr/version.rs +++ b/compiler/rustc_ast/src/attr/version.rs @@ -1,10 +1,10 @@ use std::fmt::{self, Display}; use std::sync::OnceLock; -use rustc_macros::{BlobDecodable, Encodable, HashStable_Generic, current_rustc_version}; +use rustc_macros::{BlobDecodable, Encodable, HashStable, current_rustc_version}; #[derive(Encodable, BlobDecodable, Copy, Clone, Debug, PartialEq, Eq, PartialOrd, Ord, Hash)] -#[derive(HashStable_Generic)] +#[derive(HashStable)] pub struct RustcVersion { pub major: u16, pub minor: u16, diff --git a/compiler/rustc_ast/src/expand/allocator.rs b/compiler/rustc_ast/src/expand/allocator.rs index 332ad50d927f..874534b87652 100644 --- a/compiler/rustc_ast/src/expand/allocator.rs +++ b/compiler/rustc_ast/src/expand/allocator.rs @@ -1,7 +1,7 @@ -use rustc_macros::HashStable_Generic; +use rustc_macros::HashStable; use rustc_span::{Symbol, sym}; -#[derive(Clone, Debug, Copy, Eq, PartialEq, HashStable_Generic)] +#[derive(Clone, Debug, Copy, Eq, PartialEq, HashStable)] pub enum AllocatorKind { /// Use `#[global_allocator]` as global allocator. Global, diff --git a/compiler/rustc_ast/src/expand/autodiff_attrs.rs b/compiler/rustc_ast/src/expand/autodiff_attrs.rs index a3c913436ac7..a1967ba8db32 100644 --- a/compiler/rustc_ast/src/expand/autodiff_attrs.rs +++ b/compiler/rustc_ast/src/expand/autodiff_attrs.rs @@ -8,7 +8,7 @@ use rustc_span::{Symbol, sym}; -use crate::expand::{Decodable, Encodable, HashStable_Generic}; +use crate::expand::{Decodable, Encodable, HashStable}; use crate::{Ty, TyKind}; /// Forward and Reverse Mode are well known names for automatic differentiation implementations. @@ -20,7 +20,7 @@ /// /// Documentation for using [reverse](https://enzyme.mit.edu/rust/rev.html) and /// [forward](https://enzyme.mit.edu/rust/fwd.html) mode is available online. -#[derive(Clone, Copy, Eq, PartialEq, Encodable, Decodable, Debug, HashStable_Generic)] +#[derive(Clone, Copy, Eq, PartialEq, Encodable, Decodable, Debug, HashStable)] pub enum DiffMode { /// No autodiff is applied (used during error handling). Error, @@ -42,7 +42,7 @@ pub fn all_modes() -> &'static [Symbol] { /// However, under forward mode we overwrite the previous shadow value, while for reverse mode /// we add to the previous shadow value. To not surprise users, we picked different names. /// Dual numbers is also a quite well known name for forward mode AD types. -#[derive(Clone, Copy, Eq, PartialEq, Encodable, Decodable, Debug, HashStable_Generic)] +#[derive(Clone, Copy, Eq, PartialEq, Encodable, Decodable, Debug, HashStable)] pub enum DiffActivity { /// Implicit or Explicit () return type, so a special case of Const. None, diff --git a/compiler/rustc_ast/src/expand/mod.rs b/compiler/rustc_ast/src/expand/mod.rs index 069bff67b97a..e5abb651c080 100644 --- a/compiler/rustc_ast/src/expand/mod.rs +++ b/compiler/rustc_ast/src/expand/mod.rs @@ -1,6 +1,6 @@ //! Definitions shared by macros / syntax extensions and e.g. `rustc_middle`. -use rustc_macros::{Decodable, Encodable, HashStable_Generic}; +use rustc_macros::{Decodable, Encodable, HashStable}; pub mod allocator; pub mod autodiff_attrs; diff --git a/compiler/rustc_ast/src/expand/typetree.rs b/compiler/rustc_ast/src/expand/typetree.rs index e7b4f3aff413..3c1dd69f6c55 100644 --- a/compiler/rustc_ast/src/expand/typetree.rs +++ b/compiler/rustc_ast/src/expand/typetree.rs @@ -21,9 +21,9 @@ use std::fmt; -use crate::expand::{Decodable, Encodable, HashStable_Generic}; +use crate::expand::{Decodable, Encodable, HashStable}; -#[derive(Clone, Copy, Eq, PartialEq, Encodable, Decodable, Debug, HashStable_Generic)] +#[derive(Clone, Copy, Eq, PartialEq, Encodable, Decodable, Debug, HashStable)] pub enum Kind { Anything, Integer, @@ -35,7 +35,7 @@ pub enum Kind { Unknown, } -#[derive(Clone, Eq, PartialEq, Encodable, Decodable, Debug, HashStable_Generic)] +#[derive(Clone, Eq, PartialEq, Encodable, Decodable, Debug, HashStable)] pub struct TypeTree(pub Vec); impl TypeTree { @@ -59,13 +59,13 @@ pub fn int(size: usize) -> Self { } } -#[derive(Clone, Eq, PartialEq, Encodable, Decodable, Debug, HashStable_Generic)] +#[derive(Clone, Eq, PartialEq, Encodable, Decodable, Debug, HashStable)] pub struct FncTree { pub args: Vec, pub ret: TypeTree, } -#[derive(Clone, Eq, PartialEq, Encodable, Decodable, Debug, HashStable_Generic)] +#[derive(Clone, Eq, PartialEq, Encodable, Decodable, Debug, HashStable)] pub struct Type { pub offset: isize, pub size: usize, diff --git a/compiler/rustc_ast/src/token.rs b/compiler/rustc_ast/src/token.rs index 62ec06358517..9f148f87dfba 100644 --- a/compiler/rustc_ast/src/token.rs +++ b/compiler/rustc_ast/src/token.rs @@ -5,7 +5,7 @@ pub use NtExprKind::*; pub use NtPatKind::*; pub use TokenKind::*; -use rustc_macros::{Decodable, Encodable, HashStable_Generic}; +use rustc_macros::{Decodable, Encodable, HashStable}; use rustc_span::edition::Edition; use rustc_span::symbol::IdentPrintMode; use rustc_span::{DUMMY_SP, ErrorGuaranteed, Span, kw, sym}; @@ -17,7 +17,7 @@ use crate::util::case::Case; /// Represents the kind of doc comment it is, ie `///` or `#[doc = ""]`. -#[derive(Clone, Copy, PartialEq, Eq, Encodable, Decodable, Debug, HashStable_Generic)] +#[derive(Clone, Copy, PartialEq, Eq, Encodable, Decodable, Debug, HashStable)] pub enum DocFragmentKind { /// A sugared doc comment: `///` or `//!` or `/**` or `/*!`. Sugared(CommentKind), @@ -40,13 +40,13 @@ pub fn comment_kind(self) -> CommentKind { } } -#[derive(Clone, Copy, PartialEq, Eq, Hash, Encodable, Decodable, Debug, HashStable_Generic)] +#[derive(Clone, Copy, PartialEq, Eq, Hash, Encodable, Decodable, Debug, HashStable)] pub enum CommentKind { Line, Block, } -#[derive(Copy, Clone, PartialEq, Eq, Hash, Debug, Encodable, Decodable, HashStable_Generic)] +#[derive(Copy, Clone, PartialEq, Eq, Hash, Debug, Encodable, Decodable, HashStable)] pub enum InvisibleOrigin { // From the expansion of a metavariable in a declarative macro. MetaVar(MetaVarKind), @@ -69,7 +69,7 @@ pub fn skip(&self) -> bool { } /// Annoyingly similar to `NonterminalKind`, but the slight differences are important. -#[derive(Debug, Copy, Clone, PartialEq, Eq, Encodable, Decodable, Hash, HashStable_Generic)] +#[derive(Debug, Copy, Clone, PartialEq, Eq, Encodable, Decodable, Hash, HashStable)] pub enum MetaVarKind { Item, Block, @@ -125,7 +125,7 @@ fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { /// Describes how a sequence of token trees is delimited. /// Cannot use `proc_macro::Delimiter` directly because this /// structure should implement some additional traits. -#[derive(Copy, Clone, Debug, PartialEq, Eq, Hash, Encodable, Decodable, HashStable_Generic)] +#[derive(Copy, Clone, Debug, PartialEq, Eq, Hash, Encodable, Decodable, HashStable)] pub enum Delimiter { /// `( ... )` Parenthesis, @@ -188,7 +188,7 @@ pub fn as_close_token_kind(&self) -> TokenKind { // type. This means that float literals like `1f32` are classified by this type // as `Int`. Only upon conversion to `ast::LitKind` will such a literal be // given the `Float` kind. -#[derive(Clone, Copy, PartialEq, Eq, Hash, Encodable, Decodable, Debug, HashStable_Generic)] +#[derive(Clone, Copy, PartialEq, Eq, Hash, Encodable, Decodable, Debug, HashStable)] pub enum LitKind { Bool, // AST only, must never appear in a `Token` Byte, @@ -205,7 +205,7 @@ pub enum LitKind { } /// A literal token. -#[derive(Clone, Copy, PartialEq, Eq, Hash, Encodable, Decodable, Debug, HashStable_Generic)] +#[derive(Clone, Copy, PartialEq, Eq, Hash, Encodable, Decodable, Debug, HashStable)] pub struct Lit { pub kind: LitKind, pub symbol: Symbol, @@ -351,7 +351,7 @@ fn ident_can_begin_type(name: Symbol, span: Span, is_raw: IdentIsRaw) -> bool { .contains(&name) } -#[derive(PartialEq, Eq, Encodable, Decodable, Hash, Debug, Copy, Clone, HashStable_Generic)] +#[derive(PartialEq, Eq, Encodable, Decodable, Hash, Debug, Copy, Clone, HashStable)] pub enum IdentIsRaw { No, Yes, @@ -378,7 +378,7 @@ fn from(b: bool) -> Self { } } -#[derive(Clone, Copy, PartialEq, Eq, Hash, Encodable, Decodable, Debug, HashStable_Generic)] +#[derive(Clone, Copy, PartialEq, Eq, Hash, Encodable, Decodable, Debug, HashStable)] pub enum TokenKind { /* Expression-operator symbols. */ /// `=` @@ -528,7 +528,7 @@ pub enum TokenKind { Eof, } -#[derive(Clone, Copy, PartialEq, Eq, Hash, Encodable, Decodable, Debug, HashStable_Generic)] +#[derive(Clone, Copy, PartialEq, Eq, Hash, Encodable, Decodable, Debug, HashStable)] pub struct Token { pub kind: TokenKind, pub span: Span, @@ -1090,7 +1090,7 @@ fn eq(&self, rhs: &TokenKind) -> bool { } } -#[derive(Debug, Copy, Clone, PartialEq, Eq, Encodable, Decodable, Hash, HashStable_Generic)] +#[derive(Debug, Copy, Clone, PartialEq, Eq, Encodable, Decodable, Hash, HashStable)] pub enum NtPatKind { // Matches or-patterns. Was written using `pat` in edition 2021 or later. PatWithOr, @@ -1100,7 +1100,7 @@ pub enum NtPatKind { PatParam { inferred: bool }, } -#[derive(Debug, Copy, Clone, PartialEq, Eq, Encodable, Decodable, Hash, HashStable_Generic)] +#[derive(Debug, Copy, Clone, PartialEq, Eq, Encodable, Decodable, Hash, HashStable)] pub enum NtExprKind { // Matches expressions using the post-edition 2024. Was written using // `expr` in edition 2024 or later. @@ -1112,7 +1112,7 @@ pub enum NtExprKind { } /// A macro nonterminal, known in documentation as a fragment specifier. -#[derive(Debug, Copy, Clone, PartialEq, Eq, Encodable, Decodable, Hash, HashStable_Generic)] +#[derive(Debug, Copy, Clone, PartialEq, Eq, Encodable, Decodable, Hash, HashStable)] pub enum NonterminalKind { Item, Block, diff --git a/compiler/rustc_ast/src/tokenstream.rs b/compiler/rustc_ast/src/tokenstream.rs index efd9b500ea0e..86a6d93dac35 100644 --- a/compiler/rustc_ast/src/tokenstream.rs +++ b/compiler/rustc_ast/src/tokenstream.rs @@ -12,7 +12,7 @@ use rustc_data_structures::stable_hasher::{HashStable, HashStableContext, StableHasher}; use rustc_data_structures::sync; -use rustc_macros::{Decodable, Encodable, HashStable_Generic, Walkable}; +use rustc_macros::{Decodable, Encodable, HashStable, Walkable}; use rustc_serialize::{Decodable, Encodable}; use rustc_span::{DUMMY_SP, Span, SpanDecoder, SpanEncoder, Symbol, sym}; use thin_vec::ThinVec; @@ -23,7 +23,7 @@ use crate::{AttrVec, Attribute}; /// Part of a `TokenStream`. -#[derive(Debug, Clone, PartialEq, Eq, Hash, Encodable, Decodable, HashStable_Generic)] +#[derive(Debug, Clone, PartialEq, Eq, Hash, Encodable, Decodable, HashStable)] pub enum TokenTree { /// A single token. Should never be `OpenDelim` or `CloseDelim`, because /// delimiters are implicitly represented by `Delimited`. @@ -545,7 +545,7 @@ pub struct AttrsTarget { /// compound token. Used for conversions to `proc_macro::Spacing`. Also used to /// guide pretty-printing, which is where the `JointHidden` value (which isn't /// part of `proc_macro::Spacing`) comes in useful. -#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, Encodable, Decodable, HashStable_Generic)] +#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, Encodable, Decodable, HashStable)] pub enum Spacing { /// The token cannot join with the following token to form a compound /// token. @@ -967,7 +967,7 @@ pub fn inlined_next(&mut self) -> (Token, Spacing) { } #[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] -#[derive(Encodable, Decodable, HashStable_Generic, Walkable)] +#[derive(Encodable, Decodable, HashStable, Walkable)] pub struct DelimSpan { pub open: Span, pub close: Span, @@ -991,7 +991,7 @@ pub fn entire(self) -> Span { } } -#[derive(Copy, Clone, Debug, PartialEq, Eq, Hash, Encodable, Decodable, HashStable_Generic)] +#[derive(Copy, Clone, Debug, PartialEq, Eq, Hash, Encodable, Decodable, HashStable)] pub struct DelimSpacing { pub open: Spacing, pub close: Spacing, diff --git a/compiler/rustc_error_messages/src/lib.rs b/compiler/rustc_error_messages/src/lib.rs index a1128f18043d..bbcda7bce217 100644 --- a/compiler/rustc_error_messages/src/lib.rs +++ b/compiler/rustc_error_messages/src/lib.rs @@ -7,7 +7,7 @@ pub use fluent_bundle::types::FluentType; pub use fluent_bundle::{self, FluentArgs, FluentError, FluentValue}; -use rustc_macros::{Decodable, Encodable, HashStable_Generic}; +use rustc_macros::{Decodable, Encodable, HashStable}; use rustc_span::Span; pub use unic_langid::{LanguageIdentifier, langid}; @@ -28,7 +28,7 @@ pub fn register_functions(bundle: &mut fluent_bundle::bundle::FluentBundle /// diagnostic messages. /// /// Intended to be removed once diagnostics are entirely translatable. -#[derive(Clone, Debug, PartialEq, Eq, Hash, Encodable, Decodable, HashStable_Generic)] +#[derive(Clone, Debug, PartialEq, Eq, Hash, Encodable, Decodable, HashStable)] #[rustc_diagnostic_item = "DiagMessage"] pub enum DiagMessage { /// Non-translatable diagnostic message or a message that has been translated eagerly. @@ -89,7 +89,7 @@ pub struct SpanLabel { /// the error, and would be rendered with `^^^`. /// - They can have a *label*. In this case, the label is written next /// to the mark in the snippet when we render. -#[derive(Clone, Debug, Hash, PartialEq, Eq, Encodable, Decodable, HashStable_Generic)] +#[derive(Clone, Debug, Hash, PartialEq, Eq, Encodable, Decodable, HashStable)] pub struct MultiSpan { primary_spans: Vec, span_labels: Vec<(Span, DiagMessage)>, diff --git a/compiler/rustc_hir/src/attrs/data_structures.rs b/compiler/rustc_hir/src/attrs/data_structures.rs index bab86a25e3cb..556eb428a1b8 100644 --- a/compiler/rustc_hir/src/attrs/data_structures.rs +++ b/compiler/rustc_hir/src/attrs/data_structures.rs @@ -12,7 +12,7 @@ use rustc_data_structures::fx::FxIndexMap; use rustc_error_messages::{DiagArgValue, IntoDiagArg}; use rustc_hir::LangItem; -use rustc_macros::{Decodable, Encodable, HashStable_Generic, PrintAttribute}; +use rustc_macros::{Decodable, Encodable, HashStable, PrintAttribute}; use rustc_span::def_id::DefId; use rustc_span::hygiene::Transparency; use rustc_span::{ErrorGuaranteed, Ident, Span, Symbol}; @@ -24,7 +24,7 @@ use crate::limit::Limit; use crate::{DefaultBodyStability, PartialConstStability, RustcVersion, Stability}; -#[derive(Copy, Clone, Debug, HashStable_Generic, Encodable, Decodable, PrintAttribute)] +#[derive(Copy, Clone, Debug, HashStable, Encodable, Decodable, PrintAttribute)] pub enum EiiImplResolution { /// Usually, finding the extern item that an EII implementation implements means finding /// the defid of the associated attribute macro, and looking at *its* attributes to find @@ -37,7 +37,7 @@ pub enum EiiImplResolution { Error(ErrorGuaranteed), } -#[derive(Copy, Clone, Debug, HashStable_Generic, Encodable, Decodable, PrintAttribute)] +#[derive(Copy, Clone, Debug, HashStable, Encodable, Decodable, PrintAttribute)] pub struct EiiImpl { pub resolution: EiiImplResolution, pub impl_marked_unsafe: bool, @@ -46,7 +46,7 @@ pub struct EiiImpl { pub is_default: bool, } -#[derive(Copy, Clone, Debug, HashStable_Generic, Encodable, Decodable, PrintAttribute)] +#[derive(Copy, Clone, Debug, HashStable, Encodable, Decodable, PrintAttribute)] pub struct EiiDecl { pub foreign_item: DefId, /// whether or not it is unsafe to implement this EII @@ -54,7 +54,7 @@ pub struct EiiDecl { pub name: Ident, } -#[derive(Copy, Clone, PartialEq, Encodable, Decodable, Debug, HashStable_Generic, PrintAttribute)] +#[derive(Copy, Clone, PartialEq, Encodable, Decodable, Debug, HashStable, PrintAttribute)] pub enum CguKind { No, PreDashLto, @@ -62,7 +62,7 @@ pub enum CguKind { Any, } -#[derive(Copy, Clone, PartialEq, Encodable, Decodable, Debug, HashStable_Generic, PrintAttribute)] +#[derive(Copy, Clone, PartialEq, Encodable, Decodable, Debug, HashStable, PrintAttribute)] pub enum CguFields { PartitionReused { cfg: Symbol, module: Symbol }, PartitionCodegened { cfg: Symbol, module: Symbol }, @@ -70,7 +70,7 @@ pub enum CguFields { } #[derive(Copy, Clone, PartialEq, Debug, PrintAttribute)] -#[derive(HashStable_Generic, Encodable, Decodable)] +#[derive(HashStable, Encodable, Decodable)] pub enum DivergingFallbackBehavior { /// Always fallback to `()` (aka "always spontaneous decay") ToUnit, @@ -82,7 +82,7 @@ pub enum DivergingFallbackBehavior { } #[derive(Copy, Clone, PartialEq, Debug, PrintAttribute, Default)] -#[derive(HashStable_Generic, Encodable, Decodable)] +#[derive(HashStable, Encodable, Decodable)] pub enum DivergingBlockBehavior { /// This is the current stable behavior: /// @@ -105,7 +105,7 @@ pub enum DivergingBlockBehavior { Unit, } -#[derive(Copy, Clone, PartialEq, Encodable, Decodable, Debug, HashStable_Generic, PrintAttribute)] +#[derive(Copy, Clone, PartialEq, Encodable, Decodable, Debug, HashStable, PrintAttribute)] pub enum InlineAttr { None, Hint, @@ -129,24 +129,14 @@ pub fn always(&self) -> bool { } } -#[derive( - Copy, - Clone, - Encodable, - Decodable, - Debug, - PartialEq, - Eq, - HashStable_Generic, - PrintAttribute -)] +#[derive(Copy, Clone, Encodable, Decodable, Debug, PartialEq, Eq, HashStable, PrintAttribute)] pub enum InstructionSetAttr { ArmA32, ArmT32, } #[derive(Copy, Clone, Debug, PartialEq, Eq, Default, PrintAttribute)] -#[derive(Encodable, Decodable, HashStable_Generic)] +#[derive(Encodable, Decodable, HashStable)] pub enum OptimizeAttr { /// No `#[optimize(..)]` attribute #[default] @@ -165,7 +155,7 @@ pub fn do_not_optimize(&self) -> bool { } } -#[derive(PartialEq, Debug, Encodable, Decodable, Copy, Clone, HashStable_Generic, PrintAttribute)] +#[derive(PartialEq, Debug, Encodable, Decodable, Copy, Clone, HashStable, PrintAttribute)] pub enum ReprAttr { ReprInt(IntType), ReprRust, @@ -182,13 +172,13 @@ pub enum TransparencyError { } #[derive(Eq, PartialEq, Debug, Copy, Clone)] -#[derive(Encodable, Decodable, HashStable_Generic, PrintAttribute)] +#[derive(Encodable, Decodable, HashStable, PrintAttribute)] pub enum IntType { SignedInt(ast::IntTy), UnsignedInt(ast::UintTy), } -#[derive(Copy, Debug, Encodable, Decodable, Clone, HashStable_Generic, PrintAttribute)] +#[derive(Copy, Debug, Encodable, Decodable, Clone, HashStable, PrintAttribute)] pub struct Deprecation { pub since: DeprecatedSince, /// The note to issue a reason. @@ -200,7 +190,7 @@ pub struct Deprecation { } /// Release in which an API is deprecated. -#[derive(Copy, Debug, Encodable, Decodable, Clone, HashStable_Generic, PrintAttribute)] +#[derive(Copy, Debug, Encodable, Decodable, Clone, HashStable, PrintAttribute)] pub enum DeprecatedSince { RustcVersion(RustcVersion), /// Deprecated in the future ("to be determined"). @@ -217,7 +207,7 @@ pub enum DeprecatedSince { /// Successfully-parsed value of a `#[coverage(..)]` attribute. #[derive(Copy, Debug, Eq, PartialEq, Encodable, Decodable, Clone)] -#[derive(HashStable_Generic, PrintAttribute)] +#[derive(HashStable, PrintAttribute)] pub enum CoverageAttrKind { On, Off, @@ -225,7 +215,7 @@ pub enum CoverageAttrKind { /// Successfully-parsed value of a `#[rustc_abi(..)]` attribute. #[derive(Copy, Debug, Eq, PartialEq, Encodable, Decodable, Clone)] -#[derive(HashStable_Generic, PrintAttribute)] +#[derive(HashStable, PrintAttribute)] pub enum RustcAbiAttrKind { Debug, AssertEq, @@ -256,7 +246,7 @@ pub fn is_since_rustc_version(&self) -> bool { /// `#[used(compiler)]` /// `#[used(linker)]` #[derive(Encodable, Decodable, Copy, Clone, Debug, PartialEq, Eq, Hash)] -#[derive(HashStable_Generic, PrintAttribute)] +#[derive(HashStable, PrintAttribute)] pub enum UsedBy { Default, Compiler, @@ -264,7 +254,7 @@ pub enum UsedBy { } #[derive(Encodable, Decodable, Clone, Debug, PartialEq, Eq, Hash)] -#[derive(HashStable_Generic, PrintAttribute)] +#[derive(HashStable, PrintAttribute)] pub enum MacroUseArgs { UseAll, UseSpecific(ThinVec), @@ -276,7 +266,7 @@ fn default() -> Self { } } -#[derive(Debug, Clone, Encodable, Decodable, HashStable_Generic)] +#[derive(Debug, Clone, Encodable, Decodable, HashStable)] pub struct StrippedCfgItem { pub parent_scope: ScopeId, pub ident: Ident, @@ -294,7 +284,7 @@ pub fn map_scope_id(self, f: impl FnOnce(ScopeId) -> New) -> StrippedCfgIte /// /// See for more details about these variants. #[derive(Encodable, Decodable, Clone, Copy, Debug, PartialEq, Eq, Hash)] -#[derive(HashStable_Generic, PrintAttribute)] +#[derive(HashStable, PrintAttribute)] pub enum Linkage { AvailableExternally, Common, @@ -308,7 +298,7 @@ pub enum Linkage { } #[derive(Clone, Copy, Decodable, Debug, Encodable, PartialEq)] -#[derive(HashStable_Generic, PrintAttribute)] +#[derive(HashStable, PrintAttribute)] pub enum MirDialect { Analysis, Built, @@ -327,7 +317,7 @@ fn into_diag_arg(self, _path: &mut Option) -> DiagArgValue { } #[derive(Clone, Copy, Decodable, Debug, Encodable, PartialEq)] -#[derive(HashStable_Generic, PrintAttribute)] +#[derive(HashStable, PrintAttribute)] pub enum MirPhase { Initial, PostCleanup, @@ -347,17 +337,7 @@ fn into_diag_arg(self, _path: &mut Option) -> DiagArgValue { /// Different ways that the PE Format can decorate a symbol name. /// From -#[derive( - Copy, - Clone, - Debug, - Encodable, - Decodable, - HashStable_Generic, - PartialEq, - Eq, - PrintAttribute -)] +#[derive(Copy, Clone, Debug, Encodable, Decodable, HashStable, PartialEq, Eq, PrintAttribute)] pub enum PeImportNameType { /// IMPORT_ORDINAL /// Uses the ordinal (i.e., a number) rather than the name. @@ -387,7 +367,7 @@ pub enum PeImportNameType { Decodable, PrintAttribute )] -#[derive(HashStable_Generic)] +#[derive(HashStable)] pub enum NativeLibKind { /// Static library (e.g. `libfoo.a` on Linux or `foo.lib` on Windows/MSVC) Static { @@ -455,7 +435,7 @@ pub fn is_dllimport(&self) -> bool { } } -#[derive(Debug, Encodable, Decodable, Clone, HashStable_Generic, PrintAttribute)] +#[derive(Debug, Encodable, Decodable, Clone, HashStable, PrintAttribute)] pub struct LinkEntry { pub span: Span, pub kind: NativeLibKind, @@ -465,14 +445,14 @@ pub struct LinkEntry { pub import_name_type: Option<(PeImportNameType, Span)>, } -#[derive(HashStable_Generic, PrintAttribute)] +#[derive(HashStable, PrintAttribute)] #[derive(Copy, PartialEq, PartialOrd, Clone, Ord, Eq, Hash, Debug, Encodable, Decodable)] pub enum DebuggerVisualizerType { Natvis, GdbPrettyPrinter, } -#[derive(Debug, Encodable, Decodable, Clone, HashStable_Generic, PrintAttribute)] +#[derive(Debug, Encodable, Decodable, Clone, HashStable, PrintAttribute)] pub struct DebugVisualizer { pub span: Span, pub visualizer_type: DebuggerVisualizerType, @@ -480,7 +460,7 @@ pub struct DebugVisualizer { } #[derive(Clone, Copy, Debug, Decodable, Encodable, Eq, PartialEq)] -#[derive(HashStable_Generic, PrintAttribute)] +#[derive(HashStable, PrintAttribute)] #[derive_const(Default)] pub enum RtsanSetting { Nonblocking, @@ -490,7 +470,7 @@ pub enum RtsanSetting { } #[derive(Eq, PartialEq, Debug, Copy, Clone)] -#[derive(Encodable, Decodable, HashStable_Generic, PrintAttribute)] +#[derive(Encodable, Decodable, HashStable, PrintAttribute)] pub enum WindowsSubsystemKind { Console, Windows, @@ -506,20 +486,20 @@ pub fn as_str(&self) -> &'static str { } #[derive(Copy, Clone, Debug, PartialEq)] -#[derive(HashStable_Generic, Encodable, Decodable, PrintAttribute)] +#[derive(HashStable, Encodable, Decodable, PrintAttribute)] pub enum DocInline { Inline, NoInline, } #[derive(Copy, Clone, Debug, PartialEq)] -#[derive(HashStable_Generic, Encodable, Decodable, PrintAttribute)] +#[derive(HashStable, Encodable, Decodable, PrintAttribute)] pub enum HideOrShow { Hide, Show, } -#[derive(Clone, Debug, HashStable_Generic, Encodable, Decodable, PrintAttribute)] +#[derive(Clone, Debug, HashStable, Encodable, Decodable, PrintAttribute)] pub struct CfgInfo { pub name: Symbol, pub name_span: Span, @@ -536,13 +516,13 @@ pub fn span_for_name_and_value(&self) -> Span { } } -#[derive(Clone, Debug, HashStable_Generic, Encodable, Decodable, PrintAttribute)] +#[derive(Clone, Debug, HashStable, Encodable, Decodable, PrintAttribute)] pub struct CfgHideShow { pub kind: HideOrShow, pub values: ThinVec, } -#[derive(Clone, Debug, Default, HashStable_Generic, Decodable, PrintAttribute)] +#[derive(Clone, Debug, Default, HashStable, Decodable, PrintAttribute)] pub struct DocAttribute { pub first_span: Span, @@ -646,7 +626,7 @@ fn encode(&self, encoder: &mut E) { /// | external | no | if-ext | if-ext | yes | /// | yes | yes | yes | yes | yes | #[derive(Copy, Clone, Debug, Hash, PartialEq)] -#[derive(HashStable_Generic, Encodable, Decodable, PrintAttribute)] +#[derive(HashStable, Encodable, Decodable, PrintAttribute)] pub enum CollapseMacroDebuginfo { /// Don't collapse debuginfo for the macro No = 0, @@ -660,7 +640,7 @@ pub enum CollapseMacroDebuginfo { /// Crate type, as specified by `#![crate_type]` #[derive(Copy, Clone, Debug, Hash, PartialEq, Default, PartialOrd, Eq, Ord)] -#[derive(HashStable_Generic, Encodable, Decodable, PrintAttribute)] +#[derive(HashStable, Encodable, Decodable, PrintAttribute)] pub enum CrateType { /// `#![crate_type = "bin"]` Executable, @@ -760,7 +740,7 @@ fn into_diag_arg(self, _: &mut Option) -> DiagArgValue { } } -#[derive(Clone, Debug, HashStable_Generic, Encodable, Decodable, PrintAttribute)] +#[derive(Clone, Debug, HashStable, Encodable, Decodable, PrintAttribute)] pub enum RustcDumpLayoutKind { Align, BackendRepr, @@ -769,7 +749,7 @@ pub enum RustcDumpLayoutKind { Size, } -#[derive(Clone, Debug, HashStable_Generic, Encodable, Decodable, PrintAttribute, PartialEq, Eq)] +#[derive(Clone, Debug, HashStable, Encodable, Decodable, PrintAttribute, PartialEq, Eq)] pub enum RustcMirKind { PeekMaybeInit, PeekMaybeUninit, @@ -779,13 +759,13 @@ pub enum RustcMirKind { BorrowckGraphvizFormat { format: BorrowckGraphvizFormatKind }, } -#[derive(Clone, Debug, HashStable_Generic, Encodable, Decodable, PrintAttribute, PartialEq, Eq)] +#[derive(Clone, Debug, HashStable, Encodable, Decodable, PrintAttribute, PartialEq, Eq)] pub enum BorrowckGraphvizFormatKind { TwoPhase, } #[derive(Clone, Debug, PartialEq, Eq)] -#[derive(HashStable_Generic, Encodable, Decodable, PrintAttribute)] +#[derive(HashStable, Encodable, Decodable, PrintAttribute)] pub struct RustcCleanAttribute { pub span: Span, pub cfg: Symbol, @@ -795,14 +775,14 @@ pub struct RustcCleanAttribute { /// Represents the `except=` or `loaded_from_disk=` argument of `#[rustc_clean]` #[derive(Clone, Debug, PartialEq, Eq)] -#[derive(HashStable_Generic, Encodable, Decodable, PrintAttribute)] +#[derive(HashStable, Encodable, Decodable, PrintAttribute)] pub struct RustcCleanQueries { pub entries: ThinVec, pub span: Span, } #[derive(Clone, Debug, PartialEq, Eq)] -#[derive(HashStable_Generic, Encodable, Decodable, PrintAttribute)] +#[derive(HashStable, Encodable, Decodable, PrintAttribute)] pub struct RustcAutodiff { /// Conceptually either forward or reverse mode AD, as described in various autodiff papers and /// e.g. in the [JAX @@ -878,7 +858,7 @@ pub fn into_item( } /// We generate one of these structs for each `#[autodiff(...)]` attribute. -#[derive(Clone, Eq, PartialEq, Encodable, Decodable, Debug, HashStable_Generic)] +#[derive(Clone, Eq, PartialEq, Encodable, Decodable, Debug, HashStable)] pub struct AutoDiffItem { /// The name of the function getting differentiated pub source: String, @@ -898,7 +878,7 @@ fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { } } -#[derive(Clone, Debug, HashStable_Generic, Encodable, Decodable, PrintAttribute)] +#[derive(Clone, Debug, HashStable, Encodable, Decodable, PrintAttribute)] pub struct UnstableRemovedFeature { pub feature: Symbol, pub reason: Symbol, @@ -955,7 +935,7 @@ pub struct UnstableRemovedFeature { /// [`rustc_parse`]: https://doc.rust-lang.org/nightly/nightly-rustc/rustc_parse/index.html /// [`rustc_codegen_ssa`]: https://doc.rust-lang.org/nightly/nightly-rustc/rustc_codegen_ssa/index.html /// [`rustc_attr_parsing`]: https://doc.rust-lang.org/nightly/nightly-rustc/rustc_attr_parsing/index.html -#[derive(Clone, Debug, HashStable_Generic, Encodable, Decodable, PrintAttribute)] +#[derive(Clone, Debug, HashStable, Encodable, Decodable, PrintAttribute)] pub enum AttributeKind { // tidy-alphabetical-start /// Represents `#[allow_internal_unsafe]`. diff --git a/compiler/rustc_hir/src/attrs/diagnostic.rs b/compiler/rustc_hir/src/attrs/diagnostic.rs index 2beafee54541..9d38125c678b 100644 --- a/compiler/rustc_hir/src/attrs/diagnostic.rs +++ b/compiler/rustc_hir/src/attrs/diagnostic.rs @@ -3,14 +3,14 @@ use std::fmt::Debug; pub use rustc_ast::attr::data_structures::*; -use rustc_macros::{Decodable, Encodable, HashStable_Generic, PrintAttribute}; +use rustc_macros::{Decodable, Encodable, HashStable, PrintAttribute}; use rustc_span::{DesugaringKind, Span, Symbol, kw}; use thin_vec::ThinVec; use tracing::debug; use crate::attrs::PrintAttribute; -#[derive(Clone, Default, Debug, HashStable_Generic, Encodable, Decodable, PrintAttribute)] +#[derive(Clone, Default, Debug, HashStable, Encodable, Decodable, PrintAttribute)] pub struct Directive { pub is_rustc_attr: bool, pub condition: Option, @@ -123,7 +123,7 @@ pub struct CustomDiagnostic { /// Like [std::fmt::Arguments] this is a string that has been parsed into "pieces", /// either as string pieces or dynamic arguments. -#[derive(Clone, Debug, HashStable_Generic, Encodable, Decodable, PrintAttribute)] +#[derive(Clone, Debug, HashStable, Encodable, Decodable, PrintAttribute)] pub struct FormatString { pub input: Symbol, pub span: Span, @@ -225,13 +225,13 @@ pub struct FormatArgs { pub generic_args: Vec<(Symbol, String)> = Vec::new(), } -#[derive(Clone, Debug, HashStable_Generic, Encodable, Decodable, PrintAttribute)] +#[derive(Clone, Debug, HashStable, Encodable, Decodable, PrintAttribute)] pub enum Piece { Lit(Symbol), Arg(FormatArg), } -#[derive(Clone, Debug, HashStable_Generic, Encodable, Decodable, PrintAttribute)] +#[derive(Clone, Debug, HashStable, Encodable, Decodable, PrintAttribute)] pub enum FormatArg { // A generic parameter, like `{T}` if we're on the `From` trait. GenericParam { @@ -251,7 +251,7 @@ pub enum FormatArg { } /// Represents the `on` filter in `#[rustc_on_unimplemented]`. -#[derive(Clone, Debug, HashStable_Generic, Encodable, Decodable, PrintAttribute)] +#[derive(Clone, Debug, HashStable, Encodable, Decodable, PrintAttribute)] pub struct OnUnimplementedCondition { pub span: Span, pub pred: Predicate, @@ -276,7 +276,7 @@ pub fn visit_params(&self, visit: &mut impl FnMut(Symbol, Span)) { /// /// It is similar to the predicate in the `cfg` attribute, /// and may contain nested predicates. -#[derive(Clone, Debug, HashStable_Generic, Encodable, Decodable, PrintAttribute)] +#[derive(Clone, Debug, HashStable, Encodable, Decodable, PrintAttribute)] pub enum Predicate { /// A condition like `on(crate_local)`. Flag(Flag), @@ -314,7 +314,7 @@ pub fn visit_params(&self, span: Span, visit: &mut impl FnMut(Symbol, Span)) { } /// Represents a `MetaWord` in an `on`-filter. -#[derive(Clone, Copy, Debug, HashStable_Generic, Encodable, Decodable, PrintAttribute)] +#[derive(Clone, Copy, Debug, HashStable, Encodable, Decodable, PrintAttribute)] pub enum Flag { /// Whether the code causing the trait bound to not be fulfilled /// is part of the user's crate. @@ -329,7 +329,7 @@ pub enum Flag { /// A `MetaNameValueStr` in an `on`-filter. /// /// For example, `#[rustc_on_unimplemented(on(name = "value", message = "hello"))]`. -#[derive(Clone, Debug, HashStable_Generic, Encodable, Decodable, PrintAttribute)] +#[derive(Clone, Debug, HashStable, Encodable, Decodable, PrintAttribute)] pub struct NameValue { pub name: Name, /// Something like `"&str"` or `"alloc::string::String"`, @@ -348,7 +348,7 @@ pub fn visit_params(&self, span: Span, visit: &mut impl FnMut(Symbol, Span)) { } /// The valid names of the `on` filter. -#[derive(Clone, Copy, Debug, HashStable_Generic, Encodable, Decodable, PrintAttribute)] +#[derive(Clone, Copy, Debug, HashStable, Encodable, Decodable, PrintAttribute)] pub enum Name { Cause, FromDesugaring, @@ -368,7 +368,7 @@ pub enum FlagOrNv<'p> { /// If it is a simple literal like this then `pieces` will be `[LitOrArg::Lit("value")]`. /// The `Arg` variant is used when it contains formatting like /// `#[rustc_on_unimplemented(on(Self = "&[{A}]", message = "hello"))]`. -#[derive(Clone, Debug, HashStable_Generic, Encodable, Decodable, PrintAttribute)] +#[derive(Clone, Debug, HashStable, Encodable, Decodable, PrintAttribute)] pub struct FilterFormatString { pub pieces: ThinVec, } @@ -400,7 +400,7 @@ pub fn visit_params(&self, span: Span, visit: &mut impl FnMut(Symbol, Span)) { } } -#[derive(Clone, Debug, HashStable_Generic, Encodable, Decodable, PrintAttribute)] +#[derive(Clone, Debug, HashStable, Encodable, Decodable, PrintAttribute)] pub enum LitOrArg { Lit(Symbol), Arg(Symbol), diff --git a/compiler/rustc_hir/src/def.rs b/compiler/rustc_hir/src/def.rs index 608835dfbe91..863e066f845f 100644 --- a/compiler/rustc_hir/src/def.rs +++ b/compiler/rustc_hir/src/def.rs @@ -7,7 +7,7 @@ use rustc_data_structures::stable_hasher::ToStableHashKey; use rustc_data_structures::unord::UnordMap; use rustc_error_messages::{DiagArgValue, IntoDiagArg}; -use rustc_macros::{Decodable, Encodable, HashStable_Generic}; +use rustc_macros::{Decodable, Encodable, HashStable}; use rustc_span::Symbol; use rustc_span::def_id::{DefId, LocalDefId}; use rustc_span::hygiene::MacroKind; @@ -16,7 +16,7 @@ use crate::hir; /// Encodes if a `DefKind::Ctor` is the constructor of an enum variant or a struct. -#[derive(Clone, Copy, PartialEq, Eq, Encodable, Decodable, Hash, Debug, HashStable_Generic)] +#[derive(Clone, Copy, PartialEq, Eq, Encodable, Decodable, Hash, Debug, HashStable)] pub enum CtorOf { /// This `DefKind::Ctor` is a synthesized constructor of a tuple or unit struct. Struct, @@ -25,7 +25,7 @@ pub enum CtorOf { } /// What kind of constructor something is. -#[derive(Clone, Copy, PartialEq, Eq, Encodable, Decodable, Hash, Debug, HashStable_Generic)] +#[derive(Clone, Copy, PartialEq, Eq, Encodable, Decodable, Hash, Debug, HashStable)] pub enum CtorKind { /// Constructor function automatically created by a tuple struct/variant. Fn, @@ -35,7 +35,7 @@ pub enum CtorKind { /// A set of macro kinds, for macros that can have more than one kind #[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Encodable, Decodable, Hash, Debug)] -#[derive(HashStable_Generic)] +#[derive(HashStable)] pub struct MacroKinds(u8); bitflags::bitflags! { impl MacroKinds: u8 { @@ -81,7 +81,7 @@ pub fn article(self) -> &'static str { } /// An attribute that is not a macro; e.g., `#[inline]` or `#[rustfmt::skip]`. -#[derive(Clone, Copy, PartialEq, Eq, Encodable, Decodable, Hash, Debug, HashStable_Generic)] +#[derive(Clone, Copy, PartialEq, Eq, Encodable, Decodable, Hash, Debug, HashStable)] pub enum NonMacroAttrKind { /// Single-segment attribute defined by the language (`#[inline]`) Builtin(Symbol), @@ -96,7 +96,7 @@ pub enum NonMacroAttrKind { /// What kind of definition something is; e.g., `mod` vs `struct`. /// `enum DefPathData` may need to be updated if a new variant is added here. -#[derive(Clone, Copy, PartialEq, Eq, Encodable, Decodable, Hash, Debug, HashStable_Generic)] +#[derive(Clone, Copy, PartialEq, Eq, Encodable, Decodable, Hash, Debug, HashStable)] pub enum DefKind { // Type namespace Mod, @@ -511,7 +511,7 @@ pub fn is_typeck_child(self) -> bool { /// - the call to `str_to_string` will resolve to [`Res::Def`], with the [`DefId`] /// pointing to the definition of `str_to_string` in the current crate. // -#[derive(Clone, Copy, PartialEq, Eq, Encodable, Decodable, Hash, Debug, HashStable_Generic)] +#[derive(Clone, Copy, PartialEq, Eq, Encodable, Decodable, Hash, Debug, HashStable)] pub enum Res { /// Definition having a unique ID (`DefId`), corresponds to something defined in user code. /// @@ -679,7 +679,7 @@ pub fn expect_full_res(&self) -> Res { /// Different kinds of symbols can coexist even if they share the same textual name. /// Therefore, they each have a separate universe (known as a "namespace"). #[derive(Copy, Clone, PartialEq, Eq, PartialOrd, Ord, Hash, Debug, Encodable, Decodable)] -#[derive(HashStable_Generic)] +#[derive(HashStable)] pub enum Namespace { /// The type namespace includes `struct`s, `enum`s, `union`s, `trait`s, and `mod`s /// (and, by extension, crates). @@ -722,7 +722,7 @@ fn to_stable_hash_key(&self, _: &mut Hcx) -> Namespace { } /// Just a helper ‒ separate structure for each namespace. -#[derive(Copy, Clone, Default, Debug, HashStable_Generic)] +#[derive(Copy, Clone, Default, Debug, HashStable)] pub struct PerNS { pub value_ns: T, pub type_ns: T, diff --git a/compiler/rustc_hir/src/diagnostic_items.rs b/compiler/rustc_hir/src/diagnostic_items.rs index 5e0915de9d38..c19aeec65979 100644 --- a/compiler/rustc_hir/src/diagnostic_items.rs +++ b/compiler/rustc_hir/src/diagnostic_items.rs @@ -1,11 +1,11 @@ use rustc_data_structures::fx::FxIndexMap; -use rustc_macros::HashStable_Generic; +use rustc_macros::HashStable; use rustc_span::Symbol; use rustc_span::def_id::DefIdMap; use crate::def_id::DefId; -#[derive(Debug, Default, HashStable_Generic)] +#[derive(Debug, Default, HashStable)] pub struct DiagnosticItems { #[stable_hasher(ignore)] pub id_to_name: DefIdMap, diff --git a/compiler/rustc_hir/src/hir.rs b/compiler/rustc_hir/src/hir.rs index 1da7a4fb0aa0..102f373a5e31 100644 --- a/compiler/rustc_hir/src/hir.rs +++ b/compiler/rustc_hir/src/hir.rs @@ -21,7 +21,7 @@ use rustc_data_structures::tagged_ptr::TaggedRef; use rustc_error_messages::{DiagArgValue, IntoDiagArg}; use rustc_index::IndexVec; -use rustc_macros::{Decodable, Encodable, HashStable_Generic}; +use rustc_macros::{Decodable, Encodable, HashStable}; use rustc_span::def_id::LocalDefId; use rustc_span::{ BytePos, DUMMY_SP, DesugaringKind, ErrorGuaranteed, Ident, Span, Spanned, Symbol, kw, sym, @@ -38,7 +38,7 @@ use crate::intravisit::{FnKind, VisitorExt}; use crate::lints::DelayedLints; -#[derive(Debug, Copy, Clone, PartialEq, Eq, HashStable_Generic)] +#[derive(Debug, Copy, Clone, PartialEq, Eq, HashStable)] pub enum AngleBrackets { /// E.g. `Path`. Missing, @@ -48,7 +48,7 @@ pub enum AngleBrackets { Full, } -#[derive(Debug, Copy, Clone, PartialEq, Eq, HashStable_Generic)] +#[derive(Debug, Copy, Clone, PartialEq, Eq, HashStable)] pub enum LifetimeSource { /// E.g. `&Type`, `&'_ Type`, `&'a Type`, `&mut Type`, `&'_ mut Type`, `&'a mut Type` Reference, @@ -72,7 +72,7 @@ pub enum LifetimeSource { Other, } -#[derive(Debug, Copy, Clone, PartialEq, Eq, HashStable_Generic)] +#[derive(Debug, Copy, Clone, PartialEq, Eq, HashStable)] pub enum LifetimeSyntax { /// E.g. `&Type`, `ContainsLifetime` Implicit, @@ -149,7 +149,7 @@ fn from(ident: Ident) -> Self { /// Some combinations that cannot occur are `LifetimeSyntax::Implicit` with /// `LifetimeSource::OutlivesBound` or `LifetimeSource::PreciseCapturing` /// — there's no way to "elide" these lifetimes. -#[derive(Debug, Copy, Clone, HashStable_Generic)] +#[derive(Debug, Copy, Clone, HashStable)] // Raise the alignment to at least 4 bytes. // This is relied on in other parts of the compiler (for pointer tagging): // @@ -179,7 +179,7 @@ pub struct Lifetime { pub syntax: LifetimeSyntax, } -#[derive(Debug, Copy, Clone, HashStable_Generic)] +#[derive(Debug, Copy, Clone, HashStable)] pub enum ParamName { /// Some user-given name like `T` or `'x`. Plain(Ident), @@ -217,7 +217,7 @@ pub fn ident(&self) -> Ident { } } -#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash, HashStable_Generic)] +#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash, HashStable)] pub enum LifetimeKind { /// User-given names or fresh (synthetic) names. Param(LocalDefId), @@ -344,7 +344,7 @@ pub fn suggestion(&self, new_lifetime: &str) -> (Span, String) { /// A `Path` is essentially Rust's notion of a name; for instance, /// `std::cmp::PartialEq`. It's represented as a sequence of identifiers, /// along with a bunch of supporting information. -#[derive(Debug, Clone, Copy, HashStable_Generic)] +#[derive(Debug, Clone, Copy, HashStable)] pub struct Path<'hir, R = Res> { pub span: Span, /// The resolution for the path. @@ -364,7 +364,7 @@ pub fn is_global(&self) -> bool { /// A segment of a path: an identifier, an optional lifetime, and a set of /// types. -#[derive(Debug, Clone, Copy, HashStable_Generic)] +#[derive(Debug, Clone, Copy, HashStable)] pub struct PathSegment<'hir> { /// The identifier portion of this path segment. pub ident: Ident, @@ -401,7 +401,7 @@ pub fn args(&self) -> &GenericArgs<'hir> { } } -#[derive(Clone, Copy, Debug, HashStable_Generic)] +#[derive(Clone, Copy, Debug, HashStable)] pub enum ConstItemRhs<'hir> { Body(BodyId), TypeConst(&'hir ConstArg<'hir>), @@ -436,7 +436,7 @@ pub fn span<'tcx>(&self, tcx: impl crate::intravisit::HirTyCtxt<'tcx>) -> Span { /// /// For an explanation of the `Unambig` generic parameter see the dev-guide: /// -#[derive(Clone, Copy, Debug, HashStable_Generic)] +#[derive(Clone, Copy, Debug, HashStable)] #[repr(C)] pub struct ConstArg<'hir, Unambig = ()> { #[stable_hasher(ignore)] @@ -493,7 +493,7 @@ pub fn anon_const_hir_id(&self) -> Option { } /// See [`ConstArg`]. -#[derive(Clone, Copy, Debug, HashStable_Generic)] +#[derive(Clone, Copy, Debug, HashStable)] #[repr(u8, C)] pub enum ConstArgKind<'hir, Unambig = ()> { Tup(&'hir [&'hir ConstArg<'hir, Unambig>]), @@ -521,7 +521,7 @@ pub enum ConstArgKind<'hir, Unambig = ()> { }, } -#[derive(Clone, Copy, Debug, HashStable_Generic)] +#[derive(Clone, Copy, Debug, HashStable)] pub struct ConstArgExprField<'hir> { pub hir_id: HirId, pub span: Span, @@ -529,13 +529,13 @@ pub struct ConstArgExprField<'hir> { pub expr: &'hir ConstArg<'hir>, } -#[derive(Clone, Copy, Debug, HashStable_Generic)] +#[derive(Clone, Copy, Debug, HashStable)] pub struct ConstArgArrayExpr<'hir> { pub span: Span, pub elems: &'hir [&'hir ConstArg<'hir>], } -#[derive(Clone, Copy, Debug, HashStable_Generic)] +#[derive(Clone, Copy, Debug, HashStable)] pub struct InferArg { #[stable_hasher(ignore)] pub hir_id: HirId, @@ -548,7 +548,7 @@ pub fn to_ty(&self) -> Ty<'static> { } } -#[derive(Debug, Clone, Copy, HashStable_Generic)] +#[derive(Debug, Clone, Copy, HashStable)] pub enum GenericArg<'hir> { Lifetime(&'hir Lifetime), Type(&'hir Ty<'hir, AmbigArg>), @@ -611,7 +611,7 @@ pub fn is_ty_or_const(&self) -> bool { } /// The generic arguments and associated item constraints of a path segment. -#[derive(Debug, Clone, Copy, HashStable_Generic)] +#[derive(Debug, Clone, Copy, HashStable)] pub struct GenericArgs<'hir> { /// The generic arguments for this path segment. pub args: &'hir [GenericArg<'hir>], @@ -735,7 +735,7 @@ pub fn is_empty(&self) -> bool { } } -#[derive(Copy, Clone, PartialEq, Eq, Debug, HashStable_Generic)] +#[derive(Copy, Clone, PartialEq, Eq, Debug, HashStable)] pub enum GenericArgsParentheses { No, /// Bounds for `feature(return_type_notation)`, like `T: Trait`, @@ -746,7 +746,7 @@ pub enum GenericArgsParentheses { } /// The modifiers on a trait bound. -#[derive(Copy, Clone, PartialEq, Eq, Hash, Debug, HashStable_Generic)] +#[derive(Copy, Clone, PartialEq, Eq, Hash, Debug, HashStable)] pub struct TraitBoundModifiers { pub constness: BoundConstness, pub polarity: BoundPolarity, @@ -757,7 +757,7 @@ impl TraitBoundModifiers { TraitBoundModifiers { constness: BoundConstness::Never, polarity: BoundPolarity::Positive }; } -#[derive(Clone, Copy, Debug, HashStable_Generic)] +#[derive(Clone, Copy, Debug, HashStable)] pub enum GenericBound<'hir> { Trait(PolyTraitRef<'hir>), Outlives(&'hir Lifetime), @@ -783,7 +783,7 @@ pub fn span(&self) -> Span { pub type GenericBounds<'hir> = &'hir [GenericBound<'hir>]; -#[derive(Copy, Clone, PartialEq, Eq, PartialOrd, Ord, Hash, HashStable_Generic, Debug)] +#[derive(Copy, Clone, PartialEq, Eq, PartialOrd, Ord, Hash, HashStable, Debug)] pub enum MissingLifetimeKind { /// An explicit `'_`. Underscore, @@ -795,7 +795,7 @@ pub enum MissingLifetimeKind { Brackets, } -#[derive(Copy, Clone, Debug, HashStable_Generic)] +#[derive(Copy, Clone, Debug, HashStable)] pub enum LifetimeParamKind { // Indicates that the lifetime definition was explicitly declared (e.g., in // `fn foo<'a>(x: &'a u8) -> &'a u8 { x }`). @@ -809,7 +809,7 @@ pub enum LifetimeParamKind { Error, } -#[derive(Debug, Clone, Copy, HashStable_Generic)] +#[derive(Debug, Clone, Copy, HashStable)] pub enum GenericParamKind<'hir> { /// A lifetime definition (e.g., `'a: 'b + 'c + 'd`). Lifetime { @@ -826,7 +826,7 @@ pub enum GenericParamKind<'hir> { }, } -#[derive(Debug, Clone, Copy, HashStable_Generic)] +#[derive(Debug, Clone, Copy, HashStable)] pub struct GenericParam<'hir> { #[stable_hasher(ignore)] pub hir_id: HirId, @@ -865,7 +865,7 @@ pub fn is_lifetime(&self) -> bool { /// early-bound (but can be a late-bound lifetime in functions, for example), /// or from a `for<...>` binder, in which case it's late-bound (and notably, /// does not show up in the parent item's generics). -#[derive(Debug, Clone, Copy, HashStable_Generic)] +#[derive(Debug, Clone, Copy, HashStable)] pub enum GenericParamSource { // Early or late-bound parameters defined on an item Generics, @@ -883,7 +883,7 @@ pub struct GenericParamCount { /// Represents lifetimes and type parameters attached to a declaration /// of a function, enum, trait, etc. -#[derive(Debug, Clone, Copy, HashStable_Generic)] +#[derive(Debug, Clone, Copy, HashStable)] pub struct Generics<'hir> { pub params: &'hir [GenericParam<'hir>], pub predicates: &'hir [WherePredicate<'hir>], @@ -1090,7 +1090,7 @@ pub fn span_for_bound_removal(&self, predicate_pos: usize, bound_pos: usize) -> } /// A single predicate in a where-clause. -#[derive(Debug, Clone, Copy, HashStable_Generic)] +#[derive(Debug, Clone, Copy, HashStable)] pub struct WherePredicate<'hir> { #[stable_hasher(ignore)] pub hir_id: HirId, @@ -1099,7 +1099,7 @@ pub struct WherePredicate<'hir> { } /// The kind of a single predicate in a where-clause. -#[derive(Debug, Clone, Copy, HashStable_Generic)] +#[derive(Debug, Clone, Copy, HashStable)] pub enum WherePredicateKind<'hir> { /// A type bound (e.g., `for<'c> Foo: Send + Clone + 'c`). BoundPredicate(WhereBoundPredicate<'hir>), @@ -1127,7 +1127,7 @@ pub fn bounds(&self) -> GenericBounds<'hir> { } } -#[derive(Copy, Clone, Debug, HashStable_Generic, PartialEq, Eq)] +#[derive(Copy, Clone, Debug, HashStable, PartialEq, Eq)] pub enum PredicateOrigin { WhereClause, GenericParam, @@ -1135,7 +1135,7 @@ pub enum PredicateOrigin { } /// A type bound (e.g., `for<'c> Foo: Send + Clone + 'c`). -#[derive(Debug, Clone, Copy, HashStable_Generic)] +#[derive(Debug, Clone, Copy, HashStable)] pub struct WhereBoundPredicate<'hir> { /// Origin of the predicate. pub origin: PredicateOrigin, @@ -1155,7 +1155,7 @@ pub fn is_param_bound(&self, param_def_id: DefId) -> bool { } /// A lifetime predicate (e.g., `'a: 'b + 'c`). -#[derive(Debug, Clone, Copy, HashStable_Generic)] +#[derive(Debug, Clone, Copy, HashStable)] pub struct WhereRegionPredicate<'hir> { pub in_where_clause: bool, pub lifetime: &'hir Lifetime, @@ -1170,7 +1170,7 @@ fn is_param_bound(&self, param_def_id: LocalDefId) -> bool { } /// An equality predicate (e.g., `T = int`); currently unsupported. -#[derive(Debug, Clone, Copy, HashStable_Generic)] +#[derive(Debug, Clone, Copy, HashStable)] pub struct WhereEqPredicate<'hir> { pub lhs_ty: &'hir Ty<'hir>, pub rhs_ty: &'hir Ty<'hir>, @@ -1186,7 +1186,7 @@ pub struct ParentedNode<'tcx> { } /// Arguments passed to an attribute macro. -#[derive(Clone, Debug, HashStable_Generic, Encodable, Decodable)] +#[derive(Clone, Debug, HashStable, Encodable, Decodable)] pub enum AttrArgs { /// No arguments: `#[attr]`. Empty, @@ -1201,7 +1201,7 @@ pub enum AttrArgs { }, } -#[derive(Clone, Debug, HashStable_Generic, Encodable, Decodable)] +#[derive(Clone, Debug, HashStable, Encodable, Decodable)] pub struct AttrPath { pub segments: Box<[Symbol]>, pub span: Span, @@ -1237,7 +1237,7 @@ fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { } } -#[derive(Clone, Debug, HashStable_Generic, Encodable, Decodable)] +#[derive(Clone, Debug, HashStable, Encodable, Decodable)] pub struct AttrItem { // Not lowered to hir::Path because we have no NodeId to resolve to. pub path: AttrPath, @@ -1259,7 +1259,7 @@ pub struct HashIgnoredAttrId { /// Many functions on this type have their documentation in the [`AttributeExt`] trait, /// since they defer their implementation directly to that trait. -#[derive(Clone, Debug, Encodable, Decodable, HashStable_Generic)] +#[derive(Clone, Debug, Encodable, Decodable, HashStable)] pub enum Attribute { /// A parsed built-in attribute. /// @@ -1618,7 +1618,7 @@ fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { } /// Full information resulting from lowering an AST node. -#[derive(Debug, HashStable_Generic)] +#[derive(Debug, HashStable)] pub struct OwnerInfo<'hir> { /// Contents of the HIR. pub nodes: OwnerNodes<'hir>, @@ -1646,7 +1646,7 @@ pub fn node(&self) -> OwnerNode<'tcx> { } } -#[derive(Copy, Clone, Debug, HashStable_Generic)] +#[derive(Copy, Clone, Debug, HashStable)] pub enum MaybeOwner<'tcx> { Owner(&'tcx OwnerInfo<'tcx>), NonOwner(HirId), @@ -1667,7 +1667,7 @@ pub fn unwrap(self) -> &'tcx OwnerInfo<'tcx> { } } -#[derive(Debug, Clone, Copy, HashStable_Generic)] +#[derive(Debug, Clone, Copy, HashStable)] pub struct Closure<'hir> { pub def_id: LocalDefId, pub binder: ClosureBinder, @@ -1683,7 +1683,7 @@ pub struct Closure<'hir> { pub kind: ClosureKind, } -#[derive(Clone, PartialEq, Eq, Debug, Copy, Hash, HashStable_Generic, Encodable, Decodable)] +#[derive(Clone, PartialEq, Eq, Debug, Copy, Hash, HashStable, Encodable, Decodable)] pub enum ClosureKind { /// This is a plain closure expression. Closure, @@ -1702,7 +1702,7 @@ pub enum ClosureKind { /// A block of statements `{ .. }`, which may have a label (in this case the /// `targeted_by_break` field will be `true`) and may be `unsafe` by means of /// the `rules` being anything but `DefaultBlock`. -#[derive(Debug, Clone, Copy, HashStable_Generic)] +#[derive(Debug, Clone, Copy, HashStable)] pub struct Block<'hir> { /// Statements in a block. pub stmts: &'hir [Stmt<'hir>], @@ -1731,13 +1731,13 @@ pub fn innermost_block(&self) -> &Block<'hir> { } } -#[derive(Debug, Clone, Copy, HashStable_Generic)] +#[derive(Debug, Clone, Copy, HashStable)] pub struct TyFieldPath { pub variant: Option, pub field: Ident, } -#[derive(Debug, Clone, Copy, HashStable_Generic)] +#[derive(Debug, Clone, Copy, HashStable)] pub struct TyPat<'hir> { #[stable_hasher(ignore)] pub hir_id: HirId, @@ -1745,7 +1745,7 @@ pub struct TyPat<'hir> { pub span: Span, } -#[derive(Debug, Clone, Copy, HashStable_Generic)] +#[derive(Debug, Clone, Copy, HashStable)] pub struct Pat<'hir> { #[stable_hasher(ignore)] pub hir_id: HirId, @@ -1893,7 +1893,7 @@ pub fn is_guaranteed_to_constitute_read_for_never(&self) -> bool { /// Patterns like the fields of Foo `{ x, ref y, ref mut z }` /// are treated the same as` x: x, y: ref y, z: ref mut z`, /// except `is_shorthand` is true. -#[derive(Debug, Clone, Copy, HashStable_Generic)] +#[derive(Debug, Clone, Copy, HashStable)] pub struct PatField<'hir> { #[stable_hasher(ignore)] pub hir_id: HirId, @@ -1905,7 +1905,7 @@ pub struct PatField<'hir> { pub span: Span, } -#[derive(Copy, Clone, PartialEq, Debug, HashStable_Generic, Hash, Eq, Encodable, Decodable)] +#[derive(Copy, Clone, PartialEq, Debug, HashStable, Hash, Eq, Encodable, Decodable)] pub enum RangeEnd { Included, Excluded, @@ -1923,7 +1923,7 @@ fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { // Equivalent to `Option`. That type takes up 16 bytes on 64-bit, but // this type only takes up 4 bytes, at the cost of being restricted to a // maximum value of `u32::MAX - 1`. In practice, this is more than enough. -#[derive(Clone, Copy, PartialEq, Eq, Hash, HashStable_Generic)] +#[derive(Clone, Copy, PartialEq, Eq, Hash, HashStable)] pub struct DotDotPos(u32); impl DotDotPos { @@ -1949,7 +1949,7 @@ fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { } } -#[derive(Debug, Clone, Copy, HashStable_Generic)] +#[derive(Debug, Clone, Copy, HashStable)] pub struct PatExpr<'hir> { #[stable_hasher(ignore)] pub hir_id: HirId, @@ -1957,7 +1957,7 @@ pub struct PatExpr<'hir> { pub kind: PatExprKind<'hir>, } -#[derive(Debug, Clone, Copy, HashStable_Generic)] +#[derive(Debug, Clone, Copy, HashStable)] pub enum PatExprKind<'hir> { Lit { lit: Lit, @@ -1967,7 +1967,7 @@ pub enum PatExprKind<'hir> { Path(QPath<'hir>), } -#[derive(Debug, Clone, Copy, HashStable_Generic)] +#[derive(Debug, Clone, Copy, HashStable)] pub enum TyPatKind<'hir> { /// A range pattern (e.g., `1..=2` or `1..2`). Range(&'hir ConstArg<'hir>, &'hir ConstArg<'hir>), @@ -1982,7 +1982,7 @@ pub enum TyPatKind<'hir> { Err(ErrorGuaranteed), } -#[derive(Debug, Clone, Copy, HashStable_Generic)] +#[derive(Debug, Clone, Copy, HashStable)] pub enum PatKind<'hir> { /// A missing pattern, e.g. for an anonymous param in a bare fn like `fn f(u32)`. Missing, @@ -2057,7 +2057,7 @@ pub enum PatKind<'hir> { } /// A statement. -#[derive(Debug, Clone, Copy, HashStable_Generic)] +#[derive(Debug, Clone, Copy, HashStable)] pub struct Stmt<'hir> { #[stable_hasher(ignore)] pub hir_id: HirId, @@ -2066,7 +2066,7 @@ pub struct Stmt<'hir> { } /// The contents of a statement. -#[derive(Debug, Clone, Copy, HashStable_Generic)] +#[derive(Debug, Clone, Copy, HashStable)] pub enum StmtKind<'hir> { /// A local (`let`) binding. Let(&'hir LetStmt<'hir>), @@ -2082,7 +2082,7 @@ pub enum StmtKind<'hir> { } /// Represents a `let` statement (i.e., `let : = ;`). -#[derive(Debug, Clone, Copy, HashStable_Generic)] +#[derive(Debug, Clone, Copy, HashStable)] pub struct LetStmt<'hir> { /// Span of `super` in `super let`. pub super_: Option, @@ -2104,7 +2104,7 @@ pub struct LetStmt<'hir> { /// Represents a single arm of a `match` expression, e.g. /// ` (if ) => `. -#[derive(Debug, Clone, Copy, HashStable_Generic)] +#[derive(Debug, Clone, Copy, HashStable)] pub struct Arm<'hir> { #[stable_hasher(ignore)] pub hir_id: HirId, @@ -2122,7 +2122,7 @@ pub struct Arm<'hir> { /// /// In an `if let`, imagine it as `if (let = ) { ... }`; in a let-else, it is part of /// the desugaring to if-let. Only let-else supports the type annotation at present. -#[derive(Debug, Clone, Copy, HashStable_Generic)] +#[derive(Debug, Clone, Copy, HashStable)] pub struct LetExpr<'hir> { pub span: Span, pub pat: &'hir Pat<'hir>, @@ -2133,7 +2133,7 @@ pub struct LetExpr<'hir> { pub recovered: ast::Recovered, } -#[derive(Debug, Clone, Copy, HashStable_Generic)] +#[derive(Debug, Clone, Copy, HashStable)] pub struct ExprField<'hir> { #[stable_hasher(ignore)] pub hir_id: HirId, @@ -2143,19 +2143,19 @@ pub struct ExprField<'hir> { pub is_shorthand: bool, } -#[derive(Copy, Clone, PartialEq, Debug, HashStable_Generic)] +#[derive(Copy, Clone, PartialEq, Debug, HashStable)] pub enum BlockCheckMode { DefaultBlock, UnsafeBlock(UnsafeSource), } -#[derive(Copy, Clone, PartialEq, Debug, HashStable_Generic)] +#[derive(Copy, Clone, PartialEq, Debug, HashStable)] pub enum UnsafeSource { CompilerGenerated, UserProvided, } -#[derive(Copy, Clone, PartialEq, Eq, Hash, Debug, HashStable_Generic)] +#[derive(Copy, Clone, PartialEq, Eq, Hash, Debug, HashStable)] pub struct BodyId { pub hir_id: HirId, } @@ -2181,7 +2181,7 @@ pub struct BodyId { /// /// All bodies have an **owner**, which can be accessed via the HIR /// map using `body_owner_def_id()`. -#[derive(Debug, Clone, Copy, HashStable_Generic)] +#[derive(Debug, Clone, Copy, HashStable)] pub struct Body<'hir> { pub params: &'hir [Param<'hir>], pub value: &'hir Expr<'hir>, @@ -2194,7 +2194,7 @@ pub fn id(&self) -> BodyId { } /// The type of source expression that caused this coroutine to be created. -#[derive(Clone, PartialEq, Eq, Debug, Copy, Hash, HashStable_Generic, Encodable, Decodable)] +#[derive(Clone, PartialEq, Eq, Debug, Copy, Hash, HashStable, Encodable, Decodable)] pub enum CoroutineKind { /// A coroutine that comes from a desugaring. Desugared(CoroutineDesugaring, CoroutineSource), @@ -2244,7 +2244,7 @@ fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { /// /// This helps error messages but is also used to drive coercions in /// type-checking (see #60424). -#[derive(Clone, PartialEq, Eq, Hash, Debug, Copy, HashStable_Generic, Encodable, Decodable)] +#[derive(Clone, PartialEq, Eq, Hash, Debug, Copy, HashStable, Encodable, Decodable)] pub enum CoroutineSource { /// An explicit `async`/`gen` block written by the user. Block, @@ -2267,7 +2267,7 @@ fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { } } -#[derive(Clone, PartialEq, Eq, Debug, Copy, Hash, HashStable_Generic, Encodable, Decodable)] +#[derive(Clone, PartialEq, Eq, Debug, Copy, Hash, HashStable, Encodable, Decodable)] pub enum CoroutineDesugaring { /// An explicit `async` block or the body of an `async` function. Async, @@ -2407,7 +2407,7 @@ fn into_diag_arg(self, _: &mut Option) -> DiagArgValue { /// /// You can check if this anon const is a default in a const param /// `const N: usize = { ... }` with `tcx.hir_opt_const_param_default_param_def_id(..)` -#[derive(Copy, Clone, Debug, HashStable_Generic)] +#[derive(Copy, Clone, Debug, HashStable)] pub struct AnonConst { #[stable_hasher(ignore)] pub hir_id: HirId, @@ -2417,7 +2417,7 @@ pub struct AnonConst { } /// An inline constant expression `const { something }`. -#[derive(Copy, Clone, Debug, HashStable_Generic)] +#[derive(Copy, Clone, Debug, HashStable)] pub struct ConstBlock { #[stable_hasher(ignore)] pub hir_id: HirId, @@ -2433,7 +2433,7 @@ pub struct ConstBlock { /// the compiler and the reference. /// /// [rust lang reference]: https://doc.rust-lang.org/reference/expressions.html -#[derive(Debug, Clone, Copy, HashStable_Generic)] +#[derive(Debug, Clone, Copy, HashStable)] pub struct Expr<'hir> { #[stable_hasher(ignore)] pub hir_id: HirId, @@ -2792,7 +2792,7 @@ pub fn expr_needs_parens(expr: &Expr<'_>) -> bool { } } -#[derive(Debug, Clone, Copy, HashStable_Generic)] +#[derive(Debug, Clone, Copy, HashStable)] pub enum ExprKind<'hir> { /// Allow anonymous constants from an inline `const` block ConstBlock(ConstBlock), @@ -2931,7 +2931,7 @@ pub enum ExprKind<'hir> { Err(rustc_span::ErrorGuaranteed), } -#[derive(Debug, Clone, Copy, HashStable_Generic)] +#[derive(Debug, Clone, Copy, HashStable)] pub enum StructTailExpr<'hir> { /// A struct expression where all the fields are explicitly enumerated: `Foo { a, b }`. None, @@ -2955,7 +2955,7 @@ pub enum StructTailExpr<'hir> { /// To resolve the path to a `DefId`, call [`qpath_res`]. /// /// [`qpath_res`]: ../../rustc_middle/ty/struct.TypeckResults.html#method.qpath_res -#[derive(Debug, Clone, Copy, HashStable_Generic)] +#[derive(Debug, Clone, Copy, HashStable)] pub enum QPath<'hir> { /// Path to a definition, optionally "fully-qualified" with a `Self` /// type, if the path points to an associated item in a trait. @@ -2994,7 +2994,7 @@ pub fn qself_span(&self) -> Span { } /// Hints at the original code for a let statement. -#[derive(Copy, Clone, Debug, HashStable_Generic)] +#[derive(Copy, Clone, Debug, HashStable)] pub enum LocalSource { /// A `match _ { .. }`. Normal, @@ -3018,7 +3018,7 @@ pub enum LocalSource { } /// Hints at the original code for a `match _ { .. }`. -#[derive(Copy, Clone, PartialEq, Eq, Hash, Debug, HashStable_Generic, Encodable, Decodable)] +#[derive(Copy, Clone, PartialEq, Eq, Hash, Debug, HashStable, Encodable, Decodable)] pub enum MatchSource { /// A `match _ { .. }`. Normal, @@ -3050,7 +3050,7 @@ pub const fn name(self) -> &'static str { } /// The loop type that yielded an `ExprKind::Loop`. -#[derive(Copy, Clone, PartialEq, Debug, HashStable_Generic)] +#[derive(Copy, Clone, PartialEq, Debug, HashStable)] pub enum LoopSource { /// A `loop { .. }` loop. Loop, @@ -3070,7 +3070,7 @@ pub fn name(self) -> &'static str { } } -#[derive(Copy, Clone, Debug, PartialEq, HashStable_Generic)] +#[derive(Copy, Clone, Debug, PartialEq, HashStable)] pub enum LoopIdError { OutsideLoopScope, UnlabeledCfInWhileCondition, @@ -3089,7 +3089,7 @@ fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { } } -#[derive(Copy, Clone, Debug, PartialEq, HashStable_Generic)] +#[derive(Copy, Clone, Debug, PartialEq, HashStable)] pub struct Destination { /// This is `Some(_)` iff there is an explicit user-specified 'label pub label: Option