Skip to content

Commit 0ff7c9c

Browse files
committed
rustup: update to nightly-2025-05-09 (~1.88).
1 parent e16cee7 commit 0ff7c9c

18 files changed

Lines changed: 71 additions & 60 deletions

File tree

.cargo/config.toml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,6 @@ rustflags = [
4444
"-Wclippy::map_err_ignore",
4545
"-Wclippy::map_flatten",
4646
"-Wclippy::map_unwrap_or",
47-
"-Wclippy::match_on_vec_items",
4847
"-Wclippy::match_same_arms",
4948
"-Wclippy::match_wild_err_arm",
5049
"-Wclippy::match_wildcard_for_single_variants",

crates/rustc_codegen_spirv/build.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,9 @@ use std::{env, fs, mem};
1515
/// `cargo publish`. We need to figure out a way to do this properly, but let's hardcode it for now :/
1616
//const REQUIRED_RUST_TOOLCHAIN: &str = include_str!("../../rust-toolchain.toml");
1717
const REQUIRED_RUST_TOOLCHAIN: &str = r#"[toolchain]
18-
channel = "nightly-2025-04-28"
18+
channel = "nightly-2025-05-09"
1919
components = ["rust-src", "rustc-dev", "llvm-tools"]
20-
# commit_hash = cb31a009e3e735ab08613cec2d8a5a754e65596f"#;
20+
# commit_hash = 50aa04180709189a03dde5fd1c05751b2625ed37"#;
2121

2222
fn rustc_output(arg: &str) -> Result<String, Box<dyn Error>> {
2323
let rustc = env::var("RUSTC").unwrap_or_else(|_| "rustc".into());

crates/rustc_codegen_spirv/src/builder/intrinsics.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -334,7 +334,7 @@ impl<'a, 'tcx> IntrinsicCallBuilderMethods<'tcx> for Builder<'a, 'tcx> {
334334

335335
_ => {
336336
// Call the fallback body instead of generating the intrinsic code
337-
return Err(ty::Instance::new(instance.def_id(), instance.args));
337+
return Err(ty::Instance::new_raw(instance.def_id(), instance.args));
338338
}
339339
};
340340

crates/rustc_codegen_spirv/src/codegen_cx/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -966,7 +966,7 @@ impl<'tcx> DebugInfoCodegenMethods<'tcx> for CodegenCx<'tcx> {
966966

967967
impl<'tcx> AsmCodegenMethods<'tcx> for CodegenCx<'tcx> {
968968
fn codegen_global_asm(
969-
&self,
969+
&mut self,
970970
_template: &[InlineAsmTemplatePiece],
971971
_operands: &[GlobalAsmOperandRef<'tcx>],
972972
_options: InlineAsmOptions,

crates/rustc_codegen_spirv/src/lib.rs

Lines changed: 35 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
#![feature(string_from_utf8_lossy_owned)]
1313
#![feature(trait_alias)]
1414
#![feature(try_blocks)]
15+
#![recursion_limit = "256"]
1516
// HACK(eddyb) end of `rustc_codegen_ssa` crate-level attributes (see `build.rs`).
1617

1718
//! Welcome to the API documentation for the `rust-gpu` project, this API is
@@ -36,7 +37,6 @@
3637
// crate-specific exceptions:
3738
#![allow(
3839
unsafe_code, // rustc_codegen_ssa requires unsafe functions in traits to be impl'd
39-
clippy::match_on_vec_items, // rustc_codegen_spirv has less strict panic requirements than other embark projects
4040
clippy::enum_glob_use, // pretty useful pattern with some codegen'd enums (e.g. rspirv::spirv::Op)
4141
clippy::todo, // still lots to implement :)
4242
@@ -147,7 +147,7 @@ use maybe_pqp_cg_ssa::traits::{
147147
CodegenBackend, ExtraBackendMethods, ModuleBufferMethods, ThinBufferMethods,
148148
WriteBackendMethods,
149149
};
150-
use maybe_pqp_cg_ssa::{CodegenResults, CompiledModule, ModuleCodegen, ModuleKind};
150+
use maybe_pqp_cg_ssa::{CodegenResults, CompiledModule, ModuleCodegen, ModuleKind, TargetConfig};
151151
use rspirv::binary::Assemble;
152152
use rustc_ast::expand::allocator::AllocatorKind;
153153
use rustc_ast::expand::autodiff_attrs::AutoDiffItem;
@@ -258,21 +258,33 @@ impl CodegenBackend for SpirvCodegenBackend {
258258
rustc_errors::DEFAULT_LOCALE_RESOURCE
259259
}
260260

261-
fn target_features_cfg(&self, sess: &Session) -> (Vec<Symbol>, Vec<Symbol>) {
261+
fn target_config(&self, sess: &Session) -> TargetConfig {
262262
let cmdline = sess.opts.cg.target_feature.split(',');
263263
let cfg = sess.target.options.features.split(',');
264264

265-
let all_target_features: Vec<_> = cfg
265+
let target_features: Vec<_> = cfg
266266
.chain(cmdline)
267267
.filter(|l| l.starts_with('+'))
268268
.map(|l| &l[1..])
269269
.filter(|l| !l.is_empty())
270270
.map(Symbol::intern)
271271
.collect();
272272

273-
// HACK(eddyb) the second list is "including unstable target features",
273+
// HACK(eddyb) this should be a superset of `target_features`,
274+
// which *additionally* also includes unstable target features,
274275
// but there is no reason to make a distinction for SPIR-V ones.
275-
(all_target_features.clone(), all_target_features)
276+
let unstable_target_features = target_features.clone();
277+
278+
TargetConfig {
279+
target_features,
280+
unstable_target_features,
281+
282+
// FIXME(eddyb) support and/or emulate `f16` and `f128`.
283+
has_reliable_f16: false,
284+
has_reliable_f16_math: false,
285+
has_reliable_f128: false,
286+
has_reliable_f128_math: false,
287+
}
276288
}
277289

278290
fn provide(&self, providers: &mut rustc_middle::util::Providers) {
@@ -474,8 +486,8 @@ impl ExtraBackendMethods for SpirvCodegenBackend {
474486
// TODO: Do dep_graph stuff
475487
let cgu = tcx.codegen_unit(cgu_name);
476488

477-
let cx = CodegenCx::new(tcx, cgu);
478-
let do_codegen = || {
489+
let mut cx = CodegenCx::new(tcx, cgu);
490+
let do_codegen = |cx: &mut CodegenCx<'_>| {
479491
let mono_items = cx.codegen_unit.items_in_deterministic_order(cx.tcx);
480492

481493
if let Some(dir) = &cx.codegen_args.dump_mir {
@@ -489,32 +501,38 @@ impl ExtraBackendMethods for SpirvCodegenBackend {
489501
}
490502
}
491503
mono_item.predefine::<Builder<'_, '_>>(
492-
&cx,
504+
cx,
493505
mono_item_data.linkage,
494506
mono_item_data.visibility,
495507
);
496508
}
497509

498510
// ... and now that we have everything pre-defined, fill out those definitions.
499-
for &(mono_item, _) in mono_items.iter() {
511+
for &(mono_item, mono_item_data) in &mono_items {
500512
if let MonoItem::Fn(instance) = mono_item {
501513
if is_blocklisted_fn(cx.tcx, &cx.sym, instance) {
502514
continue;
503515
}
504516
}
505-
mono_item.define::<Builder<'_, '_>>(&cx);
517+
mono_item.define::<Builder<'_, '_>>(cx, mono_item_data);
506518
}
507519

508-
if let Some(_entry) = maybe_create_entry_wrapper::<Builder<'_, '_>>(&cx) {
520+
if let Some(_entry) = maybe_create_entry_wrapper::<Builder<'_, '_>>(cx) {
509521
// attributes::sanitize(&cx, SanitizerSet::empty(), entry);
510522
}
511523
};
512-
if let Some(path) = &cx.codegen_args.dump_module_on_panic {
513-
let module_dumper = DumpModuleOnPanic { cx: &cx, path };
514-
with_no_trimmed_paths!(do_codegen());
524+
// HACK(eddyb) mutable access needed for `mono_item.define::<...>(cx, ...)`
525+
// but that alone leads to needless cloning and smuggling a mutable borrow
526+
// through `DumpModuleOnPanic` (for both its `Drop` impl and `do_codegen`).
527+
if let Some(path) = cx.codegen_args.dump_module_on_panic.clone() {
528+
let module_dumper = DumpModuleOnPanic {
529+
cx: &mut cx,
530+
path: &path,
531+
};
532+
with_no_trimmed_paths!(do_codegen(module_dumper.cx));
515533
drop(module_dumper);
516534
} else {
517-
with_no_trimmed_paths!(do_codegen());
535+
with_no_trimmed_paths!(do_codegen(&mut cx));
518536
}
519537
let spirv_module = cx.finalize_module().assemble();
520538

@@ -541,7 +559,7 @@ impl ExtraBackendMethods for SpirvCodegenBackend {
541559
}
542560

543561
struct DumpModuleOnPanic<'a, 'cx, 'tcx> {
544-
cx: &'cx CodegenCx<'tcx>,
562+
cx: &'cx mut CodegenCx<'tcx>,
545563
path: &'a Path,
546564
}
547565

crates/spirv-builder/src/lib.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,6 @@
3636
clippy::map_err_ignore,
3737
clippy::map_flatten,
3838
clippy::map_unwrap_or,
39-
clippy::match_on_vec_items,
4039
clippy::match_same_arms,
4140
clippy::match_wildcard_for_single_variants,
4241
clippy::mem_forget,

crates/spirv-std/macros/src/lib.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,6 @@
3636
clippy::map_err_ignore,
3737
clippy::map_flatten,
3838
clippy::map_unwrap_or,
39-
clippy::match_on_vec_items,
4039
clippy::match_same_arms,
4140
clippy::match_wildcard_for_single_variants,
4241
clippy::mem_forget,

crates/spirv-std/src/lib.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,6 @@
4242
clippy::map_err_ignore,
4343
clippy::map_flatten,
4444
clippy::map_unwrap_or,
45-
clippy::match_on_vec_items,
4645
clippy::match_same_arms,
4746
clippy::match_wildcard_for_single_variants,
4847
clippy::mem_forget,

examples/runners/ash/src/main.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,6 @@
3636
clippy::map_err_ignore,
3737
clippy::map_flatten,
3838
clippy::map_unwrap_or,
39-
clippy::match_on_vec_items,
4039
clippy::match_same_arms,
4140
clippy::match_wildcard_for_single_variants,
4241
clippy::mem_forget,

examples/runners/cpu/src/main.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,6 @@
3636
clippy::map_err_ignore,
3737
clippy::map_flatten,
3838
clippy::map_unwrap_or,
39-
clippy::match_on_vec_items,
4039
clippy::match_same_arms,
4140
clippy::match_wildcard_for_single_variants,
4241
clippy::mem_forget,

0 commit comments

Comments
 (0)