Skip to content

Commit

Permalink
rustup: update to nightly-2023-11-26.
Browse files Browse the repository at this point in the history
  • Loading branch information
LegNeato committed Nov 27, 2023
1 parent 83f8c72 commit bf198cb
Show file tree
Hide file tree
Showing 13 changed files with 30 additions and 21 deletions.
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#1102](https://github.com/EmbarkStudios/rust-gpu/pull/1102) updated toolchain to `nightly-2023-11-26`
- [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-09-30"
channel = "nightly-2023-11-26"
components = ["rust-src", "rustc-dev", "llvm-tools"]
# commit_hash = 8ce4540bd6fe7d58d4bc05f1b137d61937d3cf72"#;
# commit_hash = f5dc2653fdd8b5d177b2ccbd84057954340a89fc"#;

fn get_rustc_commit_hash() -> Result<String, Box<dyn Error>> {
let rustc = std::env::var("RUSTC").unwrap_or_else(|_| String::from("rustc"));
Expand Down
15 changes: 10 additions & 5 deletions crates/rustc_codegen_spirv/src/abi.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ use rustc_middle::query::Providers;
use rustc_middle::ty::layout::{FnAbiOf, LayoutOf, TyAndLayout};
use rustc_middle::ty::GenericArgsRef;
use rustc_middle::ty::{
self, Const, FloatTy, GeneratorArgs, IntTy, ParamEnv, PolyFnSig, Ty, TyCtxt, TyKind,
self, Const, CoroutineArgs, FloatTy, IntTy, ParamEnv, PolyFnSig, Ty, TyCtxt, TyKind,
TypeAndMut, UintTy,
};
use rustc_middle::{bug, span_bug};
Expand Down Expand Up @@ -64,6 +64,9 @@ pub(crate) fn provide(providers: &mut Providers) {
) -> &'tcx FnAbi<'tcx, Ty<'tcx>> {
let readjust_arg_abi = |arg: &ArgAbi<'tcx, Ty<'tcx>>| {
let mut arg = ArgAbi::new(&tcx, arg.layout, |_, _, _| ArgAttributes::new());
// FIXME: this is bad! https://github.com/rust-lang/rust/issues/115666
// <https://github.com/rust-lang/rust/commit/eaaa03faf77b157907894a4207d8378ecaec7b45>
arg.make_direct_deprecated();

// Avoid pointlessly passing ZSTs, just like the official Rust ABI.
if arg.layout.is_zst() {
Expand Down Expand Up @@ -96,7 +99,9 @@ pub(crate) fn provide(providers: &mut Providers) {

// FIXME(eddyb) remove this by deriving `Clone` for `LayoutS` upstream.
// FIXME(eddyb) the `S` suffix is a naming antipattern, rename upstream.
fn clone_layout(layout: &LayoutS) -> LayoutS {
fn clone_layout<FieldIdx: Idx, VariantIdx: Idx>(
layout: &LayoutS<FieldIdx, VariantIdx>,
) -> LayoutS<FieldIdx, VariantIdx> {
let LayoutS {
ref fields,
ref variants,
Expand Down Expand Up @@ -744,7 +749,7 @@ fn trans_struct<'tcx>(cx: &CodegenCx<'tcx>, span: Span, ty: TyAndLayout<'tcx>) -
fn def_id_for_spirv_type_adt(layout: TyAndLayout<'_>) -> Option<DefId> {
match *layout.ty.kind() {
TyKind::Adt(def, _) => Some(def.did()),
TyKind::Foreign(def_id) | TyKind::Closure(def_id, _) | TyKind::Generator(def_id, ..) => {
TyKind::Foreign(def_id) | TyKind::Closure(def_id, _) | TyKind::Coroutine(def_id, ..) => {
Some(def_id)
}
_ => None,
Expand Down Expand Up @@ -779,8 +784,8 @@ impl fmt::Display for TyLayoutNameKey<'_> {
write!(f, "::{}", def.variants()[index].name)?;
}
}
if let (TyKind::Generator(_, _, _), Some(index)) = (self.ty.kind(), self.variant) {
write!(f, "::{}", GeneratorArgs::variant_name(index))?;
if let (TyKind::Coroutine(_, _, _), Some(index)) = (self.ty.kind(), self.variant) {
write!(f, "::{}", CoroutineArgs::variant_name(index))?;
}
Ok(())
}
Expand Down
2 changes: 1 addition & 1 deletion crates/rustc_codegen_spirv/src/builder/builder_methods.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3037,7 +3037,7 @@ impl<'a, 'tcx> BuilderMethods<'a, 'tcx> for Builder<'a, 'tcx> {
self.intcast(val, dest_ty, false)
}

fn do_not_inline(&mut self, _llret: Self::Value) {
fn apply_attrs_to_cleanup_callsite(&mut self, _llret: Self::Value) {
// Ignore
}
}
2 changes: 1 addition & 1 deletion crates/rustc_codegen_spirv/src/builder/intrinsics.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ use rustc_codegen_ssa::traits::{BuilderMethods, IntrinsicCallMethods};
use rustc_middle::bug;
use rustc_middle::ty::layout::LayoutOf;
use rustc_middle::ty::{FnDef, Instance, ParamEnv, Ty, TyKind};
use rustc_span::source_map::Span;
use rustc_span::sym;
use rustc_span::Span;
use rustc_target::abi::call::{FnAbi, PassMode};
use std::assert_matches::assert_matches;

Expand Down
2 changes: 1 addition & 1 deletion crates/rustc_codegen_spirv/src/builder/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ use rustc_middle::ty::layout::{
};
use rustc_middle::ty::{Instance, ParamEnv, Ty, TyCtxt};
use rustc_span::def_id::DefId;
use rustc_span::source_map::Span;
use rustc_span::Span;
use rustc_target::abi::call::{ArgAbi, FnAbi, PassMode};
use rustc_target::abi::{HasDataLayout, Size, TargetDataLayout};
use rustc_target::spec::{HasTargetSpec, Target};
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 @@ -767,7 +767,7 @@ impl<'tcx> BuilderSpirv<'tcx> {
FileName::Real(name) => {
name.to_string_lossy(FileNameDisplayPreference::Remapped)
}
_ => sf.name.prefer_remapped().to_string().into(),
_ => sf.name.prefer_remapped_unconditionaly().to_string().into(),
};
let file_name = {
// FIXME(eddyb) it should be possible to arena-allocate a
Expand Down
3 changes: 2 additions & 1 deletion crates/rustc_codegen_spirv/src/codegen_cx/type_.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@ use rustc_middle::ty::layout::{
};
use rustc_middle::ty::Ty;
use rustc_middle::{bug, span_bug};
use rustc_span::source_map::{Span, Spanned, DUMMY_SP};
use rustc_span::source_map::Spanned;
use rustc_span::{Span, DUMMY_SP};
use rustc_target::abi::call::{CastTarget, FnAbi, Reg};
use rustc_target::abi::{Abi, AddressSpace, FieldsShape};

Expand Down
2 changes: 1 addition & 1 deletion crates/rustc_codegen_spirv/src/linker/dce.rs
Original file line number Diff line number Diff line change
Expand Up @@ -281,7 +281,7 @@ fn instruction_is_pure(inst: &Instruction) -> bool {
| PtrEqual
| PtrNotEqual
| PtrDiff => true,
Variable => inst.operands.get(0) == Some(&Operand::StorageClass(StorageClass::Function)),
Variable => inst.operands.first() == Some(&Operand::StorageClass(StorageClass::Function)),
_ => false,
}
}
1 change: 1 addition & 0 deletions crates/rustc_codegen_spirv/src/linker/test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,7 @@ fn link_with_linker_opts(
rustc_interface::util::rustc_version_str().unwrap_or("unknown"),
Default::default(),
Default::default(),
Default::default(),
);

// HACK(eddyb) inject `write_diags` into `sess`, to work around
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-09-30"
channel = "nightly-2023-11-26"
components = ["rust-src", "rustc-dev", "llvm-tools"]
# commit_hash = 8ce4540bd6fe7d58d4bc05f1b137d61937d3cf72
# commit_hash = f5dc2653fdd8b5d177b2ccbd84057954340a89fc

# 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.
10 changes: 5 additions & 5 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:2778:9
--> $CORE_SRC/intrinsics.rs:2776:9
|
2778 | copy(src, dst, count)
2776 | copy(src, dst, count)
| ^^^^^^^^^^^^^^^^^^^^^
|
note: used from within `core::intrinsics::copy::<f32>`
--> $CORE_SRC/intrinsics.rs:2764:21
--> $CORE_SRC/intrinsics.rs:2762:21
|
2764 | pub const unsafe fn copy<T>(src: *const T, dst: *mut T, count: usize) {
2762 | 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 All @@ -25,5 +25,5 @@ note: called by `main`
32 | pub fn main(i: f32, o: &mut f32) {
| ^^^^

error: aborting due to previous error
error: aborting due to 1 previous error

3 changes: 2 additions & 1 deletion tests/ui/spirv-attr/invalid-target.rs
Original file line number Diff line number Diff line change
Expand Up @@ -288,7 +288,8 @@ fn _fn(
vertex, // fn-only
uniform, position, descriptor_set = 0, binding = 0, flat, invariant, // param-only
)]
(1, 2, 3) // expression
(1, 2, 3)
// expression
);

match () {
Expand Down

0 comments on commit bf198cb

Please sign in to comment.