Skip to content

Commit

Permalink
rustup: update to nightly-2024-01-06.
Browse files Browse the repository at this point in the history
  • Loading branch information
eddyb authored and Firestar99 committed Sep 19, 2024
1 parent fd97e49 commit 122414e
Show file tree
Hide file tree
Showing 8 changed files with 23 additions and 12 deletions.
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-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<String, Box<dyn Error>> {
let rustc = std::env::var("RUSTC").unwrap_or_else(|_| String::from("rustc"));
Expand Down
5 changes: 4 additions & 1 deletion crates/rustc_codegen_spirv/src/builder/intrinsics.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
8 changes: 5 additions & 3 deletions crates/rustc_codegen_spirv/src/builder/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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);
Expand All @@ -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(),
Expand Down
5 changes: 4 additions & 1 deletion crates/rustc_codegen_spirv/src/custom_decorations.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down
2 changes: 1 addition & 1 deletion crates/rustc_codegen_spirv/src/link.rs
Original file line number Diff line number Diff line change
Expand Up @@ -350,7 +350,7 @@ fn do_spirv_opt(
// <https://github.com/rust-lang/rust/commit/2cd14bc9394ca6675e08d02c02c5f9abfa813616>
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),
Expand Down
5 changes: 4 additions & 1 deletion crates/rustc_codegen_spirv/src/linker/specializer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion crates/rustc_codegen_spirv/src/linker/test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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))
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-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.

0 comments on commit 122414e

Please sign in to comment.