Skip to content

Commit 83f8c72

Browse files
committed
rustup: update to nightly-2023-09-30.
1 parent 145a98d commit 83f8c72

18 files changed

+157
-56
lines changed

CHANGELOG.md

+1
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
3030
## [Unreleased]
3131

3232
### Changed 🛠
33+
- [PR#1100](https://github.com/EmbarkStudios/rust-gpu/pull/1100) updated toolchain to `nightly-2023-09-30`
3334
- [PR#1091](https://github.com/EmbarkStudios/rust-gpu/pull/1091) updated toolchain to `nightly-2023-08-29`
3435
- [PR#1085](https://github.com/EmbarkStudios/rust-gpu/pull/1085) updated toolchain to `nightly-2023-07-08`
3536

crates/rustc_codegen_spirv/build.rs

+2-2
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.toml");
1212
const REQUIRED_RUST_TOOLCHAIN: &str = r#"[toolchain]
13-
channel = "nightly-2023-08-29"
13+
channel = "nightly-2023-09-30"
1414
components = ["rust-src", "rustc-dev", "llvm-tools"]
15-
# commit_hash = 4e78abb437a0478d1f42115198ee45888e5330fd"#;
15+
# commit_hash = 8ce4540bd6fe7d58d4bc05f1b137d61937d3cf72"#;
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/abi.rs

+4-10
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ use rspirv::spirv::{StorageClass, Word};
88
use rustc_data_structures::fx::FxHashMap;
99
use rustc_errors::ErrorGuaranteed;
1010
use rustc_index::Idx;
11-
use rustc_middle::query::{ExternProviders, Providers};
11+
use rustc_middle::query::Providers;
1212
use rustc_middle::ty::layout::{FnAbiOf, LayoutOf, TyAndLayout};
1313
use rustc_middle::ty::GenericArgsRef;
1414
use rustc_middle::ty::{
@@ -174,12 +174,6 @@ pub(crate) fn provide(providers: &mut Providers) {
174174
};
175175
}
176176

177-
pub(crate) fn provide_extern(providers: &mut ExternProviders) {
178-
// Reset providers overriden in `provide`, that need to still go through the
179-
// `rustc_metadata::rmeta` decoding, as opposed to being locally computed.
180-
providers.fn_sig = rustc_interface::DEFAULT_EXTERN_QUERY_PROVIDERS.fn_sig;
181-
}
182-
183177
/// If a struct contains a pointer to itself, even indirectly, then doing a naiive recursive walk
184178
/// of the fields will result in an infinite loop. Because pointers are the only thing that are
185179
/// allowed to be recursive, keep track of what pointers we've translated, or are currently in the
@@ -312,7 +306,7 @@ impl<'tcx> ConvSpirvType<'tcx> for FnAbi<'tcx, Ty<'tcx>> {
312306
let return_type = match self.ret.mode {
313307
PassMode::Ignore => SpirvType::Void.def(span, cx),
314308
PassMode::Direct(_) | PassMode::Pair(..) => self.ret.layout.spirv_type(span, cx),
315-
PassMode::Cast(_, _) | PassMode::Indirect { .. } => span_bug!(
309+
PassMode::Cast { .. } | PassMode::Indirect { .. } => span_bug!(
316310
span,
317311
"query hooks should've made this `PassMode` impossible: {:#?}",
318312
self.ret
@@ -328,7 +322,7 @@ impl<'tcx> ConvSpirvType<'tcx> for FnAbi<'tcx, Ty<'tcx>> {
328322
argument_types.push(scalar_pair_element_backend_type(cx, span, arg.layout, 1));
329323
continue;
330324
}
331-
PassMode::Cast(_, _) | PassMode::Indirect { .. } => span_bug!(
325+
PassMode::Cast { .. } | PassMode::Indirect { .. } => span_bug!(
332326
span,
333327
"query hooks should've made this `PassMode` impossible: {:#?}",
334328
arg
@@ -867,7 +861,7 @@ fn trans_intrinsic_type<'tcx>(
867861
const_: Const<'tcx>,
868862
) -> Result<P, ErrorGuaranteed> {
869863
assert!(const_.ty().is_integral());
870-
let value = const_.eval_bits(cx.tcx, ParamEnv::reveal_all(), const_.ty());
864+
let value = const_.eval_bits(cx.tcx, ParamEnv::reveal_all());
871865
match P::from_u128(value) {
872866
Some(v) => Ok(v),
873867
None => Err(cx

crates/rustc_codegen_spirv/src/builder/byte_addressable_buffer.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -181,7 +181,7 @@ impl<'a, 'tcx> Builder<'a, 'tcx> {
181181
}
182182
// PassMode::Pair is identical to PassMode::Direct - it's returned as a struct
183183
PassMode::Direct(_) | PassMode::Pair(_, _) => (),
184-
PassMode::Cast(_, _) => {
184+
PassMode::Cast { .. } => {
185185
self.fatal("PassMode::Cast not supported in codegen_buffer_load_intrinsic")
186186
}
187187
PassMode::Indirect { .. } => {
@@ -349,7 +349,7 @@ impl<'a, 'tcx> Builder<'a, 'tcx> {
349349
PassMode::Ignore => return,
350350
PassMode::Direct(_) => false,
351351
PassMode::Pair(_, _) => true,
352-
PassMode::Cast(_, _) => {
352+
PassMode::Cast { .. } => {
353353
self.fatal("PassMode::Cast not supported in codegen_buffer_store_intrinsic")
354354
}
355355
PassMode::Indirect { .. } => {

crates/rustc_codegen_spirv/src/builder/mod.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -309,7 +309,7 @@ impl<'a, 'tcx> ArgAbiMethods<'tcx> for Builder<'a, 'tcx> {
309309
PassMode::Pair(..) => {
310310
OperandValue::Pair(next(self, idx), next(self, idx)).store(self, dst);
311311
}
312-
PassMode::Cast(_, _) | PassMode::Indirect { .. } => span_bug!(
312+
PassMode::Cast { .. } | PassMode::Indirect { .. } => span_bug!(
313313
self.span(),
314314
"query hooks should've made this `PassMode` impossible: {:#?}",
315315
arg_abi
@@ -328,7 +328,7 @@ impl<'a, 'tcx> ArgAbiMethods<'tcx> for Builder<'a, 'tcx> {
328328
PassMode::Direct(_) | PassMode::Pair(..) => {
329329
OperandValue::Immediate(val).store(self, dst);
330330
}
331-
PassMode::Cast(_, _) | PassMode::Indirect { .. } => span_bug!(
331+
PassMode::Cast { .. } | PassMode::Indirect { .. } => span_bug!(
332332
self.span(),
333333
"query hooks should've made this `PassMode` impossible: {:#?}",
334334
arg_abi

crates/rustc_codegen_spirv/src/builder_spirv.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -790,7 +790,7 @@ impl<'tcx> BuilderSpirv<'tcx> {
790790

791791
let file_contents = self
792792
.source_map
793-
.span_to_snippet(Span::with_root_ctxt(sf.start_pos, sf.end_pos))
793+
.span_to_snippet(Span::with_root_ctxt(sf.start_pos, sf.end_position()))
794794
.ok();
795795

796796
// HACK(eddyb) this logic is duplicated from `spirt::spv::lift`.

crates/rustc_codegen_spirv/src/codegen_cx/mod.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,8 @@ use rustc_codegen_ssa::traits::{
1818
AsmMethods, BackendTypes, DebugInfoMethods, GlobalAsmOperandRef, MiscMethods,
1919
};
2020
use rustc_data_structures::fx::{FxHashMap, FxHashSet};
21+
use rustc_middle::mir;
2122
use rustc_middle::mir::mono::CodegenUnit;
22-
use rustc_middle::mir::Body;
2323
use rustc_middle::ty::layout::{HasParamEnv, HasTyCtxt};
2424
use rustc_middle::ty::{Instance, ParamEnv, PolyExistentialTraitRef, Ty, TyCtxt};
2525
use rustc_session::Session;
@@ -861,8 +861,8 @@ impl<'tcx> DebugInfoMethods<'tcx> for CodegenCx<'tcx> {
861861
_instance: Instance<'tcx>,
862862
_fn_abi: &FnAbi<'tcx, Ty<'tcx>>,
863863
_llfn: Self::Function,
864-
_mir: &Body<'_>,
865-
) -> Option<FunctionDebugContext<Self::DIScope, Self::DILocation>> {
864+
_mir: &mir::Body<'tcx>,
865+
) -> Option<FunctionDebugContext<'tcx, Self::DIScope, Self::DILocation>> {
866866
// TODO: This is ignored. Do we want to implement this at some point?
867867
None
868868
}

crates/rustc_codegen_spirv/src/custom_decorations.rs

+12-10
Original file line numberDiff line numberDiff line change
@@ -458,8 +458,7 @@ impl<'a> SpanRegenerator<'a> {
458458
// Only use this `FileName` candidate if we either:
459459
// 1. reused a `SourceFile` with the right `src`/`external_src`
460460
// 2. allocated a new `SourceFile` with our choice of `src`
461-
self.source_map
462-
.ensure_source_file_source_present(sf.clone());
461+
self.source_map.ensure_source_file_source_present(&sf);
463462
let sf_src_matches = sf
464463
.src
465464
.as_ref()
@@ -499,7 +498,7 @@ impl<'a> SpanRegenerator<'a> {
499498
let multibyte_chars = {
500499
let find = |bpos| {
501500
file.multibyte_chars
502-
.binary_search_by_key(&bpos, |mbc| mbc.pos)
501+
.binary_search_by_key(&file.relative_position(bpos), |mbc| mbc.pos)
503502
.unwrap_or_else(|x| x)
504503
};
505504
let Range { start, end } = line_bpos_range;
@@ -508,7 +507,7 @@ impl<'a> SpanRegenerator<'a> {
508507
let non_narrow_chars = {
509508
let find = |bpos| {
510509
file.non_narrow_chars
511-
.binary_search_by_key(&bpos, |nnc| nnc.pos())
510+
.binary_search_by_key(&file.relative_position(bpos), |nnc| nnc.pos())
512511
.unwrap_or_else(|x| x)
513512
};
514513
let Range { start, end } = line_bpos_range;
@@ -524,12 +523,15 @@ impl<'a> SpanRegenerator<'a> {
524523
// itself is even worse than this, when it comes to `BytePos` lookups).
525524
let (mut cur_bpos, mut cur_col_display) = (line_bpos_range.start, 0);
526525
while cur_bpos < line_bpos_range.end && cur_col_display < col {
527-
let next_special_bpos = special_chars.peek().map(|special| {
528-
special
529-
.as_ref()
530-
.map_any(|mbc| mbc.pos, |nnc| nnc.pos())
531-
.reduce(|x, _| x)
532-
});
526+
let next_special_bpos = special_chars
527+
.peek()
528+
.map(|special| {
529+
special
530+
.as_ref()
531+
.map_any(|mbc| mbc.pos, |nnc| nnc.pos())
532+
.reduce(|x, _| x)
533+
})
534+
.map(|rel_bpos| file.absolute_position(rel_bpos));
533535

534536
// Batch trivial chars (i.e. chars 1:1 wrt `BytePos` vs `col_display`).
535537
let following_trivial_chars =

crates/rustc_codegen_spirv/src/lib.rs

+1-6
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,6 @@ use rustc_metadata::EncodedMetadata;
104104
use rustc_middle::dep_graph::{WorkProduct, WorkProductId};
105105
use rustc_middle::mir::mono::{MonoItem, MonoItemData};
106106
use rustc_middle::mir::pretty::write_mir_pretty;
107-
use rustc_middle::query;
108107
use rustc_middle::ty::print::with_no_trimmed_paths;
109108
use rustc_middle::ty::{self, Instance, InstanceDef, TyCtxt};
110109
use rustc_session::config::{self, OutputFilenames, OutputType};
@@ -219,7 +218,7 @@ impl CodegenBackend for SpirvCodegenBackend {
219218
}
220219
}
221220

222-
fn provide(&self, providers: &mut query::Providers) {
221+
fn provide(&self, providers: &mut rustc_middle::util::Providers) {
223222
// FIXME(eddyb) this is currently only passed back to us, specifically
224223
// into `target_machine_factory` (which is a noop), but it might make
225224
// sense to move some of the target feature parsing into here.
@@ -229,10 +228,6 @@ impl CodegenBackend for SpirvCodegenBackend {
229228
crate::attr::provide(providers);
230229
}
231230

232-
fn provide_extern(&self, providers: &mut query::ExternProviders) {
233-
crate::abi::provide_extern(providers);
234-
}
235-
236231
fn codegen_crate(
237232
&self,
238233
tcx: TyCtxt<'_>,

crates/rustc_codegen_spirv/src/link.rs

+4-5
Original file line numberDiff line numberDiff line change
@@ -616,11 +616,10 @@ pub(crate) fn run_thin(
616616
if cgcx.opts.cg.linker_plugin_lto.enabled() {
617617
unreachable!("We should never reach this case if the LTO step is deferred to the linker");
618618
}
619-
if cgcx.lto != Lto::ThinLocal {
620-
for _ in cgcx.each_linked_rlib_for_lto.iter() {
621-
bug!("TODO: Implement whatever the heck this is");
622-
}
623-
}
619+
assert!(
620+
cgcx.lto == Lto::ThinLocal,
621+
"no actual LTO implemented in Rust-GPU"
622+
);
624623
let mut thin_buffers = Vec::with_capacity(modules.len());
625624
let mut module_names = Vec::with_capacity(modules.len() + cached_modules.len());
626625

crates/rustc_codegen_spirv/src/linker/test.rs

+6-4
Original file line numberDiff line numberDiff line change
@@ -146,14 +146,15 @@ fn link_with_linker_opts(
146146
output_file: None,
147147
temps_dir: None,
148148
},
149-
None,
149+
Default::default(),
150150
Registry::new(&[]),
151151
Default::default(),
152152
Default::default(),
153-
None,
154-
None,
153+
Default::default(),
154+
Default::default(),
155155
rustc_interface::util::rustc_version_str().unwrap_or("unknown"),
156-
None,
156+
Default::default(),
157+
Default::default(),
157158
);
158159

159160
// HACK(eddyb) inject `write_diags` into `sess`, to work around
@@ -179,6 +180,7 @@ fn link_with_linker_opts(
179180
modules,
180181
opts,
181182
&OutputFilenames::new(
183+
"".into(),
182184
"".into(),
183185
"".into(),
184186
None,

rust-toolchain.toml

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
[toolchain]
2-
channel = "nightly-2023-08-29"
2+
channel = "nightly-2023-09-30"
33
components = ["rust-src", "rustc-dev", "llvm-tools"]
4-
# commit_hash = 4e78abb437a0478d1f42115198ee45888e5330fd
4+
# commit_hash = 8ce4540bd6fe7d58d4bc05f1b137d61937d3cf72
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/dis/ptr_copy.normal.stderr

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
error: cannot memcpy dynamically sized data
2-
--> $CORE_SRC/intrinsics.rs:2771:9
2+
--> $CORE_SRC/intrinsics.rs:2778:9
33
|
4-
2771 | copy(src, dst, count)
4+
2778 | copy(src, dst, count)
55
| ^^^^^^^^^^^^^^^^^^^^^
66
|
77
note: used from within `core::intrinsics::copy::<f32>`
8-
--> $CORE_SRC/intrinsics.rs:2757:21
8+
--> $CORE_SRC/intrinsics.rs:2764:21
99
|
10-
2757 | pub const unsafe fn copy<T>(src: *const T, dst: *mut T, count: usize) {
10+
2764 | 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

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 1180 8
5+
OpLine %8 1183 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 1180 8
5+
OpLine %8 1183 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 1379 8
7+
OpLine %11 1382 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 1379 8
7+
OpLine %11 1382 8
88
OpStore %6 %9
99
OpNoLine
1010
OpReturn

0 commit comments

Comments
 (0)