Skip to content

Commit 88fd99e

Browse files
committed
rustup: update to nightly-2025-05-09 (~1.88).
1 parent 3f3bfe8 commit 88fd99e

File tree

18 files changed

+71
-60
lines changed

18 files changed

+71
-60
lines changed

.cargo/config.toml

-1
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

+2-2
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

+1-1
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

+1-1
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

+35-17
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

-1
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

-1
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

-1
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

-1
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

-1
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/wgpu/src/lib.rs

-1
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,

rust-toolchain.toml

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
[toolchain]
2-
channel = "nightly-2025-04-28"
2+
channel = "nightly-2025-05-09"
33
components = ["rust-src", "rustc-dev", "llvm-tools"]
4-
# commit_hash = cb31a009e3e735ab08613cec2d8a5a754e65596f
4+
# commit_hash = 50aa04180709189a03dde5fd1c05751b2625ed37
55

66
# Whenever changing the nightly channel, update the commit hash above, and make
77
# sure to change `REQUIRED_TOOLCHAIN` in `crates/rustc_codegen_spirv/build.rs` also.

tests/ui/arch/debug_printf_type_checking.stderr

+10-10
Original file line numberDiff line numberDiff line change
@@ -75,9 +75,9 @@ help: the return type of this call is `u32` due to the type of the argument pass
7575
| |
7676
| this argument influences the return type of `debug_printf_assert_is_type`
7777
note: function defined here
78-
--> $SPIRV_STD_SRC/lib.rs:134:8
78+
--> $SPIRV_STD_SRC/lib.rs:133:8
7979
|
80-
134 | pub fn debug_printf_assert_is_type<T>(ty: T) -> T {
80+
133 | pub fn debug_printf_assert_is_type<T>(ty: T) -> T {
8181
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^
8282
= note: this error originates in the macro `debug_printf` (in Nightly builds, run with -Z macro-backtrace for more info)
8383
help: change the type of the numeric literal from `u32` to `f32`
@@ -103,9 +103,9 @@ help: the return type of this call is `f32` due to the type of the argument pass
103103
| |
104104
| this argument influences the return type of `debug_printf_assert_is_type`
105105
note: function defined here
106-
--> $SPIRV_STD_SRC/lib.rs:134:8
106+
--> $SPIRV_STD_SRC/lib.rs:133:8
107107
|
108-
134 | pub fn debug_printf_assert_is_type<T>(ty: T) -> T {
108+
133 | pub fn debug_printf_assert_is_type<T>(ty: T) -> T {
109109
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^
110110
= note: this error originates in the macro `debug_printf` (in Nightly builds, run with -Z macro-backtrace for more info)
111111
help: change the type of the numeric literal from `f32` to `u32`
@@ -131,12 +131,12 @@ error[E0277]: the trait bound `{float}: Vector<f32, 2>` is not satisfied
131131
`UVec3` implements `Vector<u32, 3>`
132132
and 5 others
133133
note: required by a bound in `debug_printf_assert_is_vector`
134-
--> $SPIRV_STD_SRC/lib.rs:141:8
134+
--> $SPIRV_STD_SRC/lib.rs:140:8
135135
|
136-
139 | pub fn debug_printf_assert_is_vector<
136+
138 | pub fn debug_printf_assert_is_vector<
137137
| ----------------------------- required by a bound in this function
138-
140 | TY: crate::scalar::Scalar,
139-
141 | V: crate::vector::Vector<TY, SIZE>,
138+
139 | TY: crate::scalar::Scalar,
139+
140 | V: crate::vector::Vector<TY, SIZE>,
140140
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `debug_printf_assert_is_vector`
141141
= note: this error originates in the macro `debug_printf` (in Nightly builds, run with -Z macro-backtrace for more info)
142142

@@ -157,9 +157,9 @@ help: the return type of this call is `Vec2` due to the type of the argument pas
157157
| |
158158
| this argument influences the return type of `debug_printf_assert_is_type`
159159
note: function defined here
160-
--> $SPIRV_STD_SRC/lib.rs:134:8
160+
--> $SPIRV_STD_SRC/lib.rs:133:8
161161
|
162-
134 | pub fn debug_printf_assert_is_type<T>(ty: T) -> T {
162+
133 | pub fn debug_printf_assert_is_type<T>(ty: T) -> T {
163163
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^
164164
= note: this error originates in the macro `debug_printf` (in Nightly builds, run with -Z macro-backtrace for more info)
165165

tests/ui/dis/ptr_copy.normal.stderr

+16-16
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
error: cannot memcpy dynamically sized data
2-
--> $CORE_SRC/intrinsics/mod.rs:3851:9
2+
--> $CORE_SRC/intrinsics/mod.rs:3850:9
33
|
4-
3851 | copy(src, dst, count)
4+
3850 | copy(src, dst, count)
55
| ^^^^^^^^^^^^^^^^^^^^^
66
|
77
note: used from within `core::intrinsics::copy::<f32>`
8-
--> $CORE_SRC/intrinsics/mod.rs:3831:21
8+
--> $CORE_SRC/intrinsics/mod.rs:3830:21
99
|
10-
3831 | pub const unsafe fn copy<T>(src: *const T, dst: *mut T, count: usize) {
10+
3830 | pub const unsafe fn copy<T>(src: *const T, dst: *mut T, count: usize) {
1111
| ^^^^
1212
note: called by `ptr_copy::copy_via_raw_ptr`
1313
--> $DIR/ptr_copy.rs:28:18
@@ -28,25 +28,25 @@ note: called by `main`
2828
error: cannot cast between pointer types
2929
from `*f32`
3030
to `*struct () { }`
31-
--> $CORE_SRC/intrinsics/mod.rs:3839:9
31+
--> $CORE_SRC/intrinsics/mod.rs:3838:9
3232
|
33-
3839 | / ub_checks::assert_unsafe_precondition!(
34-
3840 | | check_language_ub,
35-
3841 | | "ptr::copy requires that both pointer arguments are aligned and non-null",
33+
3838 | / ub_checks::assert_unsafe_precondition!(
34+
3839 | | check_language_ub,
35+
3840 | | "ptr::copy requires that both pointer arguments are aligned and non-null",
3636
... |
37-
3849 | | && ub_checks::maybe_is_aligned_and_not_null(dst, align, zero_size)
38-
3850 | | );
37+
3848 | | && ub_checks::maybe_is_aligned_and_not_null(dst, align, zero_size)
38+
3849 | | );
3939
| |_________^
4040
|
4141
note: used from within `core::intrinsics::copy::<f32>`
42-
--> $CORE_SRC/intrinsics/mod.rs:3839:9
42+
--> $CORE_SRC/intrinsics/mod.rs:3838:9
4343
|
44-
3839 | / ub_checks::assert_unsafe_precondition!(
45-
3840 | | check_language_ub,
46-
3841 | | "ptr::copy requires that both pointer arguments are aligned and non-null",
44+
3838 | / ub_checks::assert_unsafe_precondition!(
45+
3839 | | check_language_ub,
46+
3840 | | "ptr::copy requires that both pointer arguments are aligned and non-null",
4747
... |
48-
3849 | | && ub_checks::maybe_is_aligned_and_not_null(dst, align, zero_size)
49-
3850 | | );
48+
3848 | | && ub_checks::maybe_is_aligned_and_not_null(dst, align, zero_size)
49+
3849 | | );
5050
| |_________^
5151
note: called by `ptr_copy::copy_via_raw_ptr`
5252
--> $DIR/ptr_copy.rs:28:18

tests/ui/dis/ptr_read.stderr

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
%4 = OpFunctionParameter %5
33
%6 = OpFunctionParameter %5
44
%7 = OpLabel
5-
OpLine %8 1420 8
5+
OpLine %8 1455 8
66
%9 = OpLoad %10 %4
77
OpLine %11 7 13
88
OpStore %6 %9

tests/ui/dis/ptr_read_method.stderr

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
%4 = OpFunctionParameter %5
33
%6 = OpFunctionParameter %5
44
%7 = OpLabel
5-
OpLine %8 1420 8
5+
OpLine %8 1455 8
66
%9 = OpLoad %10 %4
77
OpLine %11 7 13
88
OpStore %6 %9

tests/ui/dis/ptr_write.stderr

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
%7 = OpLabel
55
OpLine %8 7 35
66
%9 = OpLoad %10 %4
7-
OpLine %11 1620 8
7+
OpLine %11 1655 8
88
OpStore %6 %9
99
OpNoLine
1010
OpReturn

tests/ui/dis/ptr_write_method.stderr

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
%7 = OpLabel
55
OpLine %8 7 37
66
%9 = OpLoad %10 %4
7-
OpLine %11 1620 8
7+
OpLine %11 1655 8
88
OpStore %6 %9
99
OpNoLine
1010
OpReturn

0 commit comments

Comments
 (0)