Skip to content

Commit 78dce65

Browse files
committed
rustup: update to nightly-2025-05-09 (~1.88).
1 parent e564145 commit 78dce65

File tree

12 files changed

+71
-53
lines changed

12 files changed

+71
-53
lines changed

crates/rustc_codegen_spirv/build.rs

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

2525
fn rustc_output(arg: &str) -> Result<String, Box<dyn Error>> {
2626
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-16
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
@@ -148,7 +149,7 @@ use maybe_pqp_cg_ssa::traits::{
148149
CodegenBackend, ExtraBackendMethods, ModuleBufferMethods, ThinBufferMethods,
149150
WriteBackendMethods,
150151
};
151-
use maybe_pqp_cg_ssa::{CodegenResults, CompiledModule, ModuleCodegen, ModuleKind};
152+
use maybe_pqp_cg_ssa::{CodegenResults, CompiledModule, ModuleCodegen, ModuleKind, TargetConfig};
152153
use rspirv::binary::Assemble;
153154
use rustc_ast::expand::allocator::AllocatorKind;
154155
use rustc_ast::expand::autodiff_attrs::AutoDiffItem;
@@ -259,21 +260,33 @@ impl CodegenBackend for SpirvCodegenBackend {
259260
rustc_errors::DEFAULT_LOCALE_RESOURCE
260261
}
261262

262-
fn target_features_cfg(&self, sess: &Session) -> (Vec<Symbol>, Vec<Symbol>) {
263+
fn target_config(&self, sess: &Session) -> TargetConfig {
263264
let cmdline = sess.opts.cg.target_feature.split(',');
264265
let cfg = sess.target.options.features.split(',');
265266

266-
let all_target_features: Vec<_> = cfg
267+
let target_features: Vec<_> = cfg
267268
.chain(cmdline)
268269
.filter(|l| l.starts_with('+'))
269270
.map(|l| &l[1..])
270271
.filter(|l| !l.is_empty())
271272
.map(Symbol::intern)
272273
.collect();
273274

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

279292
fn provide(&self, providers: &mut rustc_middle::util::Providers) {
@@ -475,8 +488,8 @@ impl ExtraBackendMethods for SpirvCodegenBackend {
475488
// TODO: Do dep_graph stuff
476489
let cgu = tcx.codegen_unit(cgu_name);
477490

478-
let cx = CodegenCx::new(tcx, cgu);
479-
let do_codegen = || {
491+
let mut cx = CodegenCx::new(tcx, cgu);
492+
let do_codegen = |cx: &mut CodegenCx<'_>| {
480493
let mono_items = cx.codegen_unit.items_in_deterministic_order(cx.tcx);
481494

482495
if let Some(dir) = &cx.codegen_args.dump_mir {
@@ -490,32 +503,38 @@ impl ExtraBackendMethods for SpirvCodegenBackend {
490503
}
491504
}
492505
mono_item.predefine::<Builder<'_, '_>>(
493-
&cx,
506+
cx,
494507
mono_item_data.linkage,
495508
mono_item_data.visibility,
496509
);
497510
}
498511

499512
// ... and now that we have everything pre-defined, fill out those definitions.
500-
for &(mono_item, _) in mono_items.iter() {
513+
for &(mono_item, mono_item_data) in &mono_items {
501514
if let MonoItem::Fn(instance) = mono_item {
502515
if is_blocklisted_fn(cx.tcx, &cx.sym, instance) {
503516
continue;
504517
}
505518
}
506-
mono_item.define::<Builder<'_, '_>>(&cx);
519+
mono_item.define::<Builder<'_, '_>>(cx, mono_item_data);
507520
}
508521

509-
if let Some(_entry) = maybe_create_entry_wrapper::<Builder<'_, '_>>(&cx) {
522+
if let Some(_entry) = maybe_create_entry_wrapper::<Builder<'_, '_>>(cx) {
510523
// attributes::sanitize(&cx, SanitizerSet::empty(), entry);
511524
}
512525
};
513-
if let Some(path) = &cx.codegen_args.dump_module_on_panic {
514-
let module_dumper = DumpModuleOnPanic { cx: &cx, path };
515-
with_no_trimmed_paths!(do_codegen());
526+
// HACK(eddyb) mutable access needed for `mono_item.define::<...>(cx, ...)`
527+
// but that alone leads to needless cloning and smuggling a mutable borrow
528+
// through `DumpModuleOnPanic` (for both its `Drop` impl and `do_codegen`).
529+
if let Some(path) = cx.codegen_args.dump_module_on_panic.clone() {
530+
let module_dumper = DumpModuleOnPanic {
531+
cx: &mut cx,
532+
path: &path,
533+
};
534+
with_no_trimmed_paths!(do_codegen(module_dumper.cx));
516535
drop(module_dumper);
517536
} else {
518-
with_no_trimmed_paths!(do_codegen());
537+
with_no_trimmed_paths!(do_codegen(&mut cx));
519538
}
520539
let spirv_module = cx.finalize_module().assemble();
521540

@@ -542,7 +561,7 @@ impl ExtraBackendMethods for SpirvCodegenBackend {
542561
}
543562

544563
struct DumpModuleOnPanic<'a, 'cx, 'tcx> {
545-
cx: &'cx CodegenCx<'tcx>,
564+
cx: &'cx mut CodegenCx<'tcx>,
546565
path: &'a Path,
547566
}
548567

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)