Skip to content

Commit c395bdd

Browse files
committed
Merge upstream updates to resolve conflicts
2 parents 2676796 + 1677d46 commit c395bdd

File tree

1,162 files changed

+19959
-15605
lines changed

Some content is hidden

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

1,162 files changed

+19959
-15605
lines changed

.github/workflows/ci.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,10 @@ name: CI
1111
on:
1212
push:
1313
branches:
14+
# CI on master only serves for caching citool builds for the `calculate_matrix` job.
15+
# In order to use GHA cache on PR CI (and auto/try) jobs, we need to write to it
16+
# from the default branch.
17+
- master
1418
- auto
1519
- try
1620
- try-perf

Cargo.lock

Lines changed: 35 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -162,7 +162,7 @@ version = "0.4.2"
162162
source = "registry+https://github.com/rust-lang/crates.io-index"
163163
checksum = "01667f6f40216b9a0b2945e05fed5f1ad0ab6470e69cb9378001e37b1c0668e4"
164164
dependencies = [
165-
"object",
165+
"object 0.36.7",
166166
]
167167

168168
[[package]]
@@ -235,7 +235,7 @@ dependencies = [
235235
"cfg-if",
236236
"libc",
237237
"miniz_oxide",
238-
"object",
238+
"object 0.36.7",
239239
"rustc-demangle",
240240
"windows-targets 0.52.6",
241241
]
@@ -2326,7 +2326,6 @@ dependencies = [
23262326
"tempfile",
23272327
"tikv-jemalloc-sys",
23282328
"ui_test",
2329-
"windows-sys 0.59.0",
23302329
]
23312330

23322331
[[package]]
@@ -2509,7 +2508,19 @@ dependencies = [
25092508
"indexmap",
25102509
"memchr",
25112510
"ruzstd",
2512-
"wasmparser 0.222.1",
2511+
]
2512+
2513+
[[package]]
2514+
name = "object"
2515+
version = "0.37.0"
2516+
source = "registry+https://github.com/rust-lang/crates.io-index"
2517+
checksum = "6273adb7096cf9ab4335f258e627d8230e69d40d45567d678f552dcec6245215"
2518+
dependencies = [
2519+
"crc32fast",
2520+
"hashbrown",
2521+
"indexmap",
2522+
"memchr",
2523+
"wasmparser 0.232.0",
25132524
]
25142525

25152526
[[package]]
@@ -3109,7 +3120,7 @@ dependencies = [
31093120
"build_helper",
31103121
"gimli",
31113122
"libc",
3112-
"object",
3123+
"object 0.36.7",
31133124
"regex",
31143125
"serde_json",
31153126
"similar",
@@ -3118,11 +3129,12 @@ dependencies = [
31183129

31193130
[[package]]
31203131
name = "rustc-build-sysroot"
3121-
version = "0.5.7"
3132+
version = "0.5.8"
31223133
source = "registry+https://github.com/rust-lang/crates.io-index"
3123-
checksum = "10edc2e4393515193bd766e2f6c050b0536a68e56f2b6d56c07ababfdc114ff0"
3134+
checksum = "16d115ad7e26e0d1337f64ae6598f758194696afc2e9f34c8a6f24582529c3dc"
31243135
dependencies = [
31253136
"anyhow",
3137+
"regex",
31263138
"rustc_version",
31273139
"tempfile",
31283140
"walkdir",
@@ -3422,7 +3434,7 @@ dependencies = [
34223434
"itertools",
34233435
"libc",
34243436
"measureme",
3425-
"object",
3437+
"object 0.37.0",
34263438
"rustc-demangle",
34273439
"rustc_abi",
34283440
"rustc_ast",
@@ -3463,7 +3475,7 @@ dependencies = [
34633475
"either",
34643476
"itertools",
34653477
"libc",
3466-
"object",
3478+
"object 0.37.0",
34673479
"pathdiff",
34683480
"regex",
34693481
"rustc_abi",
@@ -3640,6 +3652,7 @@ dependencies = [
36403652
"rustc_macros",
36413653
"rustc_serialize",
36423654
"rustc_span",
3655+
"smallvec",
36433656
"tracing",
36443657
"unic-langid",
36453658
]
@@ -3786,6 +3799,7 @@ dependencies = [
37863799
"rustc_middle",
37873800
"rustc_session",
37883801
"rustc_span",
3802+
"rustc_target",
37893803
"rustc_trait_selection",
37903804
"smallvec",
37913805
"tracing",
@@ -4495,7 +4509,7 @@ name = "rustc_target"
44954509
version = "0.0.0"
44964510
dependencies = [
44974511
"bitflags",
4498-
"object",
4512+
"object 0.37.0",
44994513
"rustc_abi",
45004514
"rustc_data_structures",
45014515
"rustc_fs_util",
@@ -4673,6 +4687,7 @@ dependencies = [
46734687
"bincode",
46744688
"rustc-hash 2.1.1",
46754689
"serde",
4690+
"serde_derive",
46764691
"serde_json",
46774692
]
46784693

@@ -5246,7 +5261,7 @@ checksum = "9e9c1e705f82a260173f3eec93f2ff6d7807f23ad5a8cc2e7316a891733ea7a1"
52465261
dependencies = [
52475262
"gimli",
52485263
"hashbrown",
5249-
"object",
5264+
"object 0.36.7",
52505265
"tracing",
52515266
]
52525267

@@ -5907,15 +5922,6 @@ dependencies = [
59075922
"indexmap",
59085923
]
59095924

5910-
[[package]]
5911-
name = "wasmparser"
5912-
version = "0.222.1"
5913-
source = "registry+https://github.com/rust-lang/crates.io-index"
5914-
checksum = "fa210fd1788e6b37a1d1930f3389c48e1d6ebd1a013d34fa4b7f9e3e3bf03146"
5915-
dependencies = [
5916-
"bitflags",
5917-
]
5918-
59195925
[[package]]
59205926
name = "wasmparser"
59215927
version = "0.229.0"
@@ -5940,6 +5946,15 @@ dependencies = [
59405946
"semver",
59415947
]
59425948

5949+
[[package]]
5950+
name = "wasmparser"
5951+
version = "0.232.0"
5952+
source = "registry+https://github.com/rust-lang/crates.io-index"
5953+
checksum = "917739b33bb1eb0e9a49bcd2637a351931be4578d0cc4d37b908d7a797784fbb"
5954+
dependencies = [
5955+
"bitflags",
5956+
]
5957+
59435958
[[package]]
59445959
name = "wast"
59455960
version = "230.0.0"

compiler/rustc_abi/src/canon_abi.rs

Lines changed: 6 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -50,18 +50,10 @@ pub enum CanonAbi {
5050

5151
impl fmt::Display for CanonAbi {
5252
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
53-
self.to_erased_extern_abi().as_str().fmt(f)
54-
}
55-
}
56-
57-
impl CanonAbi {
58-
/// convert to the ExternAbi that *shares a string* with this CanonAbi
59-
///
60-
/// A target-insensitive mapping of CanonAbi to ExternAbi, convenient for "forwarding" impls.
61-
/// Importantly, the set of CanonAbi values is a logical *subset* of ExternAbi values,
62-
/// so this is injective: if you take an ExternAbi to a CanonAbi and back, you have lost data.
63-
const fn to_erased_extern_abi(self) -> ExternAbi {
64-
match self {
53+
// convert to the ExternAbi that *shares a string* with this CanonAbi.
54+
// FIXME: ideally we'd avoid printing `CanonAbi`, and preserve `ExternAbi` everywhere
55+
// that we need to generate error messages.
56+
let erased_abi = match self {
6557
CanonAbi::C => ExternAbi::C { unwind: false },
6658
CanonAbi::Rust => ExternAbi::Rust,
6759
CanonAbi::RustCold => ExternAbi::RustCold,
@@ -87,7 +79,8 @@ impl CanonAbi {
8779
X86Call::Vectorcall => ExternAbi::Vectorcall { unwind: false },
8880
X86Call::Win64 => ExternAbi::Win64 { unwind: false },
8981
},
90-
}
82+
};
83+
erased_abi.as_str().fmt(f)
9184
}
9285
}
9386

compiler/rustc_abi/src/extern_abi.rs

Lines changed: 63 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -12,66 +12,93 @@ use crate::AbiFromStrErr;
1212
#[cfg(test)]
1313
mod tests;
1414

15-
use ExternAbi as Abi;
16-
15+
/// ABI we expect to see within `extern "{abi}"`
1716
#[derive(Clone, Copy, Debug)]
1817
#[cfg_attr(feature = "nightly", derive(Encodable, Decodable))]
1918
pub enum ExternAbi {
20-
// Some of the ABIs come first because every time we add a new ABI, we have to re-bless all the
21-
// hashing tests. These are used in many places, so giving them stable values reduces test
22-
// churn. The specific values are meaningless.
23-
Rust,
19+
/* universal */
20+
/// presumed C ABI for the platform
2421
C {
2522
unwind: bool,
2623
},
27-
Cdecl {
24+
/// ABI of the "system" interface, e.g. the Win32 API, always "aliasing"
25+
System {
2826
unwind: bool,
2927
},
30-
Stdcall {
28+
29+
/// that's us!
30+
Rust,
31+
/// the mostly-unused `unboxed_closures` ABI, effectively now an impl detail unless someone
32+
/// puts in the work to make it viable again... but would we need a special ABI?
33+
RustCall,
34+
/// For things unlikely to be called, where reducing register pressure in
35+
/// `extern "Rust"` callers is worth paying extra cost in the callee.
36+
/// Stronger than just `#[cold]` because `fn` pointers might be incompatible.
37+
RustCold,
38+
39+
/// Unstable impl detail that directly uses Rust types to describe the ABI to LLVM.
40+
/// Even normally-compatible Rust types can become ABI-incompatible with this ABI!
41+
Unadjusted,
42+
43+
/// UEFI ABI, usually an alias of C, but sometimes an arch-specific alias
44+
/// and only valid on platforms that have a UEFI standard
45+
EfiApi,
46+
47+
/* arm */
48+
/// Arm Architecture Procedure Call Standard, sometimes `ExternAbi::C` is an alias for this
49+
Aapcs {
3150
unwind: bool,
3251
},
33-
Fastcall {
52+
/// extremely constrained barely-C ABI for TrustZone
53+
CCmseNonSecureCall,
54+
/// extremely constrained barely-C ABI for TrustZone
55+
CCmseNonSecureEntry,
56+
57+
/* gpu */
58+
/// An entry-point function called by the GPU's host
59+
// FIXME: should not be callable from Rust on GPU targets, is for host's use only
60+
GpuKernel,
61+
/// An entry-point function called by the GPU's host
62+
// FIXME: why do we have two of these?
63+
PtxKernel,
64+
65+
/* interrupt */
66+
AvrInterrupt,
67+
AvrNonBlockingInterrupt,
68+
Msp430Interrupt,
69+
RiscvInterruptM,
70+
RiscvInterruptS,
71+
X86Interrupt,
72+
73+
/* x86 */
74+
/// `ExternAbi::C` but spelled funny because x86
75+
Cdecl {
3476
unwind: bool,
3577
},
36-
Vectorcall {
78+
/// gnu-stdcall on "unix" and win-stdcall on "windows"
79+
Stdcall {
3780
unwind: bool,
3881
},
39-
Thiscall {
82+
/// gnu-fastcall on "unix" and win-fastcall on "windows"
83+
Fastcall {
4084
unwind: bool,
4185
},
42-
Aapcs {
86+
/// windows C++ ABI
87+
Thiscall {
4388
unwind: bool,
4489
},
45-
Win64 {
90+
/// uses AVX and stuff
91+
Vectorcall {
4692
unwind: bool,
4793
},
94+
95+
/* x86_64 */
4896
SysV64 {
4997
unwind: bool,
5098
},
51-
PtxKernel,
52-
Msp430Interrupt,
53-
X86Interrupt,
54-
/// An entry-point function called by the GPU's host
55-
// FIXME: should not be callable from Rust on GPU targets, is for host's use only
56-
GpuKernel,
57-
EfiApi,
58-
AvrInterrupt,
59-
AvrNonBlockingInterrupt,
60-
CCmseNonSecureCall,
61-
CCmseNonSecureEntry,
62-
System {
99+
Win64 {
63100
unwind: bool,
64101
},
65-
RustCall,
66-
/// *Not* a stable ABI, just directly use the Rust types to describe the ABI for LLVM. Even
67-
/// normally ABI-compatible Rust types can become ABI-incompatible with this ABI!
68-
Unadjusted,
69-
/// For things unlikely to be called, where reducing register pressure in
70-
/// `extern "Rust"` callers is worth paying extra cost in the callee.
71-
/// Stronger than just `#[cold]` because `fn` pointers might be incompatible.
72-
RustCold,
73-
RiscvInterruptM,
74-
RiscvInterruptS,
75102
}
76103

77104
macro_rules! abi_impls {
@@ -224,7 +251,7 @@ pub fn all_names() -> Vec<&'static str> {
224251

225252
impl ExternAbi {
226253
/// Default ABI chosen for `extern fn` declarations without an explicit ABI.
227-
pub const FALLBACK: Abi = Abi::C { unwind: false };
254+
pub const FALLBACK: ExternAbi = ExternAbi::C { unwind: false };
228255

229256
pub fn name(self) -> &'static str {
230257
self.as_str()

0 commit comments

Comments
 (0)