Skip to content

Commit 886cae4

Browse files
committed
Auto merge of #142175 - workingjubilee:rollup-getk68g, r=workingjubilee
Rollup of 14 pull requests Successful merges: - #138062 (Enable Non-determinism of float operations in Miri and change std tests ) - #140560 (Allow `#![doc(test(attr(..)))]` everywhere) - #141001 (Make NonZero<char> possible) - #141295 (Stabilize `if let` guards (`feature(if_let_guard)`)) - #141435 (Add (back) `unsupported_calling_conventions` lint to reject more invalid calling conventions) - #141447 (Document representation of `Option<unsafe fn()>`) - #142008 (const-eval error: always say in which item the error occurred) - #142053 (Add new Tier-3 targets: `loongarch32-unknown-none*`) - #142065 (Stabilize `const_eq_ignore_ascii_case`) - #142116 (Fix bootstrap tracing imports) - #142126 (Treat normalizing consts like normalizing types in deeply normalize) - #142140 (compiler: Sort and doc ExternAbi variants) - #142148 (compiler: Treat ForceWarning as a Warning for diagnostic level) - #142154 (get rid of spurious cfg(bootstrap)) r? `@ghost` `@rustbot` modify labels: rollup
2 parents 2f2c8c3 + 049d2da commit 886cae4

File tree

426 files changed

+4401
-2419
lines changed

Some content is hidden

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

426 files changed

+4401
-2419
lines changed

Cargo.lock

Lines changed: 30 additions & 17 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
]
@@ -2509,7 +2509,19 @@ dependencies = [
25092509
"indexmap",
25102510
"memchr",
25112511
"ruzstd",
2512-
"wasmparser 0.222.1",
2512+
]
2513+
2514+
[[package]]
2515+
name = "object"
2516+
version = "0.37.0"
2517+
source = "registry+https://github.com/rust-lang/crates.io-index"
2518+
checksum = "6273adb7096cf9ab4335f258e627d8230e69d40d45567d678f552dcec6245215"
2519+
dependencies = [
2520+
"crc32fast",
2521+
"hashbrown",
2522+
"indexmap",
2523+
"memchr",
2524+
"wasmparser 0.232.0",
25132525
]
25142526

25152527
[[package]]
@@ -3109,7 +3121,7 @@ dependencies = [
31093121
"build_helper",
31103122
"gimli",
31113123
"libc",
3112-
"object",
3124+
"object 0.36.7",
31133125
"regex",
31143126
"serde_json",
31153127
"similar",
@@ -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",
@@ -3786,6 +3798,7 @@ dependencies = [
37863798
"rustc_middle",
37873799
"rustc_session",
37883800
"rustc_span",
3801+
"rustc_target",
37893802
"rustc_trait_selection",
37903803
"smallvec",
37913804
"tracing",
@@ -4495,7 +4508,7 @@ name = "rustc_target"
44954508
version = "0.0.0"
44964509
dependencies = [
44974510
"bitflags",
4498-
"object",
4511+
"object 0.37.0",
44994512
"rustc_abi",
45004513
"rustc_data_structures",
45014514
"rustc_fs_util",
@@ -5247,7 +5260,7 @@ checksum = "9e9c1e705f82a260173f3eec93f2ff6d7807f23ad5a8cc2e7316a891733ea7a1"
52475260
dependencies = [
52485261
"gimli",
52495262
"hashbrown",
5250-
"object",
5263+
"object 0.36.7",
52515264
"tracing",
52525265
]
52535266

@@ -5908,15 +5921,6 @@ dependencies = [
59085921
"indexmap",
59095922
]
59105923

5911-
[[package]]
5912-
name = "wasmparser"
5913-
version = "0.222.1"
5914-
source = "registry+https://github.com/rust-lang/crates.io-index"
5915-
checksum = "fa210fd1788e6b37a1d1930f3389c48e1d6ebd1a013d34fa4b7f9e3e3bf03146"
5916-
dependencies = [
5917-
"bitflags",
5918-
]
5919-
59205924
[[package]]
59215925
name = "wasmparser"
59225926
version = "0.229.0"
@@ -5941,6 +5945,15 @@ dependencies = [
59415945
"semver",
59425946
]
59435947

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

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()

compiler/rustc_ast/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
77
// tidy-alphabetical-start
88
#![allow(internal_features)]
9+
#![cfg_attr(bootstrap, feature(if_let_guard))]
910
#![doc(
1011
html_root_url = "https://doc.rust-lang.org/nightly/nightly-rustc/",
1112
test(attr(deny(warnings)))
@@ -14,7 +15,6 @@
1415
#![feature(array_windows)]
1516
#![feature(associated_type_defaults)]
1617
#![feature(box_patterns)]
17-
#![feature(if_let_guard)]
1818
#![feature(macro_metavar_expr)]
1919
#![feature(negative_impls)]
2020
#![feature(never_type)]

compiler/rustc_ast_lowering/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,11 +32,11 @@
3232
3333
// tidy-alphabetical-start
3434
#![allow(internal_features)]
35+
#![cfg_attr(bootstrap, feature(if_let_guard))]
3536
#![doc(rust_logo)]
3637
#![feature(assert_matches)]
3738
#![feature(box_patterns)]
3839
#![feature(exact_size_is_empty)]
39-
#![feature(if_let_guard)]
4040
#![feature(rustdoc_internals)]
4141
// tidy-alphabetical-end
4242

compiler/rustc_ast_passes/src/feature_gate.rs

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -454,11 +454,6 @@ pub fn check_crate(krate: &ast::Crate, sess: &Session, features: &Features) {
454454
}
455455
};
456456
}
457-
gate_all!(
458-
if_let_guard,
459-
"`if let` guards are experimental",
460-
"you can write `if matches!(<expr>, <pattern>)` instead of `if let <pattern> = <expr>`"
461-
);
462457
gate_all!(let_chains, "`let` expressions in this position are unstable");
463458
gate_all!(
464459
async_trait_bounds,

compiler/rustc_ast_passes/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@
44
55
// tidy-alphabetical-start
66
#![allow(internal_features)]
7+
#![cfg_attr(bootstrap, feature(if_let_guard))]
78
#![doc(rust_logo)]
89
#![feature(box_patterns)]
9-
#![feature(if_let_guard)]
1010
#![feature(iter_is_partitioned)]
1111
#![feature(rustdoc_internals)]
1212
// tidy-alphabetical-end

compiler/rustc_borrowck/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,11 @@
22
33
// tidy-alphabetical-start
44
#![allow(internal_features)]
5+
#![cfg_attr(bootstrap, feature(if_let_guard))]
56
#![doc(rust_logo)]
67
#![feature(assert_matches)]
78
#![feature(box_patterns)]
89
#![feature(file_buffered)]
9-
#![feature(if_let_guard)]
1010
#![feature(negative_impls)]
1111
#![feature(never_type)]
1212
#![feature(rustc_attrs)]

compiler/rustc_builtin_macros/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,13 @@
55
#![allow(internal_features)]
66
#![allow(rustc::diagnostic_outside_of_impl)]
77
#![allow(rustc::untranslatable_diagnostic)]
8+
#![cfg_attr(bootstrap, feature(if_let_guard))]
89
#![cfg_attr(not(bootstrap), feature(autodiff))]
910
#![doc(html_root_url = "https://doc.rust-lang.org/nightly/nightly-rustc/")]
1011
#![doc(rust_logo)]
1112
#![feature(assert_matches)]
1213
#![feature(box_patterns)]
1314
#![feature(decl_macro)]
14-
#![feature(if_let_guard)]
1515
#![feature(proc_macro_internals)]
1616
#![feature(proc_macro_quote)]
1717
#![feature(rustdoc_internals)]

compiler/rustc_codegen_gcc/example/alloc_system.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
// add fast paths for low alignment values.
99
#[cfg(any(target_arch = "x86",
1010
target_arch = "arm",
11+
target_arch = "loongarch32",
1112
target_arch = "m68k",
1213
target_arch = "mips",
1314
target_arch = "mips32r6",

compiler/rustc_codegen_llvm/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ gimli = "0.31"
1515
itertools = "0.12"
1616
libc = "0.2"
1717
measureme = "12.0.1"
18-
object = { version = "0.36.3", default-features = false, features = ["std", "read"] }
18+
object = { version = "0.37.0", default-features = false, features = ["std", "read"] }
1919
rustc-demangle = "0.1.21"
2020
rustc_abi = { path = "../rustc_abi" }
2121
rustc_ast = { path = "../rustc_ast" }

compiler/rustc_codegen_llvm/src/asm.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -251,7 +251,7 @@ impl<'ll, 'tcx> AsmBuilderMethods<'tcx> for Builder<'_, 'll, 'tcx> {
251251
InlineAsmArch::Nvptx64 => {}
252252
InlineAsmArch::PowerPC | InlineAsmArch::PowerPC64 => {}
253253
InlineAsmArch::Hexagon => {}
254-
InlineAsmArch::LoongArch64 => {
254+
InlineAsmArch::LoongArch32 | InlineAsmArch::LoongArch64 => {
255255
constraints.extend_from_slice(&[
256256
"~{$fcc0}".to_string(),
257257
"~{$fcc1}".to_string(),

compiler/rustc_codegen_llvm/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,13 @@
66
77
// tidy-alphabetical-start
88
#![allow(internal_features)]
9+
#![cfg_attr(bootstrap, feature(if_let_guard))]
910
#![doc(html_root_url = "https://doc.rust-lang.org/nightly/nightly-rustc/")]
1011
#![doc(rust_logo)]
1112
#![feature(assert_matches)]
1213
#![feature(exact_size_is_empty)]
1314
#![feature(extern_types)]
1415
#![feature(file_buffered)]
15-
#![feature(if_let_guard)]
1616
#![feature(impl_trait_in_assoc_type)]
1717
#![feature(iter_intersperse)]
1818
#![feature(rustdoc_internals)]

compiler/rustc_codegen_ssa/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ libc = "0.2.50"
5454
# tidy-alphabetical-end
5555

5656
[dependencies.object]
57-
version = "0.36.2"
57+
version = "0.37.0"
5858
default-features = false
5959
features = ["read_core", "elf", "macho", "pe", "xcoff", "unaligned", "archive", "write", "wasm"]
6060

compiler/rustc_codegen_ssa/src/back/link/raw_dylib.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -287,6 +287,7 @@ fn create_elf_raw_dylib_stub(sess: &Session, soname: &str, symbols: &[DllImport]
287287
(Architecture::X86_64, None) => elf::EM_X86_64,
288288
(Architecture::X86_64_X32, None) => elf::EM_X86_64,
289289
(Architecture::Hexagon, None) => elf::EM_HEXAGON,
290+
(Architecture::LoongArch32, None) => elf::EM_LOONGARCH,
290291
(Architecture::LoongArch64, None) => elf::EM_LOONGARCH,
291292
(Architecture::M68k, None) => elf::EM_68K,
292293
(Architecture::Mips, None) => elf::EM_MIPS,

0 commit comments

Comments
 (0)