Skip to content

Commit 2db0d23

Browse files
committed
Auto merge of #156078 - JonathanBrouwer:rollup-WF8BsN3, r=<try>
Rollup of 9 pull requests try-job: dist-various-1 try-job: test-various try-job: x86_64-gnu-aux try-job: x86_64-gnu-llvm-21-3 try-job: x86_64-msvc-1 try-job: aarch64-apple try-job: x86_64-mingw-1 try-job: i686-msvc-2
2 parents 39ef8aa + a1a8e57 commit 2db0d23

202 files changed

Lines changed: 1600 additions & 1598 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.mailmap

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -260,6 +260,7 @@ Grzegorz Bartoszek <grzegorz.bartoszek@thaumatec.com>
260260
Guanqun Lu <guanqun.lu@gmail.com>
261261
Guillaume Gomez <contact@guillaume-gomez.fr>
262262
Guillaume Gomez <contact@guillaume-gomez.fr> Guillaume Gomez <guillaume1.gomez@gmail.com>
263+
Guillaume Gomez <contact@guillaume-gomez.fr> ggomez <guillaume1.gomez@gmail.com>
263264
Guillaume Gomez <contact@guillaume-gomez.fr> ggomez <ggomez@ggo.ifr.lan>
264265
Guillaume Gomez <contact@guillaume-gomez.fr> Guillaume Gomez <ggomez@ggo.ifr.lan>
265266
Guillaume Gomez <contact@guillaume-gomez.fr> Guillaume Gomez <guillaume.gomez@huawei.com>

compiler/rustc_abi/src/callconv/reg.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
#[cfg(feature = "nightly")]
2-
use rustc_macros::HashStable;
2+
use rustc_macros::StableHash;
33

44
use crate::{Align, HasDataLayout, Integer, Primitive, Size};
55

6-
#[cfg_attr(feature = "nightly", derive(HashStable))]
6+
#[cfg_attr(feature = "nightly", derive(StableHash))]
77
#[derive(Copy, Clone, PartialEq, Eq, Hash, Debug)]
88
pub enum RegKind {
99
Integer,
@@ -16,7 +16,7 @@ pub enum RegKind {
1616
},
1717
}
1818

19-
#[cfg_attr(feature = "nightly", derive(HashStable))]
19+
#[cfg_attr(feature = "nightly", derive(StableHash))]
2020
#[derive(Copy, Clone, PartialEq, Eq, Hash, Debug)]
2121
pub struct Reg {
2222
pub kind: RegKind,

compiler/rustc_abi/src/canon_abi.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
use std::fmt;
22

33
#[cfg(feature = "nightly")]
4-
use rustc_macros::HashStable;
4+
use rustc_macros::StableHash;
55

66
use crate::ExternAbi;
77

@@ -18,7 +18,7 @@ use crate::ExternAbi;
1818
/// rather than picking the "actual" ABI.
1919
#[derive(Copy, Clone, Debug)]
2020
#[derive(PartialOrd, Ord, PartialEq, Eq, Hash)]
21-
#[cfg_attr(feature = "nightly", derive(HashStable))]
21+
#[cfg_attr(feature = "nightly", derive(StableHash))]
2222
pub enum CanonAbi {
2323
// NOTE: the use of nested variants for some ABIs is for many targets they don't matter,
2424
// and this pushes the complexity of their reasoning to target-specific code,
@@ -111,7 +111,7 @@ impl fmt::Display for CanonAbi {
111111
/// These only affect callee codegen. making their categorization as distinct ABIs a bit peculiar.
112112
#[derive(Copy, Clone, Debug)]
113113
#[derive(PartialOrd, Ord, PartialEq, Eq, Hash)]
114-
#[cfg_attr(feature = "nightly", derive(HashStable))]
114+
#[cfg_attr(feature = "nightly", derive(StableHash))]
115115
pub enum InterruptKind {
116116
Avr,
117117
AvrNonBlocking,
@@ -126,7 +126,7 @@ pub enum InterruptKind {
126126
/// One of SysV64 or Win64 may alias the C ABI, and arguably Win64 is cross-platform now?
127127
#[derive(Clone, Copy, Debug)]
128128
#[derive(PartialOrd, Ord, PartialEq, Eq, Hash)]
129-
#[cfg_attr(feature = "nightly", derive(HashStable))]
129+
#[cfg_attr(feature = "nightly", derive(StableHash))]
130130
pub enum X86Call {
131131
/// "fastcall" has both GNU and Windows variants
132132
Fastcall,
@@ -141,7 +141,7 @@ pub enum X86Call {
141141
/// ABIs defined for 32-bit Arm
142142
#[derive(Copy, Clone, Debug)]
143143
#[derive(PartialOrd, Ord, PartialEq, Eq, Hash)]
144-
#[cfg_attr(feature = "nightly", derive(HashStable))]
144+
#[cfg_attr(feature = "nightly", derive(StableHash))]
145145
pub enum ArmCall {
146146
Aapcs,
147147
CCmseNonSecureCall,

compiler/rustc_abi/src/extern_abi.rs

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,7 @@ use std::fmt;
33
use std::hash::{Hash, Hasher};
44

55
#[cfg(feature = "nightly")]
6-
use rustc_data_structures::stable_hasher::{
7-
HashStable, HashStableContext, StableHasher, StableOrd,
8-
};
6+
use rustc_data_structures::stable_hasher::{StableHash, StableHashCtxt, StableHasher, StableOrd};
97
#[cfg(feature = "nightly")]
108
use rustc_macros::{Decodable, Encodable};
119
#[cfg(feature = "nightly")]
@@ -242,9 +240,9 @@ impl Hash for ExternAbi {
242240
}
243241

244242
#[cfg(feature = "nightly")]
245-
impl HashStable for ExternAbi {
243+
impl StableHash for ExternAbi {
246244
#[inline]
247-
fn hash_stable<Hcx: HashStableContext>(&self, _: &mut Hcx, hasher: &mut StableHasher) {
245+
fn stable_hash<Hcx: StableHashCtxt>(&self, _: &mut Hcx, hasher: &mut StableHasher) {
248246
Hash::hash(self, hasher);
249247
}
250248
}

compiler/rustc_abi/src/layout/ty.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ use std::fmt;
22
use std::ops::Deref;
33

44
use rustc_data_structures::intern::Interned;
5-
use rustc_macros::HashStable;
5+
use rustc_macros::StableHash;
66

77
use crate::layout::{FieldIdx, VariantIdx};
88
use crate::{
@@ -12,7 +12,7 @@ use crate::{
1212

1313
// Explicitly import `Float` to avoid ambiguity with `Primitive::Float`.
1414

15-
#[derive(Copy, Clone, PartialEq, Eq, Hash, HashStable)]
15+
#[derive(Copy, Clone, PartialEq, Eq, Hash, StableHash)]
1616
#[rustc_pass_by_value]
1717
pub struct Layout<'a>(pub Interned<'a, LayoutData<FieldIdx, VariantIdx>>);
1818

@@ -71,7 +71,7 @@ impl<'a> Layout<'a> {
7171
/// to that obtained from `layout_of(ty)`, as we need to produce
7272
/// layouts for which Rust types do not exist, such as enum variants
7373
/// or synthetic fields of enums (i.e., discriminants) and wide pointers.
74-
#[derive(Copy, Clone, PartialEq, Eq, Hash, HashStable)]
74+
#[derive(Copy, Clone, PartialEq, Eq, Hash, StableHash)]
7575
pub struct TyAndLayout<'a, Ty> {
7676
pub ty: Ty,
7777
pub layout: Layout<'a>,

compiler/rustc_abi/src/lib.rs

Lines changed: 21 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ use rustc_errors::{Diag, DiagCtxtHandle, Diagnostic, EmissionGuarantee, Level, m
5353
use rustc_hashes::Hash64;
5454
use 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")]
5858
use rustc_span::{Symbol, sym};
5959

@@ -74,7 +74,7 @@ pub use layout::{FIRST_VARIANT, FieldIdx, LayoutCalculator, LayoutCalculatorErro
7474
pub 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))]
7878
pub struct ReprFlags(u8);
7979

8080
bitflags! {
@@ -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))]
115115
pub 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))]
135135
pub 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))]
146146
pub 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))]
796796
pub 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))]
10211021
pub 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))]
11541154
pub 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))]
11861186
pub 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))]
13461346
pub 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))]
13811381
pub 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))]
14291429
pub 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))]
15411541
pub 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))]
16451645
pub 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))]
17301730
pub struct AddressSpace(pub u32);
17311731

17321732
impl 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))]
17431743
pub struct NumScalableVectors(pub u8);
17441744

17451745
impl 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))]
17921792
pub 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))]
19361936
pub 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))]
19631963
pub 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))]
20042004
pub 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))]
21012101
pub struct LayoutData<FieldIdx: Idx, VariantIdx: Idx> {
21022102
/// Says where the fields are located within the layout.
21032103
pub fields: FieldsShape<FieldIdx>,

0 commit comments

Comments
 (0)