Skip to content

Commit 327182c

Browse files
committed
Update to nightly-2025-08-04.
- `tcx.get_attrs_unchecked(...)` was replaced with `tcx.get_all_attrs(...)`. - `run_link` has been removed. - `BuilderMethods::tail_call` was added. It's currently `todo!()`. - Adjust expected test outputs for very minor error message formatting changes. - And update to glam 0.30.8.
1 parent 0e38181 commit 327182c

17 files changed

+48
-50
lines changed

crates/rustc_codegen_spirv/build.rs

Lines changed: 2 additions & 2 deletions
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-07-28"
21+
channel = "nightly-2025-08-04"
2222
components = ["rust-src", "rustc-dev", "llvm-tools"]
23-
# commit_hash = f8e355c230c6eb7b78ffce6a92fd81f78c890524"#;
23+
# commit_hash = f34ba774c78ea32b7c40598b8ad23e75cdac42a6"#;
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/abi.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -286,7 +286,7 @@ impl<'tcx> ConvSpirvType<'tcx> for TyAndLayout<'tcx> {
286286
span = cx.tcx.def_span(adt.did());
287287
}
288288

289-
let attrs = AggregatedSpirvAttributes::parse(cx, cx.tcx.get_attrs_unchecked(adt.did()));
289+
let attrs = AggregatedSpirvAttributes::parse(cx, cx.tcx.get_all_attrs(adt.did()));
290290

291291
if let Some(intrinsic_type_attr) = attrs.intrinsic_type.map(|attr| attr.value)
292292
&& let Ok(spirv_type) =

crates/rustc_codegen_spirv/src/builder/builder_methods.rs

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4160,6 +4160,19 @@ impl<'a, 'tcx> BuilderMethods<'a, 'tcx> for Builder<'a, 'tcx> {
41604160
.with_type(result_type)
41614161
}
41624162

4163+
fn tail_call(
4164+
&mut self,
4165+
_llty: Self::Type,
4166+
_fn_attrs: Option<&CodegenFnAttrs>,
4167+
_fn_abi: &FnAbi<'tcx, Ty<'tcx>>,
4168+
_llfn: Self::Value,
4169+
_args: &[Self::Value],
4170+
_funclet: Option<&Self::Funclet>,
4171+
_instance: Option<ty::Instance<'tcx>>,
4172+
) {
4173+
todo!()
4174+
}
4175+
41634176
fn zext(&mut self, val: Self::Value, dest_ty: Self::Type) -> Self::Value {
41644177
self.intcast(val, dest_ty, false)
41654178
}

crates/rustc_codegen_spirv/src/codegen_cx/declare.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@ use crate::spirv_type::SpirvType;
1010
use itertools::Itertools;
1111
use rspirv::spirv::{FunctionControl, LinkageType, StorageClass, Word};
1212
use rustc_abi::Align;
13-
use rustc_attr_data_structures::InlineAttr;
1413
use rustc_codegen_ssa::traits::{PreDefineCodegenMethods, StaticCodegenMethods};
14+
use rustc_hir::attrs::InlineAttr;
1515
use rustc_middle::bug;
1616
use rustc_middle::middle::codegen_fn_attrs::{CodegenFnAttrFlags, CodegenFnAttrs};
1717
use rustc_middle::mir::mono::{Linkage, MonoItem, Visibility};
@@ -133,7 +133,7 @@ impl<'tcx> CodegenCx<'tcx> {
133133
self.set_linkage(fn_id, symbol_name.to_owned(), linkage);
134134
}
135135

136-
let attrs = AggregatedSpirvAttributes::parse(self, self.tcx.get_attrs_unchecked(def_id));
136+
let attrs = AggregatedSpirvAttributes::parse(self, self.tcx.get_all_attrs(def_id));
137137
if let Some(entry) = attrs.entry.map(|attr| attr.value) {
138138
// HACK(eddyb) early insert to let `shader_entry_stub` call this
139139
// very function via `get_fn_addr`.
@@ -167,7 +167,7 @@ impl<'tcx> CodegenCx<'tcx> {
167167
}
168168

169169
// Check if this is a From trait implementation
170-
if let Some(impl_def_id) = self.tcx.impl_of_method(def_id)
170+
if let Some(impl_def_id) = self.tcx.impl_of_assoc(def_id)
171171
&& let Some(trait_ref) = self.tcx.impl_trait_ref(impl_def_id)
172172
{
173173
let trait_def_id = trait_ref.skip_binder().def_id;

crates/rustc_codegen_spirv/src/lib.rs

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -332,21 +332,6 @@ impl WriteBackendMethods for SpirvCodegenBackend {
332332
type ThinData = ();
333333
type ThinBuffer = SpirvModuleBuffer;
334334

335-
// FIXME(eddyb) reuse the "merge" stage of `crate::linker` for this, or even
336-
// delegate to `run_and_optimize_fat_lto` (although `-Zcombine-cgu` is much more niche).
337-
fn run_link(
338-
cgcx: &CodegenContext<Self>,
339-
diag_handler: DiagCtxtHandle<'_>,
340-
_modules: Vec<ModuleCodegen<Self::Module>>,
341-
) -> Result<ModuleCodegen<Self::Module>, FatalError> {
342-
assert!(
343-
cgcx.opts.unstable_opts.combine_cgu,
344-
"`run_link` (for `WorkItemResult::NeedsLink`) should \
345-
only be invoked due to `-Zcombine-cgu`"
346-
);
347-
diag_handler.fatal("Rust-GPU does not support `-Zcombine-cgu`")
348-
}
349-
350335
// FIXME(eddyb) reuse the "merge" stage of `crate::linker` for this, or even
351336
// consider setting `requires_lto = true` in the target specs and moving the
352337
// entirety of `crate::linker` into this stage (lacking diagnostics may be

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-2025-07-28"
2+
channel = "nightly-2025-08-04"
33
components = ["rust-src", "rustc-dev", "llvm-tools"]
4-
# commit_hash = f8e355c230c6eb7b78ffce6a92fd81f78c890524
4+
# commit_hash = f34ba774c78ea32b7c40598b8ad23e75cdac42a6
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.

tests/compiletests/ui/arch/debug_printf_type_checking.stderr

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ error: Unrecognised format specifier: 'r'
6161
error[E0308]: mismatched types
6262
--> $DIR/debug_printf_type_checking.rs:21:29
6363
|
64-
21 | debug_printf!("%f", 11_u32);
64+
21 | debug_printf!("%f", 11_u32);
6565
| --------------------^^^^^^-
6666
| | |
6767
| | expected `f32`, found `u32`
@@ -70,7 +70,7 @@ error[E0308]: mismatched types
7070
help: the return type of this call is `u32` due to the type of the argument passed
7171
--> $DIR/debug_printf_type_checking.rs:21:9
7272
|
73-
21 | debug_printf!("%f", 11_u32);
73+
21 | debug_printf!("%f", 11_u32);
7474
| ^^^^^^^^^^^^^^^^^^^^------^
7575
| |
7676
| this argument influences the return type of `debug_printf_assert_is_type`
@@ -82,14 +82,14 @@ note: function defined here
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`
8484
|
85-
21 - debug_printf!("%f", 11_u32);
86-
21 + debug_printf!("%f", 11_f32);
85+
21 - debug_printf!("%f", 11_u32);
86+
21 + debug_printf!("%f", 11_f32);
8787
|
8888

8989
error[E0308]: mismatched types
9090
--> $DIR/debug_printf_type_checking.rs:22:29
9191
|
92-
22 | debug_printf!("%u", 11.0_f32);
92+
22 | debug_printf!("%u", 11.0_f32);
9393
| --------------------^^^^^^^^-
9494
| | |
9595
| | expected `u32`, found `f32`
@@ -98,7 +98,7 @@ error[E0308]: mismatched types
9898
help: the return type of this call is `f32` due to the type of the argument passed
9999
--> $DIR/debug_printf_type_checking.rs:22:9
100100
|
101-
22 | debug_printf!("%u", 11.0_f32);
101+
22 | debug_printf!("%u", 11.0_f32);
102102
| ^^^^^^^^^^^^^^^^^^^^--------^
103103
| |
104104
| this argument influences the return type of `debug_printf_assert_is_type`
@@ -110,14 +110,14 @@ note: function defined here
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`
112112
|
113-
22 - debug_printf!("%u", 11.0_f32);
114-
22 + debug_printf!("%u", 11u32);
113+
22 - debug_printf!("%u", 11.0_f32);
114+
22 + debug_printf!("%u", 11u32);
115115
|
116116

117117
error[E0277]: the trait bound `{float}: Vector<f32, 2>` is not satisfied
118118
--> $DIR/debug_printf_type_checking.rs:23:9
119119
|
120-
23 | debug_printf!("%v2f", 11.0);
120+
23 | debug_printf!("%v2f", 11.0);
121121
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `Vector<f32, 2>` is not implemented for `{float}`
122122
|
123123
= help: the following other types implement trait `Vector<T, N>`:
@@ -143,7 +143,7 @@ note: required by a bound in `debug_printf_assert_is_vector`
143143
error[E0308]: mismatched types
144144
--> $DIR/debug_printf_type_checking.rs:24:29
145145
|
146-
24 | debug_printf!("%f", Vec2::splat(33.3));
146+
24 | debug_printf!("%f", Vec2::splat(33.3));
147147
| --------------------^^^^^^^^^^^^^^^^^-
148148
| | |
149149
| | expected `f32`, found `Vec2`
@@ -152,7 +152,7 @@ error[E0308]: mismatched types
152152
help: the return type of this call is `Vec2` due to the type of the argument passed
153153
--> $DIR/debug_printf_type_checking.rs:24:9
154154
|
155-
24 | debug_printf!("%f", Vec2::splat(33.3));
155+
24 | debug_printf!("%f", Vec2::splat(33.3));
156156
| ^^^^^^^^^^^^^^^^^^^^-----------------^
157157
| |
158158
| this argument influences the return type of `debug_printf_assert_is_type`

tests/compiletests/ui/dis/ptr_copy.normal.stderr

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -12,17 +12,17 @@ note: used from within `core::ptr::copy::<f32>`
1212
note: called by `ptr_copy::copy_via_raw_ptr`
1313
--> $DIR/ptr_copy.rs:28:18
1414
|
15-
28 | unsafe { core::ptr::copy(src, dst, 1) }
15+
28 | unsafe { core::ptr::copy(src, dst, 1) }
1616
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
1717
note: called by `ptr_copy::main`
1818
--> $DIR/ptr_copy.rs:33:5
1919
|
20-
33 | copy_via_raw_ptr(&i, o);
20+
33 | copy_via_raw_ptr(&i, o);
2121
| ^^^^^^^^^^^^^^^^^^^^^^^
2222
note: called by `main`
2323
--> $DIR/ptr_copy.rs:32:8
2424
|
25-
32 | pub fn main(i: f32, o: &mut f32) {
25+
32 | pub fn main(i: f32, o: &mut f32) {
2626
| ^^^^
2727

2828
error: cannot cast between pointer types
@@ -51,17 +51,17 @@ note: used from within `core::ptr::copy::<f32>`
5151
note: called by `ptr_copy::copy_via_raw_ptr`
5252
--> $DIR/ptr_copy.rs:28:18
5353
|
54-
28 | unsafe { core::ptr::copy(src, dst, 1) }
54+
28 | unsafe { core::ptr::copy(src, dst, 1) }
5555
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
5656
note: called by `ptr_copy::main`
5757
--> $DIR/ptr_copy.rs:33:5
5858
|
59-
33 | copy_via_raw_ptr(&i, o);
59+
33 | copy_via_raw_ptr(&i, o);
6060
| ^^^^^^^^^^^^^^^^^^^^^^^
6161
note: called by `main`
6262
--> $DIR/ptr_copy.rs:32:8
6363
|
64-
32 | pub fn main(i: f32, o: &mut f32) {
64+
32 | pub fn main(i: f32, o: &mut f32) {
6565
| ^^^^
6666

6767
error: aborting due to 2 previous errors

tests/compiletests/ui/dis/ptr_read.stderr

Lines changed: 1 addition & 1 deletion
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 1737 8
5+
OpLine %8 1739 8
66
%9 = OpLoad %10 %4
77
OpLine %11 7 13
88
OpStore %6 %9

tests/compiletests/ui/dis/ptr_read_method.stderr

Lines changed: 1 addition & 1 deletion
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 1737 8
5+
OpLine %8 1739 8
66
%9 = OpLoad %10 %4
77
OpLine %11 7 13
88
OpStore %6 %9

0 commit comments

Comments
 (0)