Skip to content

Commit cf6bc48

Browse files
authored
Merge pull request rust-lang#18457 from lnicola/sync-from-rust
minor: Sync from downstream
2 parents a5b5b46 + 9acf57c commit cf6bc48

File tree

906 files changed

+8878
-6615
lines changed

Some content is hidden

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

906 files changed

+8878
-6615
lines changed

Cargo.lock

+17-10
Original file line numberDiff line numberDiff line change
@@ -720,6 +720,7 @@ dependencies = [
720720
"miropt-test-tools",
721721
"regex",
722722
"rustfix",
723+
"semver",
723724
"serde",
724725
"serde_json",
725726
"tracing",
@@ -3203,9 +3204,11 @@ dependencies = [
32033204
"rand",
32043205
"rand_xoshiro",
32053206
"rustc_data_structures",
3207+
"rustc_feature",
32063208
"rustc_index",
32073209
"rustc_macros",
32083210
"rustc_serialize",
3211+
"rustc_span",
32093212
"tracing",
32103213
]
32113214

@@ -3301,6 +3304,7 @@ version = "0.0.0"
33013304
dependencies = [
33023305
"itertools",
33033306
"rustc_ast",
3307+
"rustc_data_structures",
33043308
"rustc_lexer",
33053309
"rustc_span",
33063310
"thin-vec",
@@ -3621,6 +3625,7 @@ version = "0.0.0"
36213625
dependencies = [
36223626
"annotate-snippets 0.11.4",
36233627
"derive_setters",
3628+
"rustc_abi",
36243629
"rustc_ast",
36253630
"rustc_ast_pretty",
36263631
"rustc_data_structures",
@@ -3718,6 +3723,7 @@ name = "rustc_hir_analysis"
37183723
version = "0.0.0"
37193724
dependencies = [
37203725
"itertools",
3726+
"rustc_abi",
37213727
"rustc_arena",
37223728
"rustc_ast",
37233729
"rustc_attr",
@@ -3745,11 +3751,11 @@ dependencies = [
37453751
name = "rustc_hir_pretty"
37463752
version = "0.0.0"
37473753
dependencies = [
3754+
"rustc_abi",
37483755
"rustc_ast",
37493756
"rustc_ast_pretty",
37503757
"rustc_hir",
37513758
"rustc_span",
3752-
"rustc_target",
37533759
]
37543760

37553761
[[package]]
@@ -3906,6 +3912,7 @@ dependencies = [
39063912
name = "rustc_lint"
39073913
version = "0.0.0"
39083914
dependencies = [
3915+
"rustc_abi",
39093916
"rustc_ast",
39103917
"rustc_ast_pretty",
39113918
"rustc_attr",
@@ -3933,14 +3940,14 @@ dependencies = [
39333940
name = "rustc_lint_defs"
39343941
version = "0.0.0"
39353942
dependencies = [
3943+
"rustc_abi",
39363944
"rustc_ast",
39373945
"rustc_data_structures",
39383946
"rustc_error_messages",
39393947
"rustc_hir",
39403948
"rustc_macros",
39413949
"rustc_serialize",
39423950
"rustc_span",
3943-
"rustc_target",
39443951
"serde",
39453952
]
39463953

@@ -3980,6 +3987,7 @@ dependencies = [
39803987
"bitflags 2.6.0",
39813988
"libloading",
39823989
"odht",
3990+
"rustc_abi",
39833991
"rustc_ast",
39843992
"rustc_attr",
39853993
"rustc_data_structures",
@@ -3998,7 +4006,6 @@ dependencies = [
39984006
"rustc_span",
39994007
"rustc_target",
40004008
"rustc_type_ir",
4001-
"snap",
40024009
"tempfile",
40034010
"tracing",
40044011
]
@@ -4048,6 +4055,7 @@ version = "0.0.0"
40484055
dependencies = [
40494056
"either",
40504057
"itertools",
4058+
"rustc_abi",
40514059
"rustc_apfloat",
40524060
"rustc_arena",
40534061
"rustc_ast",
@@ -4063,7 +4071,6 @@ dependencies = [
40634071
"rustc_pattern_analysis",
40644072
"rustc_session",
40654073
"rustc_span",
4066-
"rustc_target",
40674074
"rustc_trait_selection",
40684075
"tracing",
40694076
]
@@ -4074,6 +4081,7 @@ version = "0.0.0"
40744081
dependencies = [
40754082
"polonius-engine",
40764083
"regex",
4084+
"rustc_abi",
40774085
"rustc_ast",
40784086
"rustc_data_structures",
40794087
"rustc_errors",
@@ -4095,6 +4103,7 @@ version = "0.0.0"
40954103
dependencies = [
40964104
"either",
40974105
"itertools",
4106+
"rustc_abi",
40984107
"rustc_arena",
40994108
"rustc_ast",
41004109
"rustc_attr",
@@ -4187,6 +4196,7 @@ dependencies = [
41874196
name = "rustc_passes"
41884197
version = "0.0.0"
41894198
dependencies = [
4199+
"rustc_abi",
41904200
"rustc_ast",
41914201
"rustc_ast_pretty",
41924202
"rustc_attr",
@@ -4213,6 +4223,7 @@ name = "rustc_pattern_analysis"
42134223
version = "0.0.0"
42144224
dependencies = [
42154225
"rustc-hash 2.0.0",
4226+
"rustc_abi",
42164227
"rustc_apfloat",
42174228
"rustc_arena",
42184229
"rustc_data_structures",
@@ -4352,6 +4363,7 @@ dependencies = [
43524363
"bitflags 2.6.0",
43534364
"getopts",
43544365
"libc",
4366+
"rustc_abi",
43554367
"rustc_ast",
43564368
"rustc_data_structures",
43574369
"rustc_errors",
@@ -4415,6 +4427,7 @@ version = "0.0.0"
44154427
dependencies = [
44164428
"punycode",
44174429
"rustc-demangle",
4430+
"rustc_abi",
44184431
"rustc_data_structures",
44194432
"rustc_errors",
44204433
"rustc_hir",
@@ -4877,12 +4890,6 @@ version = "1.13.2"
48774890
source = "registry+https://github.com/rust-lang/crates.io-index"
48784891
checksum = "3c5e1a9a646d36c3599cd173a41282daf47c44583ad367b8e6837255952e5c67"
48794892

4880-
[[package]]
4881-
name = "snap"
4882-
version = "1.1.1"
4883-
source = "registry+https://github.com/rust-lang/crates.io-index"
4884-
checksum = "1b6b67fb9a61334225b5b790716f609cd58395f895b3fe8b328786812a40bc3b"
4885-
48864893
[[package]]
48874894
name = "socket2"
48884895
version = "0.5.7"

compiler/rustc_abi/Cargo.toml

+4
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,11 @@ bitflags = "2.4.1"
99
rand = { version = "0.8.4", default-features = false, optional = true }
1010
rand_xoshiro = { version = "0.6.0", optional = true }
1111
rustc_data_structures = { path = "../rustc_data_structures", optional = true }
12+
rustc_feature = { path = "../rustc_feature", optional = true }
1213
rustc_index = { path = "../rustc_index", default-features = false }
1314
rustc_macros = { path = "../rustc_macros", optional = true }
1415
rustc_serialize = { path = "../rustc_serialize", optional = true }
16+
rustc_span = { path = "../rustc_span", optional = true }
1517
tracing = "0.1"
1618
# tidy-alphabetical-end
1719

@@ -22,8 +24,10 @@ default = ["nightly", "randomize"]
2224
# without depending on rustc_data_structures, rustc_macros and rustc_serialize
2325
nightly = [
2426
"dep:rustc_data_structures",
27+
"dep:rustc_feature",
2528
"dep:rustc_macros",
2629
"dep:rustc_serialize",
30+
"dep:rustc_span",
2731
"rustc_index/nightly",
2832
]
2933
randomize = ["dep:rand", "dep:rand_xoshiro", "nightly"]

compiler/rustc_abi/src/callconv.rs

+8-8
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,9 @@ mod abi {
66
#[cfg(feature = "nightly")]
77
use rustc_macros::HashStable_Generic;
88

9-
#[cfg(feature = "nightly")]
10-
use crate::{Abi, FieldsShape, TyAbiInterface, TyAndLayout};
119
use crate::{Align, HasDataLayout, Size};
10+
#[cfg(feature = "nightly")]
11+
use crate::{BackendRepr, FieldsShape, TyAbiInterface, TyAndLayout};
1212

1313
#[cfg_attr(feature = "nightly", derive(HashStable_Generic))]
1414
#[derive(Copy, Clone, PartialEq, Eq, Hash, Debug)]
@@ -128,27 +128,27 @@ impl<'a, Ty> TyAndLayout<'a, Ty> {
128128
where
129129
Ty: TyAbiInterface<'a, C> + Copy,
130130
{
131-
match self.abi {
132-
Abi::Uninhabited => Err(Heterogeneous),
131+
match self.backend_repr {
132+
BackendRepr::Uninhabited => Err(Heterogeneous),
133133

134134
// The primitive for this algorithm.
135-
Abi::Scalar(scalar) => {
135+
BackendRepr::Scalar(scalar) => {
136136
let kind = match scalar.primitive() {
137137
abi::Int(..) | abi::Pointer(_) => RegKind::Integer,
138138
abi::Float(_) => RegKind::Float,
139139
};
140140
Ok(HomogeneousAggregate::Homogeneous(Reg { kind, size: self.size }))
141141
}
142142

143-
Abi::Vector { .. } => {
143+
BackendRepr::Vector { .. } => {
144144
assert!(!self.is_zst());
145145
Ok(HomogeneousAggregate::Homogeneous(Reg {
146146
kind: RegKind::Vector,
147147
size: self.size,
148148
}))
149149
}
150150

151-
Abi::ScalarPair(..) | Abi::Aggregate { sized: true } => {
151+
BackendRepr::ScalarPair(..) | BackendRepr::Memory { sized: true } => {
152152
// Helper for computing `homogeneous_aggregate`, allowing a custom
153153
// starting offset (used below for handling variants).
154154
let from_fields_at =
@@ -246,7 +246,7 @@ impl<'a, Ty> TyAndLayout<'a, Ty> {
246246
Ok(result)
247247
}
248248
}
249-
Abi::Aggregate { sized: false } => Err(Heterogeneous),
249+
BackendRepr::Memory { sized: false } => Err(Heterogeneous),
250250
}
251251
}
252252
}

compiler/rustc_target/src/spec/abi/mod.rs renamed to compiler/rustc_abi/src/extern_abi/mod.rs

+3-1
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,11 @@ use rustc_span::{Span, Symbol};
77
#[cfg(test)]
88
mod tests;
99

10+
use ExternAbi as Abi;
11+
1012
#[derive(PartialEq, Eq, PartialOrd, Ord, Hash, Clone, Copy, Debug)]
1113
#[derive(HashStable_Generic, Encodable, Decodable)]
12-
pub enum Abi {
14+
pub enum ExternAbi {
1315
// Some of the ABIs come first because every time we add a new ABI, we have to re-bless all the
1416
// hashing tests. These are used in many places, so giving them stable values reduces test
1517
// churn. The specific values are meaningless.

0 commit comments

Comments
 (0)