From 122414e686a15ba89d9eb700a56bf8cce34b942d Mon Sep 17 00:00:00 2001 From: Eduard-Mihai Burtescu Date: Fri, 2 Aug 2024 14:43:49 +0300 Subject: [PATCH] rustup: update to `nightly-2024-01-06`. --- crates/rustc_codegen_spirv/build.rs | 4 ++-- crates/rustc_codegen_spirv/src/builder/intrinsics.rs | 5 ++++- crates/rustc_codegen_spirv/src/builder/mod.rs | 8 +++++--- crates/rustc_codegen_spirv/src/custom_decorations.rs | 5 ++++- crates/rustc_codegen_spirv/src/link.rs | 2 +- crates/rustc_codegen_spirv/src/linker/specializer.rs | 5 ++++- crates/rustc_codegen_spirv/src/linker/test.rs | 2 +- rust-toolchain.toml | 4 ++-- 8 files changed, 23 insertions(+), 12 deletions(-) diff --git a/crates/rustc_codegen_spirv/build.rs b/crates/rustc_codegen_spirv/build.rs index 755485c263..78565326a7 100644 --- a/crates/rustc_codegen_spirv/build.rs +++ b/crates/rustc_codegen_spirv/build.rs @@ -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-2024-01-05" +channel = "nightly-2024-01-06" components = ["rust-src", "rustc-dev", "llvm-tools"] -# commit_hash = f688dd684faca5b31b156fac2c6e0ae81fc9bc90"#; +# commit_hash = 595bc6f00369475047538fdae1ff8cea692ac385"#; fn get_rustc_commit_hash() -> Result> { let rustc = std::env::var("RUSTC").unwrap_or_else(|_| String::from("rustc")); diff --git a/crates/rustc_codegen_spirv/src/builder/intrinsics.rs b/crates/rustc_codegen_spirv/src/builder/intrinsics.rs index 45e9b861c6..9e610955a8 100644 --- a/crates/rustc_codegen_spirv/src/builder/intrinsics.rs +++ b/crates/rustc_codegen_spirv/src/builder/intrinsics.rs @@ -105,7 +105,10 @@ impl<'a, 'tcx> IntrinsicCallMethods<'tcx> for Builder<'a, 'tcx> { let ptr = args[0].immediate(); let layout = self.layout_of(fn_args.type_at(0)); let load = self.volatile_load(layout.spirv_type(self.span(), self), ptr); - self.to_immediate(load, layout) + if !result.layout.is_zst() { + self.store(load, result.llval, result.align); + } + return; } sym::prefetch_read_data diff --git a/crates/rustc_codegen_spirv/src/builder/mod.rs b/crates/rustc_codegen_spirv/src/builder/mod.rs index 869b494f53..c68af474fc 100644 --- a/crates/rustc_codegen_spirv/src/builder/mod.rs +++ b/crates/rustc_codegen_spirv/src/builder/mod.rs @@ -14,7 +14,7 @@ use crate::builder_spirv::{BuilderCursor, SpirvValue, SpirvValueExt}; use crate::codegen_cx::CodegenCx; use crate::spirv_type::SpirvType; use rspirv::spirv::{self, Word}; -use rustc_codegen_ssa::mir::operand::OperandValue; +use rustc_codegen_ssa::mir::operand::{OperandRef, OperandValue}; use rustc_codegen_ssa::mir::place::PlaceRef; use rustc_codegen_ssa::traits::{ AbiBuilderMethods, ArgAbiMethods, BackendTypes, BuilderMethods, CoverageInfoBuilderMethods, @@ -301,7 +301,7 @@ impl<'a, 'tcx> ArgAbiMethods<'tcx> for Builder<'a, 'tcx> { match arg_abi.mode { PassMode::Ignore => {} PassMode::Direct(_) => { - OperandValue::Immediate(next(self, idx)).store(self, dst); + self.store_arg(arg_abi, next(self, idx), dst); } PassMode::Pair(..) => { OperandValue::Pair(next(self, idx), next(self, idx)).store(self, dst); @@ -323,7 +323,9 @@ impl<'a, 'tcx> ArgAbiMethods<'tcx> for Builder<'a, 'tcx> { match arg_abi.mode { PassMode::Ignore => {} PassMode::Direct(_) | PassMode::Pair(..) => { - OperandValue::Immediate(val).store(self, dst); + OperandRef::from_immediate_or_packed_pair(self, val, arg_abi.layout) + .val + .store(self, dst); } PassMode::Cast { .. } | PassMode::Indirect { .. } => span_bug!( self.span(), diff --git a/crates/rustc_codegen_spirv/src/custom_decorations.rs b/crates/rustc_codegen_spirv/src/custom_decorations.rs index 90844487d6..f1e992ed64 100644 --- a/crates/rustc_codegen_spirv/src/custom_decorations.rs +++ b/crates/rustc_codegen_spirv/src/custom_decorations.rs @@ -158,7 +158,10 @@ impl<'a> CustomDecoration<'a> for SrcLocDecoration<'a> { } fn decode(s: &'a str) -> Self { #[derive(Copy, Clone, Debug)] - struct InvalidSrcLoc<'a>(&'a str); + struct InvalidSrcLoc<'a>( + // HACK(eddyb) only exists for `fmt::Debug` in case of error. + #[allow(dead_code)] &'a str, + ); let err = InvalidSrcLoc(s); let (s, col_end) = s.rsplit_once(':').ok_or(err).unwrap(); diff --git a/crates/rustc_codegen_spirv/src/link.rs b/crates/rustc_codegen_spirv/src/link.rs index 77c6b5ca01..0c2d4e38c1 100644 --- a/crates/rustc_codegen_spirv/src/link.rs +++ b/crates/rustc_codegen_spirv/src/link.rs @@ -350,7 +350,7 @@ fn do_spirv_opt( // Level::Error | Level::Fatal | Level::InternalError => DiagnosticBuilder::<()>::new( sess.dcx(), - rustc_errors::Level::Error { lint: false }, + rustc_errors::Level::Error, msg.message, ), Level::Warning => sess.dcx().struct_warn(msg.message), diff --git a/crates/rustc_codegen_spirv/src/linker/specializer.rs b/crates/rustc_codegen_spirv/src/linker/specializer.rs index 3fb003b4b1..41481e6ebd 100644 --- a/crates/rustc_codegen_spirv/src/linker/specializer.rs +++ b/crates/rustc_codegen_spirv/src/linker/specializer.rs @@ -234,7 +234,10 @@ enum CopyOperand { } #[derive(Debug)] -struct NotSupportedAsCopyOperand(Operand); +struct NotSupportedAsCopyOperand( + // HACK(eddyb) only exists for `fmt::Debug` in case of error. + #[allow(dead_code)] Operand, +); impl TryFrom<&Operand> for CopyOperand { type Error = NotSupportedAsCopyOperand; diff --git a/crates/rustc_codegen_spirv/src/linker/test.rs b/crates/rustc_codegen_spirv/src/linker/test.rs index b3c2e5fd81..3ed1bf0c7f 100644 --- a/crates/rustc_codegen_spirv/src/linker/test.rs +++ b/crates/rustc_codegen_spirv/src/linker/test.rs @@ -169,7 +169,7 @@ fn link_with_linker_opts( ) }; let emitter = - rustc_errors::emitter::EmitterWriter::new(Box::new(buf), fallback_bundle) + rustc_errors::emitter::HumanEmitter::new(Box::new(buf), fallback_bundle) .sm(Some(sess.parse_sess.clone_source_map())); rustc_errors::DiagCtxt::with_emitter(Box::new(emitter)) diff --git a/rust-toolchain.toml b/rust-toolchain.toml index 5d1c4dd015..9da1d27438 100644 --- a/rust-toolchain.toml +++ b/rust-toolchain.toml @@ -1,7 +1,7 @@ [toolchain] -channel = "nightly-2024-01-05" +channel = "nightly-2024-01-06" components = ["rust-src", "rustc-dev", "llvm-tools"] -# commit_hash = f688dd684faca5b31b156fac2c6e0ae81fc9bc90 +# commit_hash = 595bc6f00369475047538fdae1ff8cea692ac385 # 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.