Skip to content

Commit d78c301

Browse files
oisyneddyb
authored andcommitted
Update to 2023-01-21
1 parent 56ef15c commit d78c301

File tree

14 files changed

+59
-25
lines changed

14 files changed

+59
-25
lines changed

crates/rustc_codegen_spirv/build.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,9 @@ use std::process::{Command, ExitCode};
1010
/// `cargo publish`. We need to figure out a way to do this properly, but let's hardcode it for now :/
1111
//const REQUIRED_RUST_TOOLCHAIN: &str = include_str!("../../rust-toolchain");
1212
const REQUIRED_RUST_TOOLCHAIN: &str = r#"[toolchain]
13-
channel = "nightly-2022-12-18"
13+
channel = "nightly-2023-01-21"
1414
components = ["rust-src", "rustc-dev", "llvm-tools-preview"]
15-
# commit_hash = 0468a00ae3fd6ef1a6a0f9eaf637d7aa9e604acc"#;
15+
# commit_hash = 5ce39f42bd2c8bca9c570f0560ebe1fce4eddb14"#;
1616

1717
fn get_rustc_commit_hash() -> Result<String, Box<dyn Error>> {
1818
let rustc = std::env::var("RUSTC").unwrap_or_else(|_| String::from("rustc"));

crates/rustc_codegen_spirv/src/attr.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -302,7 +302,7 @@ impl CheckSpirvAttrVisitor<'_> {
302302
| SpirvAttribute::Invariant
303303
| SpirvAttribute::InputAttachmentIndex(_) => match target {
304304
Target::Param => {
305-
let parent_hir_id = self.tcx.hir().get_parent_node(hir_id);
305+
let parent_hir_id = self.tcx.hir().parent_id(hir_id);
306306
let parent_is_entry_point =
307307
parse_attrs(self.tcx.hir().attrs(parent_hir_id))
308308
.filter_map(|r| r.ok())

crates/rustc_codegen_spirv/src/lib.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,8 @@ fn is_blocklisted_fn<'tcx>(
142142
Some(assoc) if assoc.ident(tcx).name == sym::fmt => match assoc.container {
143143
ty::ImplContainer => {
144144
let impl_def_id = assoc.container_id(tcx);
145-
tcx.impl_trait_ref(impl_def_id).map(|tr| tr.def_id)
145+
tcx.impl_trait_ref(impl_def_id)
146+
.map(|tr| tr.subst_identity().def_id)
146147
== Some(debug_trait_def_id)
147148
}
148149
ty::TraitContainer => false,

crates/rustc_codegen_spirv/src/linker/spirt_passes/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -257,7 +257,7 @@ const _: () = {
257257
// HACK(eddyb) this works around the accidental lack of `spirt::Value: Hash`.
258258
#[derive(Copy, Clone, PartialEq, Eq)]
259259
struct HashableValue(Value);
260-
#[allow(clippy::derive_hash_xor_eq)]
260+
#[allow(clippy::derived_hash_with_manual_eq)]
261261
impl Hash for HashableValue {
262262
fn hash<H: std::hash::Hasher>(&self, state: &mut H) {
263263
use spirt::*;

crates/rustc_codegen_spirv/src/linker/test.rs

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@ use super::{link, LinkResult};
22
use pipe::pipe;
33
use rspirv::dr::{Loader, Module};
44
use rustc_errors::registry::Registry;
5+
use rustc_session::{config::Input, CompilerIO};
6+
use rustc_span::FileName;
57
use std::io::Read;
68

79
// https://github.com/colin-kiegel/rust-pretty-assertions/issues/24
@@ -130,7 +132,15 @@ fn link_with_linker_opts(
130132
rustc_span::create_session_globals_then(sopts.edition, || {
131133
let mut sess = rustc_session::build_session(
132134
sopts,
133-
None,
135+
CompilerIO {
136+
input: Input::Str {
137+
name: FileName::Custom(String::new()),
138+
input: String::new(),
139+
},
140+
output_dir: None,
141+
output_file: None,
142+
temps_dir: None,
143+
},
134144
None,
135145
Registry::new(&[]),
136146
Default::default(),

rust-toolchain

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,13 @@
1-
# If you see this, run `rustup self update` to get rustup 1.23 or newer.
1+
# If you see this, run `rustup self update` to get rustup 1.23 or newer
22

3-
# NOTE: above comment is for older `rustup` (before TOML support was added),
3+
# NOTE: above comment is for older `rustup` (before TOML support was added)
44
# which will treat the first line as the toolchain name, and therefore show it
5-
# to the user in the error, instead of "error: invalid channel name '[toolchain]'".
5+
# to the user in the error, instead of "error: invalid channel name '[toolchain]'"
66

77
[toolchain]
8-
channel = "nightly-2022-12-18"
8+
channel = "nightly-2023-01-21"
99
components = ["rust-src", "rustc-dev", "llvm-tools-preview"]
10-
# commit_hash = 0468a00ae3fd6ef1a6a0f9eaf637d7aa9e604acc
10+
# commit_hash = 5ce39f42bd2c8bca9c570f0560ebe1fce4eddb14
1111

1212
# Whenever changing the nightly channel, update the commit hash above, and make
13-
# sure to change REQUIRED_TOOLCHAIN in crates/rustc_codegen_spirv/src/build.rs also.
14-
13+
# sure to change REQUIRED_TOOLCHAIN in crates/rustc_codegen_spirv/src/build.rs also

tests/ui/arch/debug_printf_type_checking.stderr

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,11 +67,19 @@ error[E0308]: mismatched types
6767
| | expected `f32`, found `u32`
6868
| arguments to this function are incorrect
6969
|
70+
help: the return type of this call is `u32` due to the type of the argument passed
71+
--> $DIR/debug_printf_type_checking.rs:21:9
72+
|
73+
21 | debug_printf!("%f", 11_u32);
74+
| ^^^^^^^^^^^^^^^^^^^^------^
75+
| |
76+
| this argument influences the return type of `spirv_std`
7077
note: function defined here
7178
--> $SPIRV_STD_SRC/lib.rs:144:8
7279
|
7380
144 | pub fn debug_printf_assert_is_type<T>(ty: T) -> T {
7481
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^
82+
= note: this error originates in the macro `debug_printf` (in Nightly builds, run with -Z macro-backtrace for more info)
7583
help: change the type of the numeric literal from `u32` to `f32`
7684
|
7785
21 | debug_printf!("%f", 11_f32);
@@ -86,11 +94,19 @@ error[E0308]: mismatched types
8694
| | expected `u32`, found `f32`
8795
| arguments to this function are incorrect
8896
|
97+
help: the return type of this call is `f32` due to the type of the argument passed
98+
--> $DIR/debug_printf_type_checking.rs:22:9
99+
|
100+
22 | debug_printf!("%u", 11.0_f32);
101+
| ^^^^^^^^^^^^^^^^^^^^--------^
102+
| |
103+
| this argument influences the return type of `spirv_std`
89104
note: function defined here
90105
--> $SPIRV_STD_SRC/lib.rs:144:8
91106
|
92107
144 | pub fn debug_printf_assert_is_type<T>(ty: T) -> T {
93108
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^
109+
= note: this error originates in the macro `debug_printf` (in Nightly builds, run with -Z macro-backtrace for more info)
94110
help: change the type of the numeric literal from `f32` to `u32`
95111
|
96112
22 | debug_printf!("%u", 11u32);
@@ -130,11 +146,19 @@ error[E0308]: mismatched types
130146
| | expected `f32`, found struct `Vec2`
131147
| arguments to this function are incorrect
132148
|
149+
help: the return type of this call is `Vec2` due to the type of the argument passed
150+
--> $DIR/debug_printf_type_checking.rs:24:9
151+
|
152+
24 | debug_printf!("%f", Vec2::splat(33.3));
153+
| ^^^^^^^^^^^^^^^^^^^^-----------------^
154+
| |
155+
| this argument influences the return type of `spirv_std`
133156
note: function defined here
134157
--> $SPIRV_STD_SRC/lib.rs:144:8
135158
|
136159
144 | pub fn debug_printf_assert_is_type<T>(ty: T) -> T {
137160
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^
161+
= note: this error originates in the macro `debug_printf` (in Nightly builds, run with -Z macro-backtrace for more info)
138162

139163
error: aborting due to 14 previous errors
140164

tests/ui/dis/ptr_copy.normal.stderr

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
error: Cannot memcpy dynamically sized data
2-
--> $CORE_SRC/intrinsics.rs:2519:9
2+
--> $CORE_SRC/intrinsics.rs:2458:9
33
|
4-
2519 | copy(src, dst, count)
4+
2458 | copy(src, dst, count)
55
| ^^^^^^^^^^^^^^^^^^^^^
66
|
77
= note: Stack:

tests/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 1135 8
5+
OpLine %8 1157 8
66
%9 = OpLoad %10 %4
77
OpLine %11 9 13
88
OpStore %6 %9

tests/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 1135 8
5+
OpLine %8 1157 8
66
%9 = OpLoad %10 %4
77
OpLine %11 9 13
88
OpStore %6 %9

tests/ui/dis/ptr_write.stderr

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
%7 = OpLabel
55
OpLine %8 9 35
66
%9 = OpLoad %10 %4
7-
OpLine %11 1332 8
7+
OpLine %11 1354 8
88
OpStore %6 %9
99
OpNoLine
1010
OpReturn

tests/ui/dis/ptr_write_method.stderr

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
%7 = OpLabel
55
OpLine %8 9 37
66
%9 = OpLoad %10 %4
7-
OpLine %11 1332 8
7+
OpLine %11 1354 8
88
OpStore %6 %9
99
OpNoLine
1010
OpReturn

tests/ui/image/gather_err.stderr

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,11 @@ error[E0277]: the trait bound `Image<f32, 0, 2, 0, 0, 1, 0>: HasGather` is not s
88
Image<SampledType, 1, DEPTH, ARRAYED, 0, SAMPLED, FORMAT>
99
Image<SampledType, 3, DEPTH, ARRAYED, 0, SAMPLED, FORMAT>
1010
Image<SampledType, 4, DEPTH, ARRAYED, 0, SAMPLED, FORMAT>
11-
note: required by a bound in `Image::<SampledType, DIM, DEPTH, ARRAYED, _, SAMPLED, FORMAT>::gather`
11+
note: required by a bound in `Image::<SampledType, DIM, DEPTH, ARRAYED, spirv_std::::image::{impl#1}::{constant#0}, SAMPLED, FORMAT>::gather`
1212
--> $SPIRV_STD_SRC/image.rs:163:15
1313
|
1414
163 | Self: HasGather,
15-
| ^^^^^^^^^ required by this bound in `Image::<SampledType, DIM, DEPTH, ARRAYED, _, SAMPLED, FORMAT>::gather`
15+
| ^^^^^^^^^ required by this bound in `Image::<SampledType, DIM, DEPTH, ARRAYED, spirv_std::::image::{impl#1}::{constant#0}, SAMPLED, FORMAT>::gather`
1616

1717
error[E0277]: the trait bound `Image<f32, 2, 2, 0, 0, 1, 0>: HasGather` is not satisfied
1818
--> $DIR/gather_err.rs:16:34
@@ -24,11 +24,11 @@ error[E0277]: the trait bound `Image<f32, 2, 2, 0, 0, 1, 0>: HasGather` is not s
2424
Image<SampledType, 1, DEPTH, ARRAYED, 0, SAMPLED, FORMAT>
2525
Image<SampledType, 3, DEPTH, ARRAYED, 0, SAMPLED, FORMAT>
2626
Image<SampledType, 4, DEPTH, ARRAYED, 0, SAMPLED, FORMAT>
27-
note: required by a bound in `Image::<SampledType, DIM, DEPTH, ARRAYED, _, SAMPLED, FORMAT>::gather`
27+
note: required by a bound in `Image::<SampledType, DIM, DEPTH, ARRAYED, spirv_std::::image::{impl#1}::{constant#0}, SAMPLED, FORMAT>::gather`
2828
--> $SPIRV_STD_SRC/image.rs:163:15
2929
|
3030
163 | Self: HasGather,
31-
| ^^^^^^^^^ required by this bound in `Image::<SampledType, DIM, DEPTH, ARRAYED, _, SAMPLED, FORMAT>::gather`
31+
| ^^^^^^^^^ required by this bound in `Image::<SampledType, DIM, DEPTH, ARRAYED, spirv_std::::image::{impl#1}::{constant#0}, SAMPLED, FORMAT>::gather`
3232

3333
error: aborting due to 2 previous errors
3434

tests/ui/image/query/query_size_lod_err.stderr

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,11 @@ error[E0277]: the trait bound `Image<f32, 4, 2, 0, 0, 1, 0>: HasQuerySizeLod` is
99
Image<SampledType, 1, DEPTH, ARRAYED, 0, SAMPLED, FORMAT>
1010
Image<SampledType, 2, DEPTH, ARRAYED, 0, SAMPLED, FORMAT>
1111
Image<SampledType, 3, DEPTH, ARRAYED, 0, SAMPLED, FORMAT>
12-
note: required by a bound in `Image::<SampledType, DIM, DEPTH, ARRAYED, _, SAMPLED, FORMAT>::query_size_lod`
12+
note: required by a bound in `Image::<SampledType, DIM, DEPTH, ARRAYED, spirv_std::::image::{impl#7}::{constant#0}, SAMPLED, FORMAT>::query_size_lod`
1313
--> $SPIRV_STD_SRC/image.rs:903:15
1414
|
1515
903 | Self: HasQuerySizeLod,
16-
| ^^^^^^^^^^^^^^^ required by this bound in `Image::<SampledType, DIM, DEPTH, ARRAYED, _, SAMPLED, FORMAT>::query_size_lod`
16+
| ^^^^^^^^^^^^^^^ required by this bound in `Image::<SampledType, DIM, DEPTH, ARRAYED, spirv_std::::image::{impl#7}::{constant#0}, SAMPLED, FORMAT>::query_size_lod`
1717

1818
error: aborting due to previous error
1919

0 commit comments

Comments
 (0)