From 0e58273c323f221f1c0f009c74edf9191b9a5ff5 Mon Sep 17 00:00:00 2001 From: bjorn3 <17426603+bjorn3@users.noreply.github.com> Date: Wed, 19 Aug 2026 19:39:57 +0200 Subject: [PATCH 01/22] Merge commit 'bb351cd4ddf59d8a9b5c086a15e41bc6a1c05b5f' into sync_cg_clif-2026-08-19 --- rust-toolchain.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rust-toolchain.toml b/rust-toolchain.toml index ff51f49edc4ca..ea4ff67c93c89 100644 --- a/rust-toolchain.toml +++ b/rust-toolchain.toml @@ -1,4 +1,4 @@ [toolchain] -channel = "nightly-2026-08-17" +channel = "nightly-2026-08-19" components = ["rust-src", "rustc-dev", "llvm-tools", "rustfmt"] profile = "minimal" From 1aa628913f2d2e6b1ae58ceaa1ecba6a4b4b9c06 Mon Sep 17 00:00:00 2001 From: mejrs <59372212+mejrs@users.noreply.github.com> Date: Mon, 17 Aug 2026 17:59:33 +0200 Subject: [PATCH 02/22] move CrateType --- src/driver/jit.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/driver/jit.rs b/src/driver/jit.rs index 32f60615844bc..8bf1cd9bf85bc 100644 --- a/src/driver/jit.rs +++ b/src/driver/jit.rs @@ -37,7 +37,7 @@ fn create_jit_module( } pub(crate) fn run_jit(tcx: TyCtxt<'_>, target_cpu: String, jit_args: Vec) -> ! { - if !tcx.crate_types().contains(&rustc_session::config::CrateType::Executable) { + if !tcx.crate_types().contains(&rustc_structures::CrateType::Executable) { tcx.dcx().fatal("can't jit non-executable crate"); } @@ -180,7 +180,7 @@ fn dep_symbol_lookup_fn( let mut dylib_paths = Vec::new(); - let data = &crate_info.dependency_formats[&rustc_session::config::CrateType::Executable]; + let data = &crate_info.dependency_formats[&rustc_structures::CrateType::Executable]; // `used_crates` is in reverse postorder in terms of dependencies. Reverse the order here to // get a postorder which ensures that all dependencies of a dylib are loaded before the dylib // itself. This helps the dynamic linker to find dylibs not in the regular dynamic library From 01c4315ac4f8348c6ec8d6ac3665342a03971a1b Mon Sep 17 00:00:00 2001 From: Rudraksh Joshi Date: Fri, 21 Aug 2026 21:39:26 +0530 Subject: [PATCH 03/22] Remove LD_STATIC_TLS_EXTRA workaround from FreeBSD CI --- .github/workflows/freebsd.yml | 3 --- Readme.md | 3 +-- 2 files changed, 1 insertion(+), 5 deletions(-) diff --git a/.github/workflows/freebsd.yml b/.github/workflows/freebsd.yml index f344113aa7fdf..e0b2bd34631f9 100644 --- a/.github/workflows/freebsd.yml +++ b/.github/workflows/freebsd.yml @@ -34,8 +34,5 @@ jobs: # Disabling incr comp reduces cache size and incr comp doesn't save # as much on CI anyway. export CARGO_BUILD_INCREMENTAL=false - # FIXME(rust-lang/rust#134863) necessary to avoid error when - # dlopening proc macros during compilation of cg_clif. - export LD_STATIC_TLS_EXTRA=4096 # Skip rand as it fails on FreeBSD due to rust-random/rand#1355 ./y.sh test --skip-test test.rust-random/rand diff --git a/Readme.md b/Readme.md index c5436cf67c80a..48003ad270e6f 100644 --- a/Readme.md +++ b/Readme.md @@ -66,7 +66,7 @@ For more docs on how to build and test see [build_system/usage.txt](build_system |OS \ architecture|x86\_64|AArch64|Riscv64|s390x (System-Z)| |---|---|---|---|---| |Linux|✅|✅|✅[^no-rustup]|✅[^no-rustup]| -|FreeBSD|✅[^no-rustup][^tls]|❓|❓|❓| +|FreeBSD|✅[^no-rustup]|❓|❓|❓| |AIX|❌[^xcoff]|N/A|N/A|❌[^xcoff]| |Other unixes|❓|❓|❓|❓| |macOS|✅|✅|N/A|N/A| @@ -80,7 +80,6 @@ Not all targets are available as rustup component for nightly. See notes in the [^xcoff]: XCOFF object file format is not supported. [^no-rustup]: Not available as [rustup component for nightly](https://rust-lang.github.io/rustup-components-history/). You can build it yourself. -[^tls]: FreeBSD requires setting `LD_STATIC_TLS_EXTRA=4096` to build cg_clif. In addition you need at least FreeBSD 14. ## Usage From 945a71a6c4782621dcaed1a633b89dfdfdad7720 Mon Sep 17 00:00:00 2001 From: Folkert de Vries Date: Wed, 29 Jul 2026 11:10:21 +0200 Subject: [PATCH 04/22] make `pad_i32` of `PassMode::cast` an integer so that we can specify more than one i32 of padding. --- src/abi/pass_mode.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/abi/pass_mode.rs b/src/abi/pass_mode.rs index c4d4ddcf6b753..1c552ca1a9c32 100644 --- a/src/abi/pass_mode.rs +++ b/src/abi/pass_mode.rs @@ -122,8 +122,8 @@ impl<'tcx> ArgAbiExt<'tcx> for ArgAbi<'tcx, Ty<'tcx>> { } _ => unreachable!("{:?}", self.layout.backend_repr), }, - PassMode::Cast { ref cast, pad_i32 } => { - assert!(!pad_i32, "padding support not yet implemented"); + PassMode::Cast { ref cast, pad_i32_count } => { + assert_eq!(pad_i32_count, 0, "padding support not yet implemented"); cast_target_to_abi_params(cast).into_iter().map(|(_, param)| param).collect() } PassMode::Indirect { attrs, meta_attrs: None, on_stack } => { From a299bc115f895ab38e874c8e499a5e79edf2e404 Mon Sep 17 00:00:00 2001 From: bjorn3 <17426603+bjorn3@users.noreply.github.com> Date: Mon, 24 Aug 2026 12:06:36 +0200 Subject: [PATCH 05/22] Rustup to rustc 1.100.0-nightly (fb6531d55 2026-08-23) --- build_system/build_sysroot.rs | 1 - rust-toolchain.toml | 2 +- src/lib.rs | 1 + 3 files changed, 2 insertions(+), 2 deletions(-) diff --git a/build_system/build_sysroot.rs b/build_system/build_sysroot.rs index 71c0523615ff1..3ac7724f8f318 100644 --- a/build_system/build_sysroot.rs +++ b/build_system/build_sysroot.rs @@ -252,7 +252,6 @@ fn build_clif_sysroot_for_target( build_cmd.arg("--features").arg("backtrace panic-unwind"); build_cmd.arg(format!("-Zroot-dir={}", STDLIB_SRC.to_path(dirs).display())); build_cmd.arg("-Zembed-metadata=no"); - build_cmd.arg("-Zbuild-dir-new-layout"); build_cmd.env("CARGO_PROFILE_RELEASE_DEBUG", "true"); build_cmd.env("__CARGO_DEFAULT_LIB_METADATA", "cg_clif"); if compiler.target.contains("apple") { diff --git a/rust-toolchain.toml b/rust-toolchain.toml index ea4ff67c93c89..e203b3305eda1 100644 --- a/rust-toolchain.toml +++ b/rust-toolchain.toml @@ -1,4 +1,4 @@ [toolchain] -channel = "nightly-2026-08-19" +channel = "nightly-2026-08-24" components = ["rust-src", "rustc-dev", "llvm-tools", "rustfmt"] profile = "minimal" diff --git a/src/lib.rs b/src/lib.rs index 71fce9e28f120..d00631e5ab543 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -23,6 +23,7 @@ extern crate rustc_index; extern crate rustc_log; extern crate rustc_session; extern crate rustc_span; +extern crate rustc_structures; extern crate rustc_symbol_mangling; extern crate rustc_target; From 19946d3e45939e67a32fb9e52dc94bd9b9fd7832 Mon Sep 17 00:00:00 2001 From: bjorn3 <17426603+bjorn3@users.noreply.github.com> Date: Mon, 24 Aug 2026 14:34:35 +0200 Subject: [PATCH 06/22] Fix rustc test suite --- scripts/test_rustc_tests.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/scripts/test_rustc_tests.sh b/scripts/test_rustc_tests.sh index 3885561e94a1e..4db6fe35f65c6 100755 --- a/scripts/test_rustc_tests.sh +++ b/scripts/test_rustc_tests.sh @@ -174,6 +174,7 @@ rm tests/ui/process/println-with-broken-pipe.rs # same rm -r tests/run-make/extern-fn-explicit-align # argument alignment not yet supported rm -r tests/run-make/panic-abort-eh_frame # .eh_frame emitted with panic=abort rm -r tests/run-make/used-proc-macro # doesn't work on arm64 for some reason +rm tests/ui/async-await/async-drop/async-drop-async-gen-return-pending.rs # rustc side fnsig issue # bugs in the test suite # ====================== From b5534e25c52eb7a473534cea604701f7cb91d32d Mon Sep 17 00:00:00 2001 From: bjorn3 <17426603+bjorn3@users.noreply.github.com> Date: Mon, 24 Aug 2026 15:06:32 +0200 Subject: [PATCH 07/22] Fix warning --- src/lib.rs | 1 + 1 file changed, 1 insertion(+) diff --git a/src/lib.rs b/src/lib.rs index d00631e5ab543..6d2a353745235 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -23,6 +23,7 @@ extern crate rustc_index; extern crate rustc_log; extern crate rustc_session; extern crate rustc_span; +#[cfg(feature = "jit")] extern crate rustc_structures; extern crate rustc_symbol_mangling; extern crate rustc_target; From 2bc05d45078dbee6495c008cbd5d1dc24edff53f Mon Sep 17 00:00:00 2001 From: bjorn3 <17426603+bjorn3@users.noreply.github.com> Date: Thu, 6 Aug 2026 11:21:09 +0200 Subject: [PATCH 08/22] Update to Cranelift 0.135 Co-Authored-By: Mads Marquart --- Cargo.lock | 77 ++++++++++++++++++++--------------------- Cargo.toml | 24 ++++++------- src/constant.rs | 44 +---------------------- src/debuginfo/unwind.rs | 2 +- 4 files changed, 52 insertions(+), 95 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 88ea75a6b0299..80bbbfe4e9bc1 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -43,27 +43,27 @@ checksum = "9330f8b2ff13f34540b44e946ef35111825727b38d33286ef986142615121801" [[package]] name = "cranelift-assembler-x64" -version = "0.134.0" +version = "0.135.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a25c5b1bb1d86ae68dca1826a1b668b9951056c42e0eef89e35942c7001eb481" +checksum = "a4a59ddc4abd9c5560f4742864b2cd8c19e73c7263f0c866b2c45c2d31587adc" dependencies = [ "cranelift-assembler-x64-meta", ] [[package]] name = "cranelift-assembler-x64-meta" -version = "0.134.0" +version = "0.135.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c1b052a1fd94b4565697c56f9d358723c7c354feef42a6569081225c1bed6e86" +checksum = "8a8c361cd22fd0fdd8e61af6bfd86ad9c0c62f78b2b1caa2b9e4e97cd8f605fe" dependencies = [ "cranelift-srcgen", ] [[package]] name = "cranelift-bforest" -version = "0.134.0" +version = "0.135.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a599e8ffa6a1a118d2dce4809073ad2f2534b1ae1c6d55697b6b8a324446c971" +checksum = "b86c34ae183cf2410318f899648fe1ef6ab9148486e7b938d7b4d814e61dafc9" dependencies = [ "cranelift-entity", "wasmtime-internal-core", @@ -71,18 +71,18 @@ dependencies = [ [[package]] name = "cranelift-bitset" -version = "0.134.0" +version = "0.135.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1e1ae13182fadc731b1387287b4c6d257b9191fbb7c980ebb2d74c2db74b743e" +checksum = "415f1a12668869e16ac3b66a729fb8cce8bbe6e50e68d1fa0142acd0c9c05f0c" dependencies = [ "wasmtime-internal-core", ] [[package]] name = "cranelift-codegen" -version = "0.134.0" +version = "0.135.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dce9c62e5e11d12f4a8f5f939f29899f32002d38193b47491e2539705a1d447e" +checksum = "73eecedc85ffca4f34dbe197c6545c8ade6579a61352457936f53c3bffa6353b" dependencies = [ "bumpalo", "cranelift-assembler-x64", @@ -107,9 +107,9 @@ dependencies = [ [[package]] name = "cranelift-codegen-meta" -version = "0.134.0" +version = "0.135.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3c29d6b53cfd758dc1a269310fc92199056db03943b9b774b4911cd615e02ad7" +checksum = "66834005198c3e9e3d89cd69cf1541419402ab75250afbeaa3128db6d5254025" dependencies = [ "cranelift-assembler-x64-meta", "cranelift-codegen-shared", @@ -119,24 +119,24 @@ dependencies = [ [[package]] name = "cranelift-codegen-shared" -version = "0.134.0" +version = "0.135.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8cd8cfe23f3349bfa62e06a450cd94cf5f84fbe78556f4df3276534c4b93d834" +checksum = "7e6efaf74077091a2ff41317cc8eb2779264dae4b8a16d955835f3fcda338f52" [[package]] name = "cranelift-control" -version = "0.134.0" +version = "0.135.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f991b4712f21d9502758f7e6cb11746ca2e6186b06c42995eaf31b1e50a9c498" +checksum = "a4258d4ed6ad4e698fe1fec4277b1fcbea6f2a17cb5ec3f04bddfb38ca83d93e" dependencies = [ "arbitrary", ] [[package]] name = "cranelift-entity" -version = "0.134.0" +version = "0.135.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5e24f9c233a43730e22cf42ab0c03f41265e147eca97b3362be01e0da359d7a5" +checksum = "4f016b6f87b1a46a3f5df59b82d88bb352bf2fa6d7868875dfc4d6b65de5242d" dependencies = [ "cranelift-bitset", "wasmtime-internal-core", @@ -144,9 +144,9 @@ dependencies = [ [[package]] name = "cranelift-frontend" -version = "0.134.0" +version = "0.135.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "61325401051d35ddbf8e2b5d5b5dec8dd54688c9054046b62e76146e61c88a99" +checksum = "b16f2b149dae6ea3886bee931445196d86d8e71b66f7c3b21abe434f77189be8" dependencies = [ "cranelift-codegen", "hashbrown 0.17.0", @@ -157,15 +157,15 @@ dependencies = [ [[package]] name = "cranelift-isle" -version = "0.134.0" +version = "0.135.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "62f71d642812aa70284750719efbd2cc5ad7e7c5e6c43c026b5b0686ce8a6052" +checksum = "f00258ff3d37f52ed731df679205e66175c728846dbde186ee20e93973d12ee7" [[package]] name = "cranelift-jit" -version = "0.134.0" +version = "0.135.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "92a0f9300c8a5738553a440fe4f25b85f574d5c41b946880dabd47c809f87997" +checksum = "fa063cc98af51fb9090cd40b674503e21bdfa705d2bff75ebf98b79ffc0f598d" dependencies = [ "anyhow", "cranelift-codegen", @@ -184,9 +184,9 @@ dependencies = [ [[package]] name = "cranelift-module" -version = "0.134.0" +version = "0.135.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5f723983af35e690c4e2fc160df5d8895bb4a419a54d693367163d781bd830cc" +checksum = "bff0025f1ff6a0470cbd2a61b125f8501311ea9e6c46ed5bb2110ee6710c6a76" dependencies = [ "anyhow", "cranelift-codegen", @@ -195,9 +195,9 @@ dependencies = [ [[package]] name = "cranelift-native" -version = "0.134.0" +version = "0.135.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b5c50cffac70c30cc5d0b1d8d287e7712dc76b1181c43697de63d27f38236ddd" +checksum = "4f31eb7e08f31e5bc9c167c35718b0325efa3d4e234e2e9342316e01b18a4b51" dependencies = [ "cranelift-codegen", "libc", @@ -206,9 +206,9 @@ dependencies = [ [[package]] name = "cranelift-object" -version = "0.134.0" +version = "0.135.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "430e18f4886ba98f6a7dbb82c86df19f28f27cac417611e5dcc427a7a8decac9" +checksum = "7ca0d86955529d5b9041c4c07745f6ffa42c32326e9f467a834e2b7bd9a9d156" dependencies = [ "anyhow", "cranelift-codegen", @@ -221,9 +221,9 @@ dependencies = [ [[package]] name = "cranelift-srcgen" -version = "0.134.0" +version = "0.135.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bc5972dc0a5df7ba6f11e8e1654287c40ea1704ca6ce3b76ef54fa58445ee4ad" +checksum = "2e0b67d313f510520f40c1496c3446af0d6b30219d1ba9a4c09c77ec288a561b" [[package]] name = "crc32fast" @@ -379,9 +379,9 @@ dependencies = [ [[package]] name = "regalloc2" -version = "0.15.1" +version = "0.15.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "de2c52737737f8609e94f975dee22854a2d5c125772d4b1cf292120f4d45c186" +checksum = "757712e8e61590d6d4f5d563483755538b5aa13467837a3b41cd9832509a7f85" dependencies = [ "allocator-api2", "bumpalo", @@ -493,9 +493,9 @@ checksum = "9312f7c4f6ff9069b165498234ce8be658059c6728633667c526e27dc2cf1df5" [[package]] name = "wasmtime-internal-core" -version = "47.0.0" +version = "48.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "852f3326264aea590131a422e3ecb33fae3b6695fd67e2e202e2799cd8d27629" +checksum = "2c01c81d781512e17b38c3a76ca9aa2564bc3f9fd8ff6ffc77ba3e1c290d488a" dependencies = [ "hashbrown 0.17.0", "libm", @@ -503,11 +503,10 @@ dependencies = [ [[package]] name = "wasmtime-internal-jit-icache-coherence" -version = "47.0.0" +version = "48.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e537f59b5ab127ca2d421ecbd8728d70bd6cdc9891cec193fb1f594c3309836c" +checksum = "2a09abde04346919af1136a28f344e200685509e28815aef4c39dc08977cc1d8" dependencies = [ - "cfg-if", "libc", "wasmtime-internal-core", "windows-sys 0.61.2", diff --git a/Cargo.toml b/Cargo.toml index cb595332bac61..ca03be20cd100 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -8,12 +8,12 @@ crate-type = ["dylib"] [dependencies] # These have to be in sync with each other -cranelift-codegen = { version = "0.134.0", default-features = false, features = ["std", "timing", "unwind", "all-native-arch"] } -cranelift-frontend = { version = "0.134.0" } -cranelift-module = { version = "0.134.0" } -cranelift-native = { version = "0.134.0" } -cranelift-jit = { version = "0.134.0", optional = true } -cranelift-object = { version = "0.134.0", default-features = false } +cranelift-codegen = { version = "0.135.0", default-features = false, features = ["std", "timing", "unwind", "all-native-arch"] } +cranelift-frontend = { version = "0.135.0" } +cranelift-module = { version = "0.135.0" } +cranelift-native = { version = "0.135.0" } +cranelift-jit = { version = "0.135.0", optional = true } +cranelift-object = { version = "0.135.0", default-features = false } target-lexicon = "0.13" gimli = { version = "0.33", default-features = false, features = ["write"] } object = { version = "0.39.1", default-features = false, features = ["std", "read_core", "write", "archive", "coff", "elf", "macho", "pe"] } @@ -24,12 +24,12 @@ smallvec = "1.8.1" # Uncomment to use an unreleased version of cranelift #[patch.crates-io] -#cranelift-codegen = { git = "https://github.com/bytecodealliance/wasmtime.git", branch = "release-47.0.0" } -#cranelift-frontend = { git = "https://github.com/bytecodealliance/wasmtime.git", branch = "release-47.0.0" } -#cranelift-module = { git = "https://github.com/bytecodealliance/wasmtime.git", branch = "release-47.0.0" } -#cranelift-native = { git = "https://github.com/bytecodealliance/wasmtime.git", branch = "release-47.0.0" } -#cranelift-jit = { git = "https://github.com/bytecodealliance/wasmtime.git", branch = "release-47.0.0" } -#cranelift-object = { git = "https://github.com/bytecodealliance/wasmtime.git", branch = "release-47.0.0" } +#cranelift-codegen = { git = "https://github.com/bytecodealliance/wasmtime.git", branch = "release-48.0.0" } +#cranelift-frontend = { git = "https://github.com/bytecodealliance/wasmtime.git", branch = "release-48.0.0" } +#cranelift-module = { git = "https://github.com/bytecodealliance/wasmtime.git", branch = "release-48.0.0" } +#cranelift-native = { git = "https://github.com/bytecodealliance/wasmtime.git", branch = "release-48.0.0" } +#cranelift-jit = { git = "https://github.com/bytecodealliance/wasmtime.git", branch = "release-48.0.0" } +#cranelift-object = { git = "https://github.com/bytecodealliance/wasmtime.git", branch = "release-48.0.0" } # Uncomment to use local checkout of cranelift #cranelift-codegen = { path = "../wasmtime/cranelift/codegen" } diff --git a/src/constant.rs b/src/constant.rs index b1cb5f30cbdfe..e2b0035361733 100644 --- a/src/constant.rs +++ b/src/constant.rs @@ -415,49 +415,7 @@ fn define_all_allocs(tcx: TyCtxt<'_>, module: &mut dyn Module, cx: &mut Constant data.set_align(alloc.align.bytes()); if let Some(section_name) = section_name { - let (segment_name, section_name) = if tcx.sess.target.is_like_darwin { - // See https://github.com/llvm/llvm-project/blob/main/llvm/lib/MC/MCSectionMachO.cpp - let mut parts = section_name.as_str().split(','); - let Some(segment_name) = parts.next() else { - tcx.dcx().fatal(format!( - "#[link_section = \"{}\"] is not valid for macos target: must be segment and section separated by comma", - section_name - )); - }; - let Some(section_name) = parts.next() else { - tcx.dcx().fatal(format!( - "#[link_section = \"{}\"] is not valid for macos target: must be segment and section separated by comma", - section_name - )); - }; - if section_name.len() > 16 { - tcx.dcx().fatal(format!( - "#[link_section = \"{}\"] is not valid for macos target: section name bigger than 16 bytes", - section_name - )); - } - let section_type = parts.next().unwrap_or("regular"); - if section_type != "regular" && section_type != "cstring_literals" { - tcx.dcx().fatal(format!( - "#[link_section = \"{}\"] is not supported: unsupported section type {}", - section_name, section_type, - )); - } - let _attrs = parts.next(); - if parts.next().is_some() { - tcx.dcx().fatal(format!( - "#[link_section = \"{}\"] is not valid for macos target: too many components", - section_name - )); - } - // FIXME(bytecodealliance/wasmtime#8901) set S_CSTRING_LITERALS section type when - // cstring_literals is specified - (segment_name, section_name) - } else { - ("", section_name.as_str()) - }; - // FIXME pass correct section flags on Mach-O - data.set_segment_section(segment_name, section_name, 0); + data.set_custom_section(section_name.as_str()); } let bytes = alloc.inspect_with_uninit_and_ptr_outside_interpreter(0..alloc.len()).to_vec(); diff --git a/src/debuginfo/unwind.rs b/src/debuginfo/unwind.rs index 4b0260a8abc74..ad0a15bf7f6e5 100644 --- a/src/debuginfo/unwind.rs +++ b/src/debuginfo/unwind.rs @@ -204,7 +204,7 @@ impl UnwindContext { let mut data = DataDescription::new(); data.define(gcc_except_table.writer.into_vec().into_boxed_slice()); - data.set_segment_section("", ".gcc_except_table", 0); + data.set_custom_section(".gcc_except_table"); for reloc in &gcc_except_table.relocs { match reloc.name { From e960d5e379d55ee779a20b9a8eadfc332320b6d9 Mon Sep 17 00:00:00 2001 From: Aapo Alasuutari Date: Thu, 27 Aug 2026 20:03:59 +0000 Subject: [PATCH 09/22] fix(reborrow): recursive implementation * Implement Reborrow as a recursive operation If Reborrow finds '&'a mut T' fields then it inserts a Deref and borrow of the T, and likewise if it finds a 'T: Reborrow' field then the field type is recursed into. This makes Reborrow always produce the correct borrow checking logic at the cost of most probably being inconsiderately expensive. The thinking is that performance will be a followup consideration. * PhantomDeref * Simpler deref test * Add more PhantomDeref unreachability assertions * Write out lifetime omission * Document ProjectionElem::PhantomDeref * Comment half of reborrow tests * fix PhantomDeref conflicting with AccessDepth::Shallow * Recheck CoerceShared in borrowck TypeChecker to ensure its lifetimes make sense * Fix rebase * Changes... but where to? * Typo fix * Improve comment * Use fully_perform_op to evaluate CoerceShared trait in borrowck * More CoerceShared comment * Comment rest of Reborrow tests Co-authored-by: Oli Scherer --- src/base.rs | 1 + 1 file changed, 1 insertion(+) diff --git a/src/base.rs b/src/base.rs index 27bb19c8d53c5..f9cf35e754ea0 100644 --- a/src/base.rs +++ b/src/base.rs @@ -994,6 +994,7 @@ pub(crate) fn codegen_place<'tcx>( PlaceElem::Deref => { cplace = cplace.place_deref(fx); } + PlaceElem::PhantomDeref => bug!("encountered PhantomDeref in codegen"), PlaceElem::OpaqueCast(ty) => bug!("encountered OpaqueCast({ty}) in codegen"), PlaceElem::UnwrapUnsafeBinder(ty) => { cplace = cplace.place_transmute_type(fx, fx.monomorphize(ty)); From 61f4a731ec249984831214acde275e62ae53bd51 Mon Sep 17 00:00:00 2001 From: Hanna Kruppe Date: Sat, 29 Aug 2026 13:32:29 +0200 Subject: [PATCH 10/22] Remove -Zsaturating-float-casts flag I added this flag back in 2017 to enable benchmarking of the saturating semantics when it was newly implemented and still experimental. But saturation has been the official semantics for float<->int `as` casts for years now. A flag for turning it off no longer serves any purpose, it's just `-Zplease-miscompile-casts` now. --- src/cast.rs | 4 ---- src/codegen_f16_f128.rs | 4 ---- 2 files changed, 8 deletions(-) diff --git a/src/cast.rs b/src/cast.rs index f124739d1e154..abf4326f91888 100644 --- a/src/cast.rs +++ b/src/cast.rs @@ -148,10 +148,6 @@ pub(crate) fn clif_int_or_float_cast( fx.bcx.ins().fcvt_to_uint_sat(to_ty, from) }; - if let Some(false) = fx.tcx.sess.opts.unstable_opts.saturating_float_casts { - return val; - } - let is_not_nan = fx.bcx.ins().fcmp(FloatCC::Equal, from, from); let zero = type_zero_value(&mut fx.bcx, to_ty); fx.bcx.ins().select(is_not_nan, val, zero) diff --git a/src/codegen_f16_f128.rs b/src/codegen_f16_f128.rs index 3dbd59c2fca4d..09762f1a451b6 100644 --- a/src/codegen_f16_f128.rs +++ b/src/codegen_f16_f128.rs @@ -265,10 +265,6 @@ pub(crate) fn codegen_cast( fx.bcx.ins().ireduce(to_ty, val) }; - if let Some(false) = fx.tcx.sess.opts.unstable_opts.saturating_float_casts { - return val; - } - let is_not_nan = fcmp(fx, FloatCC::Equal, from, from); let zero = type_zero_value(&mut fx.bcx, to_ty); fx.bcx.ins().select(is_not_nan, val, zero) From ee07e8511f704208269d2dd694e12e65f6cb12bf Mon Sep 17 00:00:00 2001 From: Scott McMurray Date: Thu, 13 Aug 2026 22:03:50 -0700 Subject: [PATCH 11/22] Add intrinsics for integer minimum and maximum --- src/intrinsics/mod.rs | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/src/intrinsics/mod.rs b/src/intrinsics/mod.rs index 4a779e22870f6..584e4a895be9b 100644 --- a/src/intrinsics/mod.rs +++ b/src/intrinsics/mod.rs @@ -630,6 +630,26 @@ fn codegen_regular_intrinsic_call<'tcx>( let res = crate::num::codegen_int_binop(fx, BinOp::Div, x, y); ret.write_cvalue(fx, res); } + // FIXME: remove the guard here once `umin.i128` and friends are supported + // cc https://github.com/bytecodealliance/wasmtime/issues/13790 + sym::integer_max | sym::integer_min if ret.layout().size <= Size::from_bits(64) => { + intrinsic_args!(fx, args => (lhs, rhs); intrinsic); + + assert_eq!(lhs.layout().ty, rhs.layout().ty); + let signed = type_sign(lhs.layout().ty); + let lhs = lhs.load_scalar(fx); + let rhs = rhs.load_scalar(fx); + let res = match (intrinsic, signed) { + (sym::integer_max, false) => fx.bcx.ins().umax(lhs, rhs), + (sym::integer_max, true) => fx.bcx.ins().smax(lhs, rhs), + (sym::integer_min, false) => fx.bcx.ins().umin(lhs, rhs), + (sym::integer_min, true) => fx.bcx.ins().smin(lhs, rhs), + _ => unreachable!(), + }; + + let res = CValue::by_val(res, ret.layout()); + ret.write_cvalue(fx, res); + } sym::saturating_add | sym::saturating_sub => { intrinsic_args!(fx, args => (lhs, rhs); intrinsic); From 0dc10aa50ab71548aa48f4c4d3144d256200e7e9 Mon Sep 17 00:00:00 2001 From: Folkert de Vries Date: Thu, 6 Aug 2026 19:15:04 +0200 Subject: [PATCH 12/22] attach naked function target features to module assembly --- src/global_asm.rs | 1 + 1 file changed, 1 insertion(+) diff --git a/src/global_asm.rs b/src/global_asm.rs index 9763b0c0fa867..c5b164b8e9cce 100644 --- a/src/global_asm.rs +++ b/src/global_asm.rs @@ -30,6 +30,7 @@ impl<'tcx> AsmCodegenMethods<'tcx> for GlobalAsmContext<'_, 'tcx> { operands: &[GlobalAsmOperandRef<'tcx>], options: InlineAsmOptions, _line_spans: &[Span], + _extra_rust_target_features: &[String], ) { codegen_global_asm_inner(self.tcx, self.global_asm, template, operands, options); } From 52363bd25a9d838c9d8262a24dcc57fac45e025c Mon Sep 17 00:00:00 2001 From: N1ark Date: Wed, 12 Aug 2026 12:01:29 +0100 Subject: [PATCH 13/22] Cleanup cranelift `codegen_float_intrinsic_call` --- src/intrinsics/mod.rs | 45 ++++++++++++------------------------------- 1 file changed, 12 insertions(+), 33 deletions(-) diff --git a/src/intrinsics/mod.rs b/src/intrinsics/mod.rs index 584e4a895be9b..942839942f503 100644 --- a/src/intrinsics/mod.rs +++ b/src/intrinsics/mod.rs @@ -448,36 +448,16 @@ fn codegen_float_intrinsic_call<'tcx>( let layout = fx.layout_of(ty); // FIXME(bytecodealliance/wasmtime#8312): Use native Cranelift operations // for `f16` and `f128` once the lowerings have been implemented in Cranelift. - let res = match intrinsic { + let val = match intrinsic { sym::fmaf32 | sym::fmaf64 | sym::fmuladdf32 | sym::fmuladdf64 => { - CValue::by_val(fx.bcx.ins().fma(args[0], args[1], args[2]), layout) - } - sym::copysignf32 | sym::copysignf64 => { - CValue::by_val(fx.bcx.ins().fcopysign(args[0], args[1]), layout) - } - sym::floorf32 - | sym::floorf64 - | sym::ceilf32 - | sym::ceilf64 - | sym::truncf32 - | sym::truncf64 - | sym::round_ties_even_f32 - | sym::round_ties_even_f64 - | sym::sqrtf32 - | sym::sqrtf64 => { - let val = match intrinsic { - sym::floorf32 | sym::floorf64 => fx.bcx.ins().floor(args[0]), - sym::ceilf32 | sym::ceilf64 => fx.bcx.ins().ceil(args[0]), - sym::truncf32 | sym::truncf64 => fx.bcx.ins().trunc(args[0]), - sym::round_ties_even_f32 | sym::round_ties_even_f64 => { - fx.bcx.ins().nearest(args[0]) - } - sym::sqrtf32 | sym::sqrtf64 => fx.bcx.ins().sqrt(args[0]), - _ => unreachable!(), - }; - - CValue::by_val(val, layout) + fx.bcx.ins().fma(args[0], args[1], args[2]) } + sym::copysignf32 | sym::copysignf64 => fx.bcx.ins().fcopysign(args[0], args[1]), + sym::floorf32 | sym::floorf64 => fx.bcx.ins().floor(args[0]), + sym::ceilf32 | sym::ceilf64 => fx.bcx.ins().ceil(args[0]), + sym::truncf32 | sym::truncf64 => fx.bcx.ins().trunc(args[0]), + sym::round_ties_even_f32 | sym::round_ties_even_f64 => fx.bcx.ins().nearest(args[0]), + sym::sqrtf32 | sym::sqrtf64 => fx.bcx.ins().sqrt(args[0]), // These intrinsics aren't supported natively by Cranelift. // Lower them to a libcall. @@ -492,20 +472,19 @@ fn codegen_float_intrinsic_call<'tcx>( let input_tys: Vec<_> = vec![AbiParam::new(clif_ty), lib_call_arg_param(fx.tcx, types::I32, true)]; let ret_val = fx.lib_call(name, input_tys, vec![AbiParam::new(clif_ty)], args)[0]; - let ret_val = if intrinsic == sym::powif16 { + if intrinsic == sym::powif16 { codegen_f16_f128::f32_to_f16(fx, ret_val) } else { ret_val - }; - CValue::by_val(ret_val, fx.layout_of(ty)) + } } _ => { let input_tys: Vec<_> = args.iter().map(|_| AbiParam::new(clif_ty)).collect(); - let ret_val = fx.lib_call(name, input_tys, vec![AbiParam::new(clif_ty)], args)[0]; - CValue::by_val(ret_val, fx.layout_of(ty)) + fx.lib_call(name, input_tys, vec![AbiParam::new(clif_ty)], args)[0] } }; + let res = CValue::by_val(val, layout); ret.write_cvalue(fx, res); true From 2bba73bdbeb9b1be9b514865e2e772cfbaf835af Mon Sep 17 00:00:00 2001 From: N1ark Date: Mon, 17 Aug 2026 16:18:46 +0200 Subject: [PATCH 14/22] Make sin, cos, exp, exp2, log, log2, log10 generic --- src/intrinsics/mod.rs | 102 +++++++++++++++++++++++++----------------- 1 file changed, 61 insertions(+), 41 deletions(-) diff --git a/src/intrinsics/mod.rs b/src/intrinsics/mod.rs index 942839942f503..cf1c1f027e7f5 100644 --- a/src/intrinsics/mod.rs +++ b/src/intrinsics/mod.rs @@ -322,16 +322,6 @@ fn codegen_float_intrinsic_call<'tcx>( ret: CPlace<'tcx>, ) -> bool { let (name, arg_count, ty, clif_ty) = match intrinsic { - sym::expf16 => return false, // has a fallback via f32 - sym::expf32 => ("expf", 1, fx.tcx.types.f32, types::F32), - sym::expf64 => ("exp", 1, fx.tcx.types.f64, types::F64), - sym::expf128 => ("expf128", 1, fx.tcx.types.f128, types::F128), - - sym::exp2f16 => return false, // has a fallback via f32 - sym::exp2f32 => ("exp2f", 1, fx.tcx.types.f32, types::F32), - sym::exp2f64 => ("exp2", 1, fx.tcx.types.f64, types::F64), - sym::exp2f128 => ("exp2f128", 1, fx.tcx.types.f128, types::F128), - sym::sqrtf16 => return false, // has a fallback via f32 sym::sqrtf32 => ("sqrtf", 1, fx.tcx.types.f32, types::F32), sym::sqrtf64 => ("sqrt", 1, fx.tcx.types.f64, types::F64), @@ -347,22 +337,7 @@ fn codegen_float_intrinsic_call<'tcx>( sym::powf64 => ("pow", 2, fx.tcx.types.f64, types::F64), sym::powf128 => ("powf128", 2, fx.tcx.types.f128, types::F128), - sym::logf16 => return false, // has a fallback via f32 - sym::logf32 => ("logf", 1, fx.tcx.types.f32, types::F32), - sym::logf64 => ("log", 1, fx.tcx.types.f64, types::F64), - sym::logf128 => ("logf128", 1, fx.tcx.types.f128, types::F128), - - sym::log2f16 => return false, // has a fallback via f32 - sym::log2f32 => ("log2f", 1, fx.tcx.types.f32, types::F32), - sym::log2f64 => ("log2", 1, fx.tcx.types.f64, types::F64), - sym::log2f128 => ("log2f128", 1, fx.tcx.types.f128, types::F128), - - sym::log10f16 => return false, // has a fallback via f32 - sym::log10f32 => ("log10f", 1, fx.tcx.types.f32, types::F32), - sym::log10f64 => ("log10", 1, fx.tcx.types.f64, types::F64), - sym::log10f128 => ("log10f128", 1, fx.tcx.types.f128, types::F128), - - sym::fmaf16 => return false, // has a fallback via f32 + sym::fmaf16 => return false, // has a fallback via f64 sym::fmaf32 => ("fmaf", 3, fx.tcx.types.f32, types::F32), sym::fmaf64 => ("fma", 3, fx.tcx.types.f64, types::F64), sym::fmaf128 => ("fmaf128", 3, fx.tcx.types.f128, types::F128), @@ -404,16 +379,6 @@ fn codegen_float_intrinsic_call<'tcx>( sym::roundf64 => ("round", 1, fx.tcx.types.f64, types::F64), sym::roundf128 => ("roundf128", 1, fx.tcx.types.f128, types::F128), - sym::sinf16 => return false, // has a fallback via f32 - sym::sinf32 => ("sinf", 1, fx.tcx.types.f32, types::F32), - sym::sinf64 => ("sin", 1, fx.tcx.types.f64, types::F64), - sym::sinf128 => ("sinf128", 1, fx.tcx.types.f128, types::F128), - - sym::cosf16 => return false, // has a fallback via f32 - sym::cosf32 => ("cosf", 1, fx.tcx.types.f32, types::F32), - sym::cosf64 => ("cos", 1, fx.tcx.types.f64, types::F64), - sym::cosf128 => ("cosf128", 1, fx.tcx.types.f128, types::F128), - _ => return false, }; @@ -1198,7 +1163,14 @@ fn codegen_regular_intrinsic_call<'tcx>( ret.write_cvalue(fx, old); } - sym::fabs => { + sym::fabs + | sym::exp + | sym::exp2 + | sym::log + | sym::log2 + | sym::log10 + | sym::sin + | sym::cos => { intrinsic_args!(fx, args => (arg); intrinsic); let layout = arg.layout(); let ty::Float(float_ty) = layout.ty.kind() else { @@ -1208,13 +1180,61 @@ fn codegen_regular_intrinsic_call<'tcx>( layout.ty ); }; + enum IntrinsicFallback { + Fallback(&'static str), + Codegen(Value), + } + use FloatTy::*; + use IntrinsicFallback::*; let x = arg.load_scalar(fx); - let val = match float_ty { - FloatTy::F32 | FloatTy::F64 => fx.bcx.ins().fabs(x), + let res = match (intrinsic, float_ty) { + (sym::fabs, F32 | F64) => Codegen(fx.bcx.ins().fabs(x)), // FIXME(bytecodealliance/wasmtime#8312): Use `fabsf16` once Cranelift // backend lowerings are implemented. - FloatTy::F16 => codegen_f16_f128::abs_f16(fx, x), - FloatTy::F128 => codegen_f16_f128::abs_f128(fx, x), + (sym::fabs, F16) => Codegen(codegen_f16_f128::abs_f16(fx, x)), + (sym::fabs, F128) => Codegen(codegen_f16_f128::abs_f128(fx, x)), + + (sym::exp, F32) => Fallback("expf"), + (sym::exp, F64) => Fallback("exp"), + (sym::exp, F128) => Fallback("expf128"), + + (sym::exp2, F32) => Fallback("exp2f"), + (sym::exp2, F64) => Fallback("exp2"), + (sym::exp2, F128) => Fallback("exp2f128"), + + (sym::log, F32) => Fallback("logf"), + (sym::log, F64) => Fallback("log"), + (sym::log, F128) => Fallback("logf128"), + + (sym::log2, F32) => Fallback("log2f"), + (sym::log2, F64) => Fallback("log2"), + (sym::log2, F128) => Fallback("log2f128"), + + (sym::log10, F32) => Fallback("log10f"), + (sym::log10, F64) => Fallback("log10"), + (sym::log10, F128) => Fallback("log10f128"), + + (sym::sin, F32) => Fallback("sinf"), + (sym::sin, F64) => Fallback("sin"), + (sym::sin, F128) => Fallback("sinf128"), + + (sym::cos, F32) => Fallback("cosf"), + (sym::cos, F64) => Fallback("cos"), + (sym::cos, F128) => Fallback("cosf128"), + + (_, F16) => { + // We implement fallbacks for other f16 intrinsics via f32 + return Err(Instance::new_raw(instance.def_id(), instance.args)); + } + + _ => unreachable!(), + }; + let val = match res { + Codegen(val) => val, + Fallback(name) => { + let ty = fx.clif_type(layout.ty).unwrap(); + fx.lib_call(name, vec![AbiParam::new(ty)], vec![AbiParam::new(ty)], &[x])[0] + } }; let val = CValue::by_val(val, layout); ret.write_cvalue(fx, val); From 82e12d618d3d3117293da4be1207ccce34772771 Mon Sep 17 00:00:00 2001 From: Reuben Cruise Date: Mon, 15 Jun 2026 16:26:37 +0100 Subject: [PATCH 15/22] Creates new `InlineAsmSize` enum Facilitates scalable vector support in inline assembly. --- src/inline_asm.rs | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/inline_asm.rs b/src/inline_asm.rs index d4d64cb3fbaf2..cd2b06cc1defb 100644 --- a/src/inline_asm.rs +++ b/src/inline_asm.rs @@ -443,11 +443,12 @@ impl<'tcx> InlineAssemblyGenerator<'_, 'tcx> { .supported_types(self.arch, true) .iter() .map(|(ty, _)| ty.size()) + .filter_map(InlineAsmSize::fixed_size_bytes) .max() - .unwrap(); - let align = rustc_abi::Align::from_bytes(reg_size.bytes()).unwrap(); + .expect("expected fixed-size type"); + let align = rustc_abi::Align::from_bytes(reg_size).unwrap(); let offset = slot_size.align_to(align); - *slot_size = offset + reg_size; + *slot_size = offset + rustc_abi::Size::from_bytes(reg_size); offset }; let mut new_slot = |x| new_slot_fn(&mut slot_size, x); From 98d4b613fdd547a248e6e2fb0f5abbed866d56d4 Mon Sep 17 00:00:00 2001 From: Matyas Susits Date: Thu, 30 Jul 2026 08:11:34 +0200 Subject: [PATCH 16/22] Disable inline asm line info cookies when llvm bitcode is saved or LTO is enabled The parallel frontend makes the cookies nondeterministic in their current form, resulting in nondeterministic outputs when bitcode is emitted or LTO is used. Causes minor diagnostic regression for inline asm in release builds. --- src/driver/aot.rs | 1 + 1 file changed, 1 insertion(+) diff --git a/src/driver/aot.rs b/src/driver/aot.rs index d6c25cf524a5c..e06549090226e 100644 --- a/src/driver/aot.rs +++ b/src/driver/aot.rs @@ -284,6 +284,7 @@ impl ExtraBackendMethods for AotDriver { &self, tcx: TyCtxt<'_>, cgu_name: Symbol, + _bitcode_needed: bool, ) -> (ModuleCodegen, u64) { let start_time = Instant::now(); From 18dd4a87c304bdb7cf53a821512fed7e0ab1fea0 Mon Sep 17 00:00:00 2001 From: bjorn3 <17426603+bjorn3@users.noreply.github.com> Date: Sun, 6 Sep 2026 12:19:36 +0200 Subject: [PATCH 17/22] Reduce size of 0027-stdlib-128bit-atomic-operations.patch --- ...0027-stdlib-128bit-atomic-operations.patch | 81 ++++++------------- 1 file changed, 26 insertions(+), 55 deletions(-) diff --git a/patches/0027-stdlib-128bit-atomic-operations.patch b/patches/0027-stdlib-128bit-atomic-operations.patch index 2268ff9cb266e..f821099e68f88 100644 --- a/patches/0027-stdlib-128bit-atomic-operations.patch +++ b/patches/0027-stdlib-128bit-atomic-operations.patch @@ -5,83 +5,54 @@ Subject: [PATCH] Disable 128bit atomic operations Cranelift doesn't support them yet --- - library/core/src/panic/unwind_safe.rs | 6 ----- - library/core/src/sync/atomic.rs | 38 --------------------------- - 2 files changed, 44 deletions(-) + library/core/src/panic/unwind_safe.rs | 4 ++-- + library/core/src/sync/atomic.rs | 4 ++-- + 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/library/core/src/panic/unwind_safe.rs b/library/core/src/panic/unwind_safe.rs -index a60f0799c0e..af056fbf41f 100644 +index bf2e61d..cb82b07 100644 --- a/library/core/src/panic/unwind_safe.rs +++ b/library/core/src/panic/unwind_safe.rs -@@ -216,9 +216,6 @@ impl RefUnwindSafe for crate::sync::atomic::AtomicI32 {} +@@ -217,7 +217,7 @@ impl RefUnwindSafe for crate::sync::atomic::AtomicI32 {} #[cfg(target_has_atomic_load_store = "64")] #[stable(feature = "integer_atomics_stable", since = "1.34.0")] impl RefUnwindSafe for crate::sync::atomic::AtomicI64 {} -#[cfg(target_has_atomic_load_store = "128")] --#[unstable(feature = "integer_atomics", issue = "99069")] --impl RefUnwindSafe for crate::sync::atomic::AtomicI128 {} ++#[cfg(false)] + #[unstable(feature = "integer_atomics", issue = "99069")] + impl RefUnwindSafe for crate::sync::atomic::AtomicI128 {} - #[cfg(target_has_atomic_load_store = "ptr")] - #[stable(feature = "unwind_safe_atomic_refs", since = "1.14.0")] -@@ -235,9 +232,6 @@ impl RefUnwindSafe for crate::sync::atomic::AtomicU32 {} +@@ -236,7 +236,7 @@ impl RefUnwindSafe for crate::sync::atomic::AtomicU32 {} #[cfg(target_has_atomic_load_store = "64")] #[stable(feature = "integer_atomics_stable", since = "1.34.0")] impl RefUnwindSafe for crate::sync::atomic::AtomicU64 {} -#[cfg(target_has_atomic_load_store = "128")] --#[unstable(feature = "integer_atomics", issue = "99069")] --impl RefUnwindSafe for crate::sync::atomic::AtomicU128 {} ++#[cfg(false)] + #[unstable(feature = "integer_atomics", issue = "99069")] + impl RefUnwindSafe for crate::sync::atomic::AtomicU128 {} - #[cfg(target_has_atomic_load_store = "8")] - #[stable(feature = "unwind_safe_atomic_refs", since = "1.14.0")] diff --git a/library/core/src/sync/atomic.rs b/library/core/src/sync/atomic.rs -index 8a9a0b5..92ed9a6 100644 +index e676a38..b6a9a3c 100644 --- a/library/core/src/sync/atomic.rs +++ b/library/core/src/sync/atomic.rs -@@ -3762,44 +3757,6 @@ atomic_int! { +@@ -3850,7 +3850,7 @@ atomic_int! { 8, u64 AtomicU64 } -#[cfg(any(target_has_atomic_load_store = "128", doc))] --atomic_int! { -- target_has_atomic_load_store = "128", -- target_has_atomic = "128", -- target_has_atomic_primitive_alignment = "128", -- unstable(feature = "integer_atomics", issue = "99069"), -- unstable(feature = "integer_atomics", issue = "99069"), -- unstable(feature = "integer_atomics", issue = "99069"), -- unstable(feature = "integer_atomics", issue = "99069"), -- unstable(feature = "integer_atomics", issue = "99069"), -- unstable(feature = "integer_atomics", issue = "99069"), -- rustc_const_unstable(feature = "integer_atomics", issue = "99069"), -- rustc_const_unstable(feature = "integer_atomics", issue = "99069"), -- "i128", -- "#![feature(integer_atomics)]\n\n", -- atomic_min, atomic_max, -- 16, -- i128 AtomicI128 --} ++#[cfg(false)] + atomic_int! { + target_has_atomic_load_store = "128", + target_has_atomic = "128", +@@ -3869,7 +3869,7 @@ atomic_int! { + 16, + i128 AtomicI128 + } -#[cfg(any(target_has_atomic_load_store = "128", doc))] --atomic_int! { -- target_has_atomic_load_store = "128", -- target_has_atomic = "128", -- target_has_atomic_primitive_alignment = "128", -- unstable(feature = "integer_atomics", issue = "99069"), -- unstable(feature = "integer_atomics", issue = "99069"), -- unstable(feature = "integer_atomics", issue = "99069"), -- unstable(feature = "integer_atomics", issue = "99069"), -- unstable(feature = "integer_atomics", issue = "99069"), -- unstable(feature = "integer_atomics", issue = "99069"), -- rustc_const_unstable(feature = "integer_atomics", issue = "99069"), -- rustc_const_unstable(feature = "integer_atomics", issue = "99069"), -- "u128", -- "#![feature(integer_atomics)]\n\n", -- atomic_umin, atomic_umax, -- 16, -- u128 AtomicU128 --} - - #[cfg(target_has_atomic_load_store = "ptr")] - macro_rules! atomic_int_ptr_sized { ++#[cfg(false)] + atomic_int! { + target_has_atomic_load_store = "128", + target_has_atomic = "128", -- 2.48.1 From ea847bb0d493dc4a6ca8b720110482a66c8dda2e Mon Sep 17 00:00:00 2001 From: bjorn3 <17426603+bjorn3@users.noreply.github.com> Date: Sun, 6 Sep 2026 16:00:10 +0200 Subject: [PATCH 18/22] Rustup to rustc 1.100.0-nightly (f248f4038 2026-09-05) --- rust-toolchain.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rust-toolchain.toml b/rust-toolchain.toml index e203b3305eda1..e86e753e49c5a 100644 --- a/rust-toolchain.toml +++ b/rust-toolchain.toml @@ -1,4 +1,4 @@ [toolchain] -channel = "nightly-2026-08-24" +channel = "nightly-2026-09-06" components = ["rust-src", "rustc-dev", "llvm-tools", "rustfmt"] profile = "minimal" From ba9ce941eab342e2e25c227177d8029b030b6660 Mon Sep 17 00:00:00 2001 From: bjorn3 <17426603+bjorn3@users.noreply.github.com> Date: Sun, 6 Sep 2026 18:51:58 +0200 Subject: [PATCH 19/22] Fix rustc test suite --- scripts/test_rustc_tests.sh | 2 ++ 1 file changed, 2 insertions(+) diff --git a/scripts/test_rustc_tests.sh b/scripts/test_rustc_tests.sh index 4db6fe35f65c6..5a1374fe56e09 100755 --- a/scripts/test_rustc_tests.sh +++ b/scripts/test_rustc_tests.sh @@ -138,6 +138,7 @@ rm -r tests/run-make/panic-impl-transitive rm tests/ui/debuginfo/debuginfo-emit-llvm-ir-and-split-debuginfo.rs rm tests/ui/statics/issue-91050-1.rs rm tests/ui/statics/issue-91050-2.rs +rm -r tests/run-make/locate-panic-runtime # giving different but possibly correct results # ============================================= @@ -157,6 +158,7 @@ rm -r tests/run-make/strip # same rm -r tests/run-make-cargo/compiler-builtins # Expects lib/rustlib/src/rust to contains the standard library source rm -r tests/run-make-cargo/panic-immediate-abort-works # same rm -r tests/run-make-cargo/panic-immediate-abort-codegen # same +rm -r tests/run-make-cargo/panic-strategies # same rm -r tests/run-make/missing-unstable-trait-bound # This disables support for unstable features, but running cg_clif needs some unstable features rm -r tests/run-make/const-trait-stable-toolchain # same rm -r tests/run-make/print-request-help-stable-unstable # same From 50311ddcd1a2a7a8ef93af5d8eef3bb082a9b526 Mon Sep 17 00:00:00 2001 From: bjorn3 <17426603+bjorn3@users.noreply.github.com> Date: Sun, 6 Sep 2026 20:47:15 +0200 Subject: [PATCH 20/22] Remove stabilized feature gate --- example/mini_core_hello_world.rs | 1 - 1 file changed, 1 deletion(-) diff --git a/example/mini_core_hello_world.rs b/example/mini_core_hello_world.rs index 5e986201b385c..9a710caae9cd1 100644 --- a/example/mini_core_hello_world.rs +++ b/example/mini_core_hello_world.rs @@ -1,7 +1,6 @@ #![feature( no_core, lang_items, - never_type, extern_types, thread_local, repr_simd, From db693f7dbcfab9af2a89b703096f692417e2f756 Mon Sep 17 00:00:00 2001 From: bjorn3 <17426603+bjorn3@users.noreply.github.com> Date: Tue, 8 Sep 2026 12:08:21 +0200 Subject: [PATCH 21/22] Rustup to rustc 1.100.0-nightly (cea272fa3 2026-09-07) --- rust-toolchain.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rust-toolchain.toml b/rust-toolchain.toml index e86e753e49c5a..bc8bfacba1923 100644 --- a/rust-toolchain.toml +++ b/rust-toolchain.toml @@ -1,4 +1,4 @@ [toolchain] -channel = "nightly-2026-09-06" +channel = "nightly-2026-09-08" components = ["rust-src", "rustc-dev", "llvm-tools", "rustfmt"] profile = "minimal" From d64cce9c3b3c374cfaaa9b6dac270a6bbf152812 Mon Sep 17 00:00:00 2001 From: bjorn3 <17426603+bjorn3@users.noreply.github.com> Date: Wed, 9 Sep 2026 12:47:02 +0200 Subject: [PATCH 22/22] Pass -Zforce-unstable-if-unmarked to cg_clif tests This makes their test environment consistent between runs inside the cg_clif and rust repos. --- compiler/rustc_codegen_cranelift/build_system/tests.rs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/compiler/rustc_codegen_cranelift/build_system/tests.rs b/compiler/rustc_codegen_cranelift/build_system/tests.rs index c7b61f519d247..5ae76dc1e591e 100644 --- a/compiler/rustc_codegen_cranelift/build_system/tests.rs +++ b/compiler/rustc_codegen_cranelift/build_system/tests.rs @@ -478,6 +478,8 @@ impl<'a> TestRunner<'a> { cmd.arg("--check-cfg=cfg(jit)"); cmd.arg("--check-cfg=cfg(target_has_reliable_f128)"); cmd.arg("--edition=2024"); + // implicitly passed when building inside the rust repo + cmd.arg("-Zforce-unstable-if-unmarked"); cmd.args(args); cmd }