Skip to content

Rollup of 14 pull requests #142175

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 40 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
40 commits
Select commit Hold shift + click to select a range
eec894d
Fix future-incompatible lint group test
Urgau May 1, 2025
80c6a08
Allow `#![doc(test(attr(..)))]` at module level too
Urgau May 1, 2025
9d9705f
Collect and use `#![doc(test(attr(..)))]` at module level too
Urgau May 1, 2025
041d95d
Allow `#![doc(test(attr(..)))]` doctests to be again merged together
Urgau May 1, 2025
316e62a
Allow `#![doc(test(attr(..)))]` at every level
Urgau May 5, 2025
d96d3be
Collect and use `#[doc(test(attr(..)))]` at every level
Urgau May 5, 2025
a08f6f1
document representation of `Option<unsafe fn()>`
y86-dev May 23, 2025
5bafe9d
Enable Float non-determinism in miri. Update and add tests and change
LorrensP-2158466 Mar 5, 2025
2579d41
add (back) unsupported_calling_conventions lint to reject more invali…
RalfJung May 23, 2025
638d170
raw dylib: ensure that we have applied standard ABI checks
RalfJung May 23, 2025
7c3fa82
avoid repeating error annotations in test file
RalfJung May 23, 2025
207b14a
add specific help messages for stdcall and cdecl
RalfJung May 29, 2025
27f8efb
Bump object
heiher Jun 4, 2025
53c1301
Stabilize `const_eq_ignore_ascii_case`
paolobarbolini Jun 5, 2025
00452bd
change tests to use fixed constants to let them pass with miri
LorrensP-2158466 May 30, 2025
a20a9aa
if let guard stabilize
Kivooeo May 20, 2025
38d69c3
Add new Tier-3 targets: `loongarch32-unknown-none*`
heiher Jan 9, 2025
46a936a
bootstrap: fix tracing imports
jieyouxu Jun 6, 2025
7efd90a
Treat normalizing consts like normalizing types in deeply normalize
compiler-errors Jun 6, 2025
aa1b296
Unify normalization of terms in deeply normalize
compiler-errors Jun 6, 2025
8aafcc8
compiler: Sort and doc ExternAbi variants
workingjubilee Jun 7, 2025
f66487b
compiler: Remove superfluous renaming import of ExternAbi
workingjubilee Jun 7, 2025
5bab0d2
compiler: Treat ForceWarning as a Warning for diagnostic level
workingjubilee Jun 7, 2025
6a6c595
get rid of spurious cfg(bootstrap)
RalfJung Jun 7, 2025
a87cd55
Make NonZero<char> possible
hkBst May 14, 2025
17946c2
const-eval error: always say in which item the error occurred
RalfJung Jun 7, 2025
4c53ddc
Rollup merge of #138062 - LorrensP-2158466:miri-enable-float-nondet, …
workingjubilee Jun 7, 2025
82beae9
Rollup merge of #140560 - Urgau:test_attr-module-level, r=GuillaumeGomez
workingjubilee Jun 7, 2025
544884c
Rollup merge of #141001 - hkBst:nonzero-char, r=dtolnay
workingjubilee Jun 7, 2025
95b115f
Rollup merge of #141295 - Kivooeo:if-let-guard-stable, r=est31,fee1-dead
workingjubilee Jun 7, 2025
db990d6
Rollup merge of #141435 - RalfJung:unsupported_calling_conventions, r…
workingjubilee Jun 7, 2025
7a6ea29
Rollup merge of #141447 - y86-dev:option-layout-docs, r=RalfJung
workingjubilee Jun 7, 2025
4bbb700
Rollup merge of #142008 - RalfJung:const-eval-error-here, r=oli-obk
workingjubilee Jun 7, 2025
94cfe81
Rollup merge of #142053 - heiher:loong32-none, r=wesleywiser
workingjubilee Jun 7, 2025
cdf7510
Rollup merge of #142065 - paolobarbolini:stabilize-const_eq_ignore_as…
workingjubilee Jun 7, 2025
bee5b8c
Rollup merge of #142116 - jieyouxu:fix-tracing, r=Mark-Simulacrum
workingjubilee Jun 7, 2025
ad726e0
Rollup merge of #142126 - compiler-errors:normalize-uv-via-relate, r=…
workingjubilee Jun 7, 2025
822b7d1
Rollup merge of #142140 - workingjubilee:sort-extern-abi-variants, r=…
workingjubilee Jun 7, 2025
277857e
Rollup merge of #142148 - workingjubilee:dont-ice-on-force-warn, r=Urgau
workingjubilee Jun 7, 2025
049d2da
Rollup merge of #142154 - RalfJung:no-more-cfg-bootstrap, r=oli-obk
workingjubilee Jun 7, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
47 changes: 30 additions & 17 deletions Cargo.lock
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ version = "0.4.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "01667f6f40216b9a0b2945e05fed5f1ad0ab6470e69cb9378001e37b1c0668e4"
dependencies = [
"object",
"object 0.36.7",
]

[[package]]
Expand Down Expand Up @@ -235,7 +235,7 @@ dependencies = [
"cfg-if",
"libc",
"miniz_oxide",
"object",
"object 0.36.7",
"rustc-demangle",
"windows-targets 0.52.6",
]
Expand Down Expand Up @@ -2509,7 +2509,19 @@ dependencies = [
"indexmap",
"memchr",
"ruzstd",
"wasmparser 0.222.1",
]

[[package]]
name = "object"
version = "0.37.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "6273adb7096cf9ab4335f258e627d8230e69d40d45567d678f552dcec6245215"
dependencies = [
"crc32fast",
"hashbrown",
"indexmap",
"memchr",
"wasmparser 0.232.0",
]

[[package]]
Expand Down Expand Up @@ -3109,7 +3121,7 @@ dependencies = [
"build_helper",
"gimli",
"libc",
"object",
"object 0.36.7",
"regex",
"serde_json",
"similar",
Expand Down Expand Up @@ -3422,7 +3434,7 @@ dependencies = [
"itertools",
"libc",
"measureme",
"object",
"object 0.37.0",
"rustc-demangle",
"rustc_abi",
"rustc_ast",
Expand Down Expand Up @@ -3463,7 +3475,7 @@ dependencies = [
"either",
"itertools",
"libc",
"object",
"object 0.37.0",
"pathdiff",
"regex",
"rustc_abi",
Expand Down Expand Up @@ -3786,6 +3798,7 @@ dependencies = [
"rustc_middle",
"rustc_session",
"rustc_span",
"rustc_target",
"rustc_trait_selection",
"smallvec",
"tracing",
Expand Down Expand Up @@ -4495,7 +4508,7 @@ name = "rustc_target"
version = "0.0.0"
dependencies = [
"bitflags",
"object",
"object 0.37.0",
"rustc_abi",
"rustc_data_structures",
"rustc_fs_util",
Expand Down Expand Up @@ -5247,7 +5260,7 @@ checksum = "9e9c1e705f82a260173f3eec93f2ff6d7807f23ad5a8cc2e7316a891733ea7a1"
dependencies = [
"gimli",
"hashbrown",
"object",
"object 0.36.7",
"tracing",
]

Expand Down Expand Up @@ -5908,15 +5921,6 @@ dependencies = [
"indexmap",
]

[[package]]
name = "wasmparser"
version = "0.222.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "fa210fd1788e6b37a1d1930f3389c48e1d6ebd1a013d34fa4b7f9e3e3bf03146"
dependencies = [
"bitflags",
]

[[package]]
name = "wasmparser"
version = "0.229.0"
Expand All @@ -5941,6 +5945,15 @@ dependencies = [
"semver",
]

[[package]]
name = "wasmparser"
version = "0.232.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "917739b33bb1eb0e9a49bcd2637a351931be4578d0cc4d37b908d7a797784fbb"
dependencies = [
"bitflags",
]

[[package]]
name = "wast"
version = "230.0.0"
Expand Down
99 changes: 63 additions & 36 deletions compiler/rustc_abi/src/extern_abi.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,66 +12,93 @@ use crate::AbiFromStrErr;
#[cfg(test)]
mod tests;

use ExternAbi as Abi;

/// ABI we expect to see within `extern "{abi}"`
#[derive(Clone, Copy, Debug)]
#[cfg_attr(feature = "nightly", derive(Encodable, Decodable))]
pub enum ExternAbi {
// Some of the ABIs come first because every time we add a new ABI, we have to re-bless all the
// hashing tests. These are used in many places, so giving them stable values reduces test
// churn. The specific values are meaningless.
Rust,
/* universal */
/// presumed C ABI for the platform
C {
unwind: bool,
},
Cdecl {
/// ABI of the "system" interface, e.g. the Win32 API, always "aliasing"
System {
unwind: bool,
},
Stdcall {

/// that's us!
Rust,
/// the mostly-unused `unboxed_closures` ABI, effectively now an impl detail unless someone
/// puts in the work to make it viable again... but would we need a special ABI?
RustCall,
/// For things unlikely to be called, where reducing register pressure in
/// `extern "Rust"` callers is worth paying extra cost in the callee.
/// Stronger than just `#[cold]` because `fn` pointers might be incompatible.
RustCold,

/// Unstable impl detail that directly uses Rust types to describe the ABI to LLVM.
/// Even normally-compatible Rust types can become ABI-incompatible with this ABI!
Unadjusted,

/// UEFI ABI, usually an alias of C, but sometimes an arch-specific alias
/// and only valid on platforms that have a UEFI standard
EfiApi,

/* arm */
/// Arm Architecture Procedure Call Standard, sometimes `ExternAbi::C` is an alias for this
Aapcs {
unwind: bool,
},
Fastcall {
/// extremely constrained barely-C ABI for TrustZone
CCmseNonSecureCall,
/// extremely constrained barely-C ABI for TrustZone
CCmseNonSecureEntry,

/* gpu */
/// An entry-point function called by the GPU's host
// FIXME: should not be callable from Rust on GPU targets, is for host's use only
GpuKernel,
/// An entry-point function called by the GPU's host
// FIXME: why do we have two of these?
PtxKernel,

/* interrupt */
AvrInterrupt,
AvrNonBlockingInterrupt,
Msp430Interrupt,
RiscvInterruptM,
RiscvInterruptS,
X86Interrupt,

/* x86 */
/// `ExternAbi::C` but spelled funny because x86
Cdecl {
unwind: bool,
},
Vectorcall {
/// gnu-stdcall on "unix" and win-stdcall on "windows"
Stdcall {
unwind: bool,
},
Thiscall {
/// gnu-fastcall on "unix" and win-fastcall on "windows"
Fastcall {
unwind: bool,
},
Aapcs {
/// windows C++ ABI
Thiscall {
unwind: bool,
},
Win64 {
/// uses AVX and stuff
Vectorcall {
unwind: bool,
},

/* x86_64 */
SysV64 {
unwind: bool,
},
PtxKernel,
Msp430Interrupt,
X86Interrupt,
/// An entry-point function called by the GPU's host
// FIXME: should not be callable from Rust on GPU targets, is for host's use only
GpuKernel,
EfiApi,
AvrInterrupt,
AvrNonBlockingInterrupt,
CCmseNonSecureCall,
CCmseNonSecureEntry,
System {
Win64 {
unwind: bool,
},
RustCall,
/// *Not* a stable ABI, just directly use the Rust types to describe the ABI for LLVM. Even
/// normally ABI-compatible Rust types can become ABI-incompatible with this ABI!
Unadjusted,
/// For things unlikely to be called, where reducing register pressure in
/// `extern "Rust"` callers is worth paying extra cost in the callee.
/// Stronger than just `#[cold]` because `fn` pointers might be incompatible.
RustCold,
RiscvInterruptM,
RiscvInterruptS,
}

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

impl ExternAbi {
/// Default ABI chosen for `extern fn` declarations without an explicit ABI.
pub const FALLBACK: Abi = Abi::C { unwind: false };
pub const FALLBACK: ExternAbi = ExternAbi::C { unwind: false };

pub fn name(self) -> &'static str {
self.as_str()
Expand Down
2 changes: 1 addition & 1 deletion compiler/rustc_ast/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
// tidy-alphabetical-start
#![allow(internal_features)]
#![cfg_attr(bootstrap, feature(if_let_guard))]
#![doc(
html_root_url = "https://doc.rust-lang.org/nightly/nightly-rustc/",
test(attr(deny(warnings)))
Expand All @@ -14,7 +15,6 @@
#![feature(array_windows)]
#![feature(associated_type_defaults)]
#![feature(box_patterns)]
#![feature(if_let_guard)]
#![feature(macro_metavar_expr)]
#![feature(negative_impls)]
#![feature(never_type)]
Expand Down
2 changes: 1 addition & 1 deletion compiler/rustc_ast_lowering/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -32,11 +32,11 @@
// tidy-alphabetical-start
#![allow(internal_features)]
#![cfg_attr(bootstrap, feature(if_let_guard))]
#![doc(rust_logo)]
#![feature(assert_matches)]
#![feature(box_patterns)]
#![feature(exact_size_is_empty)]
#![feature(if_let_guard)]
#![feature(rustdoc_internals)]
// tidy-alphabetical-end

Expand Down
5 changes: 0 additions & 5 deletions compiler/rustc_ast_passes/src/feature_gate.rs
Original file line number Diff line number Diff line change
Expand Up @@ -454,11 +454,6 @@ pub fn check_crate(krate: &ast::Crate, sess: &Session, features: &Features) {
}
};
}
gate_all!(
if_let_guard,
"`if let` guards are experimental",
"you can write `if matches!(<expr>, <pattern>)` instead of `if let <pattern> = <expr>`"
);
gate_all!(let_chains, "`let` expressions in this position are unstable");
gate_all!(
async_trait_bounds,
Expand Down
2 changes: 1 addition & 1 deletion compiler/rustc_ast_passes/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@
// tidy-alphabetical-start
#![allow(internal_features)]
#![cfg_attr(bootstrap, feature(if_let_guard))]
#![doc(rust_logo)]
#![feature(box_patterns)]
#![feature(if_let_guard)]
#![feature(iter_is_partitioned)]
#![feature(rustdoc_internals)]
// tidy-alphabetical-end
Expand Down
2 changes: 1 addition & 1 deletion compiler/rustc_borrowck/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@
// tidy-alphabetical-start
#![allow(internal_features)]
#![cfg_attr(bootstrap, feature(if_let_guard))]
#![doc(rust_logo)]
#![feature(assert_matches)]
#![feature(box_patterns)]
#![feature(file_buffered)]
#![feature(if_let_guard)]
#![feature(negative_impls)]
#![feature(never_type)]
#![feature(rustc_attrs)]
Expand Down
2 changes: 1 addition & 1 deletion compiler/rustc_builtin_macros/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,13 @@
#![allow(internal_features)]
#![allow(rustc::diagnostic_outside_of_impl)]
#![allow(rustc::untranslatable_diagnostic)]
#![cfg_attr(bootstrap, feature(if_let_guard))]
#![cfg_attr(not(bootstrap), feature(autodiff))]
#![doc(html_root_url = "https://doc.rust-lang.org/nightly/nightly-rustc/")]
#![doc(rust_logo)]
#![feature(assert_matches)]
#![feature(box_patterns)]
#![feature(decl_macro)]
#![feature(if_let_guard)]
#![feature(proc_macro_internals)]
#![feature(proc_macro_quote)]
#![feature(rustdoc_internals)]
Expand Down
1 change: 1 addition & 0 deletions compiler/rustc_codegen_gcc/example/alloc_system.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
// add fast paths for low alignment values.
#[cfg(any(target_arch = "x86",
target_arch = "arm",
target_arch = "loongarch32",
target_arch = "m68k",
target_arch = "mips",
target_arch = "mips32r6",
Expand Down
2 changes: 1 addition & 1 deletion compiler/rustc_codegen_llvm/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ gimli = "0.31"
itertools = "0.12"
libc = "0.2"
measureme = "12.0.1"
object = { version = "0.36.3", default-features = false, features = ["std", "read"] }
object = { version = "0.37.0", default-features = false, features = ["std", "read"] }
rustc-demangle = "0.1.21"
rustc_abi = { path = "../rustc_abi" }
rustc_ast = { path = "../rustc_ast" }
Expand Down
2 changes: 1 addition & 1 deletion compiler/rustc_codegen_llvm/src/asm.rs
Original file line number Diff line number Diff line change
Expand Up @@ -251,7 +251,7 @@ impl<'ll, 'tcx> AsmBuilderMethods<'tcx> for Builder<'_, 'll, 'tcx> {
InlineAsmArch::Nvptx64 => {}
InlineAsmArch::PowerPC | InlineAsmArch::PowerPC64 => {}
InlineAsmArch::Hexagon => {}
InlineAsmArch::LoongArch64 => {
InlineAsmArch::LoongArch32 | InlineAsmArch::LoongArch64 => {
constraints.extend_from_slice(&[
"~{$fcc0}".to_string(),
"~{$fcc1}".to_string(),
Expand Down
2 changes: 1 addition & 1 deletion compiler/rustc_codegen_llvm/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,13 @@
// tidy-alphabetical-start
#![allow(internal_features)]
#![cfg_attr(bootstrap, feature(if_let_guard))]
#![doc(html_root_url = "https://doc.rust-lang.org/nightly/nightly-rustc/")]
#![doc(rust_logo)]
#![feature(assert_matches)]
#![feature(exact_size_is_empty)]
#![feature(extern_types)]
#![feature(file_buffered)]
#![feature(if_let_guard)]
#![feature(impl_trait_in_assoc_type)]
#![feature(iter_intersperse)]
#![feature(rustdoc_internals)]
Expand Down
2 changes: 1 addition & 1 deletion compiler/rustc_codegen_ssa/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ libc = "0.2.50"
# tidy-alphabetical-end

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

Expand Down
1 change: 1 addition & 0 deletions compiler/rustc_codegen_ssa/src/back/link/raw_dylib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -287,6 +287,7 @@ fn create_elf_raw_dylib_stub(sess: &Session, soname: &str, symbols: &[DllImport]
(Architecture::X86_64, None) => elf::EM_X86_64,
(Architecture::X86_64_X32, None) => elf::EM_X86_64,
(Architecture::Hexagon, None) => elf::EM_HEXAGON,
(Architecture::LoongArch32, None) => elf::EM_LOONGARCH,
(Architecture::LoongArch64, None) => elf::EM_LOONGARCH,
(Architecture::M68k, None) => elf::EM_68K,
(Architecture::Mips, None) => elf::EM_MIPS,
Expand Down
Loading
Loading