Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

rustup: update to nightly-2023-09-30. #1100

Merged
merged 1 commit into from
Nov 22, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
## [Unreleased]

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

Expand Down
4 changes: 2 additions & 2 deletions crates/rustc_codegen_spirv/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@ use std::process::{Command, ExitCode};
/// `cargo publish`. We need to figure out a way to do this properly, but let's hardcode it for now :/
//const REQUIRED_RUST_TOOLCHAIN: &str = include_str!("../../rust-toolchain.toml");
const REQUIRED_RUST_TOOLCHAIN: &str = r#"[toolchain]
channel = "nightly-2023-08-29"
channel = "nightly-2023-09-30"
components = ["rust-src", "rustc-dev", "llvm-tools"]
# commit_hash = 4e78abb437a0478d1f42115198ee45888e5330fd"#;
# commit_hash = 8ce4540bd6fe7d58d4bc05f1b137d61937d3cf72"#;

fn get_rustc_commit_hash() -> Result<String, Box<dyn Error>> {
let rustc = std::env::var("RUSTC").unwrap_or_else(|_| String::from("rustc"));
Expand Down
14 changes: 4 additions & 10 deletions crates/rustc_codegen_spirv/src/abi.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ use rspirv::spirv::{StorageClass, Word};
use rustc_data_structures::fx::FxHashMap;
use rustc_errors::ErrorGuaranteed;
use rustc_index::Idx;
use rustc_middle::query::{ExternProviders, Providers};
use rustc_middle::query::Providers;
use rustc_middle::ty::layout::{FnAbiOf, LayoutOf, TyAndLayout};
use rustc_middle::ty::GenericArgsRef;
use rustc_middle::ty::{
Expand Down Expand Up @@ -174,12 +174,6 @@ pub(crate) fn provide(providers: &mut Providers) {
};
}

pub(crate) fn provide_extern(providers: &mut ExternProviders) {
// Reset providers overriden in `provide`, that need to still go through the
// `rustc_metadata::rmeta` decoding, as opposed to being locally computed.
providers.fn_sig = rustc_interface::DEFAULT_EXTERN_QUERY_PROVIDERS.fn_sig;
}

/// If a struct contains a pointer to itself, even indirectly, then doing a naiive recursive walk
/// of the fields will result in an infinite loop. Because pointers are the only thing that are
/// allowed to be recursive, keep track of what pointers we've translated, or are currently in the
Expand Down Expand Up @@ -312,7 +306,7 @@ impl<'tcx> ConvSpirvType<'tcx> for FnAbi<'tcx, Ty<'tcx>> {
let return_type = match self.ret.mode {
PassMode::Ignore => SpirvType::Void.def(span, cx),
PassMode::Direct(_) | PassMode::Pair(..) => self.ret.layout.spirv_type(span, cx),
PassMode::Cast(_, _) | PassMode::Indirect { .. } => span_bug!(
PassMode::Cast { .. } | PassMode::Indirect { .. } => span_bug!(
span,
"query hooks should've made this `PassMode` impossible: {:#?}",
self.ret
Expand All @@ -328,7 +322,7 @@ impl<'tcx> ConvSpirvType<'tcx> for FnAbi<'tcx, Ty<'tcx>> {
argument_types.push(scalar_pair_element_backend_type(cx, span, arg.layout, 1));
continue;
}
PassMode::Cast(_, _) | PassMode::Indirect { .. } => span_bug!(
PassMode::Cast { .. } | PassMode::Indirect { .. } => span_bug!(
span,
"query hooks should've made this `PassMode` impossible: {:#?}",
arg
Expand Down Expand Up @@ -867,7 +861,7 @@ fn trans_intrinsic_type<'tcx>(
const_: Const<'tcx>,
) -> Result<P, ErrorGuaranteed> {
assert!(const_.ty().is_integral());
let value = const_.eval_bits(cx.tcx, ParamEnv::reveal_all(), const_.ty());
let value = const_.eval_bits(cx.tcx, ParamEnv::reveal_all());
match P::from_u128(value) {
Some(v) => Ok(v),
None => Err(cx
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@ impl<'a, 'tcx> Builder<'a, 'tcx> {
}
// PassMode::Pair is identical to PassMode::Direct - it's returned as a struct
PassMode::Direct(_) | PassMode::Pair(_, _) => (),
PassMode::Cast(_, _) => {
PassMode::Cast { .. } => {
self.fatal("PassMode::Cast not supported in codegen_buffer_load_intrinsic")
}
PassMode::Indirect { .. } => {
Expand Down Expand Up @@ -349,7 +349,7 @@ impl<'a, 'tcx> Builder<'a, 'tcx> {
PassMode::Ignore => return,
PassMode::Direct(_) => false,
PassMode::Pair(_, _) => true,
PassMode::Cast(_, _) => {
PassMode::Cast { .. } => {
self.fatal("PassMode::Cast not supported in codegen_buffer_store_intrinsic")
}
PassMode::Indirect { .. } => {
Expand Down
4 changes: 2 additions & 2 deletions crates/rustc_codegen_spirv/src/builder/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -309,7 +309,7 @@ impl<'a, 'tcx> ArgAbiMethods<'tcx> for Builder<'a, 'tcx> {
PassMode::Pair(..) => {
OperandValue::Pair(next(self, idx), next(self, idx)).store(self, dst);
}
PassMode::Cast(_, _) | PassMode::Indirect { .. } => span_bug!(
PassMode::Cast { .. } | PassMode::Indirect { .. } => span_bug!(
self.span(),
"query hooks should've made this `PassMode` impossible: {:#?}",
arg_abi
Expand All @@ -328,7 +328,7 @@ impl<'a, 'tcx> ArgAbiMethods<'tcx> for Builder<'a, 'tcx> {
PassMode::Direct(_) | PassMode::Pair(..) => {
OperandValue::Immediate(val).store(self, dst);
}
PassMode::Cast(_, _) | PassMode::Indirect { .. } => span_bug!(
PassMode::Cast { .. } | PassMode::Indirect { .. } => span_bug!(
self.span(),
"query hooks should've made this `PassMode` impossible: {:#?}",
arg_abi
Expand Down
2 changes: 1 addition & 1 deletion crates/rustc_codegen_spirv/src/builder_spirv.rs
Original file line number Diff line number Diff line change
Expand Up @@ -790,7 +790,7 @@ impl<'tcx> BuilderSpirv<'tcx> {

let file_contents = self
.source_map
.span_to_snippet(Span::with_root_ctxt(sf.start_pos, sf.end_pos))
.span_to_snippet(Span::with_root_ctxt(sf.start_pos, sf.end_position()))
.ok();

// HACK(eddyb) this logic is duplicated from `spirt::spv::lift`.
Expand Down
6 changes: 3 additions & 3 deletions crates/rustc_codegen_spirv/src/codegen_cx/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ use rustc_codegen_ssa::traits::{
AsmMethods, BackendTypes, DebugInfoMethods, GlobalAsmOperandRef, MiscMethods,
};
use rustc_data_structures::fx::{FxHashMap, FxHashSet};
use rustc_middle::mir;
use rustc_middle::mir::mono::CodegenUnit;
use rustc_middle::mir::Body;
use rustc_middle::ty::layout::{HasParamEnv, HasTyCtxt};
use rustc_middle::ty::{Instance, ParamEnv, PolyExistentialTraitRef, Ty, TyCtxt};
use rustc_session::Session;
Expand Down Expand Up @@ -861,8 +861,8 @@ impl<'tcx> DebugInfoMethods<'tcx> for CodegenCx<'tcx> {
_instance: Instance<'tcx>,
_fn_abi: &FnAbi<'tcx, Ty<'tcx>>,
_llfn: Self::Function,
_mir: &Body<'_>,
) -> Option<FunctionDebugContext<Self::DIScope, Self::DILocation>> {
_mir: &mir::Body<'tcx>,
) -> Option<FunctionDebugContext<'tcx, Self::DIScope, Self::DILocation>> {
// TODO: This is ignored. Do we want to implement this at some point?
None
}
Expand Down
22 changes: 12 additions & 10 deletions crates/rustc_codegen_spirv/src/custom_decorations.rs
Original file line number Diff line number Diff line change
Expand Up @@ -458,8 +458,7 @@ impl<'a> SpanRegenerator<'a> {
// Only use this `FileName` candidate if we either:
// 1. reused a `SourceFile` with the right `src`/`external_src`
// 2. allocated a new `SourceFile` with our choice of `src`
self.source_map
.ensure_source_file_source_present(sf.clone());
self.source_map.ensure_source_file_source_present(&sf);
let sf_src_matches = sf
.src
.as_ref()
Expand Down Expand Up @@ -499,7 +498,7 @@ impl<'a> SpanRegenerator<'a> {
let multibyte_chars = {
let find = |bpos| {
file.multibyte_chars
.binary_search_by_key(&bpos, |mbc| mbc.pos)
.binary_search_by_key(&file.relative_position(bpos), |mbc| mbc.pos)
.unwrap_or_else(|x| x)
};
let Range { start, end } = line_bpos_range;
Expand All @@ -508,7 +507,7 @@ impl<'a> SpanRegenerator<'a> {
let non_narrow_chars = {
let find = |bpos| {
file.non_narrow_chars
.binary_search_by_key(&bpos, |nnc| nnc.pos())
.binary_search_by_key(&file.relative_position(bpos), |nnc| nnc.pos())
.unwrap_or_else(|x| x)
};
let Range { start, end } = line_bpos_range;
Expand All @@ -524,12 +523,15 @@ impl<'a> SpanRegenerator<'a> {
// itself is even worse than this, when it comes to `BytePos` lookups).
let (mut cur_bpos, mut cur_col_display) = (line_bpos_range.start, 0);
while cur_bpos < line_bpos_range.end && cur_col_display < col {
let next_special_bpos = special_chars.peek().map(|special| {
special
.as_ref()
.map_any(|mbc| mbc.pos, |nnc| nnc.pos())
.reduce(|x, _| x)
});
let next_special_bpos = special_chars
.peek()
.map(|special| {
special
.as_ref()
.map_any(|mbc| mbc.pos, |nnc| nnc.pos())
.reduce(|x, _| x)
})
.map(|rel_bpos| file.absolute_position(rel_bpos));

// Batch trivial chars (i.e. chars 1:1 wrt `BytePos` vs `col_display`).
let following_trivial_chars =
Expand Down
7 changes: 1 addition & 6 deletions crates/rustc_codegen_spirv/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,6 @@ use rustc_metadata::EncodedMetadata;
use rustc_middle::dep_graph::{WorkProduct, WorkProductId};
use rustc_middle::mir::mono::{MonoItem, MonoItemData};
use rustc_middle::mir::pretty::write_mir_pretty;
use rustc_middle::query;
use rustc_middle::ty::print::with_no_trimmed_paths;
use rustc_middle::ty::{self, Instance, InstanceDef, TyCtxt};
use rustc_session::config::{self, OutputFilenames, OutputType};
Expand Down Expand Up @@ -219,7 +218,7 @@ impl CodegenBackend for SpirvCodegenBackend {
}
}

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

fn provide_extern(&self, providers: &mut query::ExternProviders) {
crate::abi::provide_extern(providers);
}

fn codegen_crate(
&self,
tcx: TyCtxt<'_>,
Expand Down
9 changes: 4 additions & 5 deletions crates/rustc_codegen_spirv/src/link.rs
Original file line number Diff line number Diff line change
Expand Up @@ -616,11 +616,10 @@ pub(crate) fn run_thin(
if cgcx.opts.cg.linker_plugin_lto.enabled() {
unreachable!("We should never reach this case if the LTO step is deferred to the linker");
}
if cgcx.lto != Lto::ThinLocal {
for _ in cgcx.each_linked_rlib_for_lto.iter() {
bug!("TODO: Implement whatever the heck this is");
}
}
assert!(
cgcx.lto == Lto::ThinLocal,
"no actual LTO implemented in Rust-GPU"
);
let mut thin_buffers = Vec::with_capacity(modules.len());
let mut module_names = Vec::with_capacity(modules.len() + cached_modules.len());

Expand Down
10 changes: 6 additions & 4 deletions crates/rustc_codegen_spirv/src/linker/test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -146,14 +146,15 @@ fn link_with_linker_opts(
output_file: None,
temps_dir: None,
},
None,
Default::default(),
Registry::new(&[]),
Default::default(),
Default::default(),
None,
None,
Default::default(),
Default::default(),
rustc_interface::util::rustc_version_str().unwrap_or("unknown"),
None,
Default::default(),
Default::default(),
);

// HACK(eddyb) inject `write_diags` into `sess`, to work around
Expand All @@ -179,6 +180,7 @@ fn link_with_linker_opts(
modules,
opts,
&OutputFilenames::new(
"".into(),
"".into(),
"".into(),
None,
Expand Down
4 changes: 2 additions & 2 deletions rust-toolchain.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[toolchain]
channel = "nightly-2023-08-29"
channel = "nightly-2023-09-30"
components = ["rust-src", "rustc-dev", "llvm-tools"]
# commit_hash = 4e78abb437a0478d1f42115198ee45888e5330fd
# commit_hash = 8ce4540bd6fe7d58d4bc05f1b137d61937d3cf72

# Whenever changing the nightly channel, update the commit hash above, and make
# sure to change `REQUIRED_TOOLCHAIN` in `crates/rustc_codegen_spirv/build.rs` also.
8 changes: 4 additions & 4 deletions tests/ui/dis/ptr_copy.normal.stderr
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
error: cannot memcpy dynamically sized data
--> $CORE_SRC/intrinsics.rs:2771:9
--> $CORE_SRC/intrinsics.rs:2778:9
|
2771 | copy(src, dst, count)
2778 | copy(src, dst, count)
| ^^^^^^^^^^^^^^^^^^^^^
|
note: used from within `core::intrinsics::copy::<f32>`
--> $CORE_SRC/intrinsics.rs:2757:21
--> $CORE_SRC/intrinsics.rs:2764:21
|
2757 | pub const unsafe fn copy<T>(src: *const T, dst: *mut T, count: usize) {
2764 | pub const unsafe fn copy<T>(src: *const T, dst: *mut T, count: usize) {
| ^^^^
note: called by `ptr_copy::copy_via_raw_ptr`
--> $DIR/ptr_copy.rs:28:18
Expand Down
2 changes: 1 addition & 1 deletion tests/ui/dis/ptr_read.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
%4 = OpFunctionParameter %5
%6 = OpFunctionParameter %5
%7 = OpLabel
OpLine %8 1180 8
OpLine %8 1183 8
%9 = OpLoad %10 %4
OpLine %11 7 13
OpStore %6 %9
Expand Down
2 changes: 1 addition & 1 deletion tests/ui/dis/ptr_read_method.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
%4 = OpFunctionParameter %5
%6 = OpFunctionParameter %5
%7 = OpLabel
OpLine %8 1180 8
OpLine %8 1183 8
%9 = OpLoad %10 %4
OpLine %11 7 13
OpStore %6 %9
Expand Down
2 changes: 1 addition & 1 deletion tests/ui/dis/ptr_write.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
%7 = OpLabel
OpLine %8 7 35
%9 = OpLoad %10 %4
OpLine %11 1379 8
OpLine %11 1382 8
OpStore %6 %9
OpNoLine
OpReturn
Expand Down
2 changes: 1 addition & 1 deletion tests/ui/dis/ptr_write_method.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
%7 = OpLabel
OpLine %8 7 37
%9 = OpLoad %10 %4
OpLine %11 1379 8
OpLine %11 1382 8
OpStore %6 %9
OpNoLine
OpReturn
Expand Down
Loading
Loading