Skip to content

Commit

Permalink
rustup: update to nightly-2023-12-31.
Browse files Browse the repository at this point in the history
  • Loading branch information
LegNeato committed Jan 2, 2024
1 parent 8a9cc05 commit b57d0b4
Show file tree
Hide file tree
Showing 25 changed files with 205 additions and 187 deletions.
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
## [Unreleased]

### Changed 🛠
- [PR#1109](https://github.com/EmbarkStudios/rust-gpu/pull/1109) updated toolchain to `nightly-2023-12-16`
- [PR#1109](https://github.com/EmbarkStudios/rust-gpu/pull/1109) updated toolchain to `nightly-2023-12-31`
- [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-12-16"
channel = "nightly-2023-12-31"
components = ["rust-src", "rustc-dev", "llvm-tools"]
# commit_hash = a96d57bdb6d2bb6d233d7d5aaefc2995ab99be01"#;
# commit_hash = 2a3e63551fe21458637480a97b65a2d15dec8062"#;

fn get_rustc_commit_hash() -> Result<String, Box<dyn Error>> {
let rustc = std::env::var("RUSTC").unwrap_or_else(|_| String::from("rustc"));
Expand Down
28 changes: 14 additions & 14 deletions crates/rustc_codegen_spirv/src/abi.rs
Original file line number Diff line number Diff line change
Expand Up @@ -580,7 +580,7 @@ fn dig_scalar_pointee<'tcx>(
let new_pointee = dig_scalar_pointee(cx, field, offset - field_offset);
match pointee {
Some(old_pointee) if old_pointee != new_pointee => {
cx.tcx.sess.fatal(format!(
cx.tcx.dcx().fatal(format!(
"dig_scalar_pointee: unsupported Pointer with different \
pointee types ({old_pointee:?} vs {new_pointee:?}) at offset {offset:?} in {layout:#?}"
));
Expand Down Expand Up @@ -728,7 +728,7 @@ fn trans_struct<'tcx>(cx: &CodegenCx<'tcx>, span: Span, ty: TyAndLayout<'tcx>) -
if i == 0 {
field_names.push(cx.sym.discriminant);
} else {
cx.tcx.sess.fatal("Variants::Multiple has multiple fields")
cx.tcx.dcx().fatal("Variants::Multiple has multiple fields")
}
};
}
Expand Down Expand Up @@ -784,7 +784,7 @@ impl fmt::Display for TyLayoutNameKey<'_> {
write!(f, "::{}", def.variants()[index].name)?;
}
}
if let (TyKind::Coroutine(_, _, _), Some(index)) = (self.ty.kind(), self.variant) {
if let (TyKind::Coroutine(_, _), Some(index)) = (self.ty.kind(), self.variant) {
write!(f, "::{}", CoroutineArgs::variant_name(index))?;
}
Ok(())
Expand All @@ -804,7 +804,7 @@ fn trans_intrinsic_type<'tcx>(
if ty.size != Size::from_bytes(4) {
return Err(cx
.tcx
.sess
.dcx()
.err("#[spirv(generic_image)] type must have size 4"));
}

Expand Down Expand Up @@ -848,7 +848,7 @@ fn trans_intrinsic_type<'tcx>(
_ => {
return Err(cx
.tcx
.sess
.dcx()
.span_err(span, "Invalid sampled type to `Image`."));
}
};
Expand All @@ -871,7 +871,7 @@ fn trans_intrinsic_type<'tcx>(
Some(v) => Ok(v),
None => Err(cx
.tcx
.sess
.dcx()
.err(format!("Invalid value for Image const generic: {value}"))),
}
}
Expand All @@ -897,7 +897,7 @@ fn trans_intrinsic_type<'tcx>(
IntrinsicType::Sampler => {
// see SpirvType::sizeof
if ty.size != Size::from_bytes(4) {
return Err(cx.tcx.sess.err("#[spirv(sampler)] type must have size 4"));
return Err(cx.tcx.dcx().err("#[spirv(sampler)] type must have size 4"));
}
Ok(SpirvType::Sampler.def(span, cx))
}
Expand All @@ -910,7 +910,7 @@ fn trans_intrinsic_type<'tcx>(
if ty.size != Size::from_bytes(4) {
return Err(cx
.tcx
.sess
.dcx()
.err("#[spirv(sampled_image)] type must have size 4"));
}

Expand All @@ -923,15 +923,15 @@ fn trans_intrinsic_type<'tcx>(
} else {
Err(cx
.tcx
.sess
.dcx()
.err("#[spirv(sampled_image)] type must have a generic image type"))
}
}
IntrinsicType::RuntimeArray => {
if ty.size != Size::from_bytes(4) {
return Err(cx
.tcx
.sess
.dcx()
.err("#[spirv(runtime_array)] type must have size 4"));
}

Expand All @@ -943,7 +943,7 @@ fn trans_intrinsic_type<'tcx>(
} else {
Err(cx
.tcx
.sess
.dcx()
.err("#[spirv(runtime_array)] type must have a generic element type"))
}
}
Expand All @@ -958,12 +958,12 @@ fn trans_intrinsic_type<'tcx>(
if field_types.len() < 2 {
return Err(cx
.tcx
.sess
.dcx()
.span_err(span, "#[spirv(matrix)] type must have at least two fields"));
}
let elem_type = field_types[0];
if !field_types.iter().all(|&ty| ty == elem_type) {
return Err(cx.tcx.sess.span_err(
return Err(cx.tcx.dcx().span_err(
span,
"#[spirv(matrix)] type fields must all be the same type",
));
Expand All @@ -973,7 +973,7 @@ fn trans_intrinsic_type<'tcx>(
ty => {
return Err(cx
.tcx
.sess
.dcx()
.struct_span_err(span, "#[spirv(matrix)] type fields must all be vectors")
.note(format!("field type is {}", ty.debug(elem_type, cx)))
.emit());
Expand Down
16 changes: 8 additions & 8 deletions crates/rustc_codegen_spirv/src/attr.rs
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ impl AggregatedSpirvAttributes {
let (span, parsed_attr) = match parse_attr_result {
Ok(span_and_parsed_attr) => span_and_parsed_attr,
Err((span, msg)) => {
cx.tcx.sess.span_delayed_bug(span, msg);
cx.tcx.dcx().span_delayed_bug(span, msg);
continue;
}
};
Expand All @@ -165,7 +165,7 @@ impl AggregatedSpirvAttributes {
category,
}) => {
cx.tcx
.sess
.dcx()
.span_delayed_bug(span, format!("multiple {category} attributes"));
}
}
Expand Down Expand Up @@ -278,7 +278,7 @@ impl CheckSpirvAttrVisitor<'_> {
let (span, parsed_attr) = match parse_attr_result {
Ok(span_and_parsed_attr) => span_and_parsed_attr,
Err((span, msg)) => {
self.tcx.sess.span_err(span, msg);
self.tcx.dcx().span_err(span, msg);
continue;
}
};
Expand Down Expand Up @@ -323,7 +323,7 @@ impl CheckSpirvAttrVisitor<'_> {
.filter_map(|r| r.ok())
.any(|(_, attr)| matches!(attr, SpirvAttribute::Entry(_)));
if !parent_is_entry_point {
self.tcx.sess.span_err(
self.tcx.dcx().span_err(
span,
"attribute is only valid on a parameter of an entry-point function",
);
Expand All @@ -346,7 +346,7 @@ impl CheckSpirvAttrVisitor<'_> {
};

if let Err(msg) = valid {
self.tcx.sess.span_err(
self.tcx.dcx().span_err(
span,
format!("`{storage_class:?}` storage class {msg}"),
);
Expand All @@ -367,7 +367,7 @@ impl CheckSpirvAttrVisitor<'_> {
};
match valid_target {
Err(Expected(expected_target)) => {
self.tcx.sess.span_err(
self.tcx.dcx().span_err(
span,
format!(
"attribute is only valid on a {expected_target}, not on a {target}"
Expand All @@ -381,7 +381,7 @@ impl CheckSpirvAttrVisitor<'_> {
category,
}) => {
self.tcx
.sess
.dcx()
.struct_span_err(
span,
format!("only one {category} attribute is allowed on a {target}"),
Expand All @@ -397,7 +397,7 @@ impl CheckSpirvAttrVisitor<'_> {
// so we can perform further checks, emit warnings, etc.

if let Some(block_attr) = aggregated_attrs.block {
self.tcx.sess.span_warn(
self.tcx.dcx().span_warn(
block_attr.span,
"#[spirv(block)] is no longer needed and should be removed",
);
Expand Down
11 changes: 8 additions & 3 deletions crates/rustc_codegen_spirv/src/builder/builder_methods.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2282,7 +2282,7 @@ impl<'a, 'tcx> BuilderMethods<'a, 'tcx> for Builder<'a, 'tcx> {
order: AtomicOrdering,
failure_order: AtomicOrdering,
_weak: bool,
) -> Self::Value {
) -> (Self::Value, Self::Value) {
assert_ty_eq!(self, cmp.ty, src.ty);
let ty = src.ty;

Expand Down Expand Up @@ -2310,7 +2310,12 @@ impl<'a, 'tcx> BuilderMethods<'a, 'tcx> for Builder<'a, 'tcx> {
)
.unwrap()
.with_type(access_ty);
self.bitcast(result, ty)
let result = self.bitcast(result, ty);

let val = self.extract_value(result, 0);
let success = self.extract_value(result, 1);

(val, success)
}

fn atomic_rmw(
Expand Down Expand Up @@ -2987,7 +2992,7 @@ impl<'a, 'tcx> BuilderMethods<'a, 'tcx> for Builder<'a, 'tcx> {

Err(FormatArgsNotRecognized(step)) => {
if let Some(current_span) = self.current_span {
let mut warn = self.tcx.sess.struct_span_warn(
let mut warn = self.tcx.dcx().struct_span_warn(
current_span,
"failed to find and remove `format_args!` construction for this `panic!`",
);
Expand Down
19 changes: 8 additions & 11 deletions crates/rustc_codegen_spirv/src/builder/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ use rustc_codegen_ssa::traits::{
AbiBuilderMethods, ArgAbiMethods, BackendTypes, BuilderMethods, CoverageInfoBuilderMethods,
DebugInfoBuilderMethods, HasCodegen, StaticBuilderMethods, TypeMembershipMethods,
};
use rustc_errors::{DiagnosticBuilder, DiagnosticMessage, ErrorGuaranteed};
use rustc_errors::{DiagnosticBuilder, DiagnosticMessage};
use rustc_middle::mir::Coverage;
use rustc_middle::span_bug;
use rustc_middle::ty::layout::{
Expand Down Expand Up @@ -69,32 +69,29 @@ impl<'a, 'tcx> Builder<'a, 'tcx> {
}

#[track_caller]
pub fn struct_err(
&self,
msg: impl Into<DiagnosticMessage>,
) -> DiagnosticBuilder<'_, ErrorGuaranteed> {
pub fn struct_err(&self, msg: impl Into<DiagnosticMessage>) -> DiagnosticBuilder<'_> {
if let Some(current_span) = self.current_span {
self.tcx.sess.struct_span_err(current_span, msg)
self.tcx.dcx().struct_span_err(current_span, msg)
} else {
self.tcx.sess.struct_err(msg)
self.tcx.dcx().struct_err(msg)
}
}

#[track_caller]
pub fn err(&self, msg: impl Into<DiagnosticMessage>) {
if let Some(current_span) = self.current_span {
self.tcx.sess.span_err(current_span, msg);
self.tcx.dcx().span_err(current_span, msg);
} else {
self.tcx.sess.err(msg);
self.tcx.dcx().err(msg);
}
}

#[track_caller]
pub fn fatal(&self, msg: impl Into<DiagnosticMessage>) -> ! {
if let Some(current_span) = self.current_span {
self.tcx.sess.span_fatal(current_span, msg)
self.tcx.dcx().span_fatal(current_span, msg)
} else {
self.tcx.sess.fatal(msg)
self.tcx.dcx().fatal(msg)
}
}

Expand Down
Loading

0 comments on commit b57d0b4

Please sign in to comment.