Skip to content

Commit 2db3866

Browse files
LegNeatoFirestar99
authored andcommitted
build: sync crate attrs with nightly-2026-03-14
Update the pinned workspace toolchain to rustc 1.96.0-nightly (1d8897a4e 2026-03-13) and keep REQUIRED_RUST_TOOLCHAIN in sync. Mirror the current rustc_codegen_ssa crate-attribute header in lib.rs, keep rustc_codegen_spirv-specific lint allowances outside that mirrored block, and drop the now-unneeded bootstrap-only header filtering from build.rs.
1 parent 09434d5 commit 2db3866

3 files changed

Lines changed: 17 additions & 21 deletions

File tree

crates/rustc_codegen_spirv/build.rs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,9 @@ use std::{env, fs, mem};
1919
/// `cargo publish`. We need to figure out a way to do this properly, but let's hardcode it for now :/
2020
//const REQUIRED_RUST_TOOLCHAIN: &str = include_str!("../../rust-toolchain.toml");
2121
const REQUIRED_RUST_TOOLCHAIN: &str = r#"[toolchain]
22-
channel = "nightly-2026-03-06"
22+
channel = "nightly-2026-03-14"
2323
components = ["rust-src", "rustc-dev", "llvm-tools"]
24-
# commit_hash = 69370dc4a8862b8401615a2a7b950704ba66c495"#;
24+
# commit_hash = 1d8897a4e88051480b36c501e66809425c6e08ad"#;
2525

2626
fn rustc_output(arg: &str) -> Result<String, Box<dyn Error>> {
2727
let rustc = env::var("RUSTC").unwrap_or_else(|_| "rustc".into());
@@ -329,7 +329,6 @@ mod maybe_pqp_cg_ssa;
329329
fs::write(out_dir.join("pqp_cg_ssa.rs"), pqp_cg_ssa_top_level)?;
330330

331331
println!("cargo::rustc-check-cfg=cfg(rustc_codegen_spirv_disable_pqp_cg_ssa)");
332-
println!("cargo::rustc-check-cfg=cfg(bootstrap)");
333332

334333
// HACK(eddyb) `if cfg!(llvm_enzyme)` added upstream for autodiff support.
335334
println!("cargo::rustc-check-cfg=cfg(llvm_enzyme)");

crates/rustc_codegen_spirv/src/lib.rs

Lines changed: 13 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,10 @@
11
// HACK(eddyb) start of `rustc_codegen_ssa` crate-level attributes (see `build.rs`).
2-
#![allow(rustc::diagnostic_outside_of_impl)]
3-
#![allow(rustc::untranslatable_diagnostic)]
4-
#![cfg_attr(bootstrap, feature(assert_matches))]
52
#![feature(box_patterns)]
63
#![feature(file_buffered)]
7-
#![cfg_attr(bootstrap, feature(if_let_guard))]
84
#![feature(negative_impls)]
95
#![feature(string_from_utf8_lossy_owned)]
106
#![feature(trait_alias)]
117
#![feature(try_blocks)]
12-
#![cfg_attr(rustc_codegen_spirv_disable_pqp_cg_ssa, allow(unused_features))]
138
#![recursion_limit = "256"]
149
// HACK(eddyb) end of `rustc_codegen_ssa` crate-level attributes (see `build.rs`).
1510

@@ -31,15 +26,17 @@
3126
//! [`spirv-tools`]: https://rust-gpu.github.io/rust-gpu/api/spirv_tools
3227
//! [`spirv-tools-sys`]: https://rust-gpu.github.io/rust-gpu/api/spirv_tools_sys
3328
#![feature(rustc_private)]
29+
// In `rustc_codegen_spirv_disable_pqp_cg_ssa` mode we stop `include!`ing the
30+
// patched `rustc_codegen_ssa`, so these copied crate-level feature gates can
31+
// become locally unused even though the default build still needs them.
32+
#![cfg_attr(rustc_codegen_spirv_disable_pqp_cg_ssa, allow(unused_features))]
3433
// crate-specific exceptions:
3534
#![allow(
36-
unsafe_code, // rustc_codegen_ssa requires unsafe functions in traits to be impl'd
3735
clippy::enum_glob_use, // pretty useful pattern with some codegen'd enums (e.g. rspirv::spirv::Op)
3836
clippy::todo, // still lots to implement :)
3937
4038
// FIXME(eddyb) new warnings from 1.83 rustup, apply their suggested changes.
4139
mismatched_lifetime_syntaxes,
42-
clippy::needless_lifetimes,
4340
)]
4441

4542
// Unfortunately, this will not fail fast when compiling, but rather will wait for
@@ -319,15 +316,6 @@ impl WriteBackendMethods for SpirvCodegenBackend {
319316
type ModuleBuffer = SpirvModuleBuffer;
320317
type ThinData = ();
321318

322-
fn target_machine_factory(
323-
&self,
324-
_sess: &Session,
325-
_opt_level: config::OptLevel,
326-
_target_features: &[String],
327-
) -> TargetMachineFactoryFn<Self> {
328-
Arc::new(|_, _| ())
329-
}
330-
331319
// FIXME(eddyb) reuse the "merge" stage of `crate::linker` for this, or even
332320
// consider setting `requires_lto = true` in the target specs and moving the
333321
// entirety of `crate::linker` into this stage (lacking diagnostics may be
@@ -428,6 +416,15 @@ impl WriteBackendMethods for SpirvCodegenBackend {
428416
fn serialize_module(module: Self::Module, _is_thin: bool) -> Self::ModuleBuffer {
429417
SpirvModuleBuffer(module.assemble())
430418
}
419+
420+
fn target_machine_factory(
421+
&self,
422+
_sess: &Session,
423+
_opt_level: config::OptLevel,
424+
_target_features: &[String],
425+
) -> TargetMachineFactoryFn<Self> {
426+
Arc::new(|_, _| ())
427+
}
431428
}
432429

433430
impl ExtraBackendMethods for SpirvCodegenBackend {

rust-toolchain.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
[toolchain]
2-
channel = "nightly-2026-03-06"
2+
channel = "nightly-2026-03-14"
33
components = ["rust-src", "rustc-dev", "llvm-tools"]
4-
# commit_hash = 69370dc4a8862b8401615a2a7b950704ba66c495
4+
# commit_hash = 1d8897a4e88051480b36c501e66809425c6e08ad
55

66
# Whenever changing the nightly channel, update the commit hash above, and
77
# change `REQUIRED_RUST_TOOLCHAIN` in `crates/rustc_codegen_spirv/build.rs` too.

0 commit comments

Comments
 (0)