diff --git a/CHANGELOG.md b/CHANGELOG.md index adbc211e1e..57d691e307 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -33,7 +33,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - [PR#1127](https://github.com/EmbarkStudios/rust-gpu/pull/1127) updated `spirv-tools` to `0.10.0`, which follows `vulkan-sdk-1.3.275` - [PR#1101](https://github.com/EmbarkStudios/rust-gpu/pull/1101) added `ignore` and `no_run` to documentation to make `cargo test` pass - [PR#1112](https://github.com/EmbarkStudios/rust-gpu/pull/1112) updated wgpu and winit in example runners -- [PR#1102](https://github.com/EmbarkStudios/rust-gpu/pull/1102) updated toolchain to `nightly-2023-11-26` +- [PR#1134](https://github.com/EmbarkStudios/rust-gpu/pull/1134) updated toolchain to `nightly-2023-12-21` - [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` diff --git a/crates/rustc_codegen_spirv/build.rs b/crates/rustc_codegen_spirv/build.rs index dcb3163d50..3a9a3b52a3 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-2023-11-26" +channel = "nightly-2023-12-21" components = ["rust-src", "rustc-dev", "llvm-tools"] -# commit_hash = f5dc2653fdd8b5d177b2ccbd84057954340a89fc"#; +# commit_hash = 5ac4c8a63ee305742071ac6dd11817f7c24adce2"#; 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/attr.rs b/crates/rustc_codegen_spirv/src/attr.rs index b796e86db6..b59f683aa7 100644 --- a/crates/rustc_codegen_spirv/src/attr.rs +++ b/crates/rustc_codegen_spirv/src/attr.rs @@ -148,13 +148,13 @@ impl AggregatedSpirvAttributes { pub fn parse<'tcx>(cx: &CodegenCx<'tcx>, attrs: &'tcx [Attribute]) -> Self { let mut aggregated_attrs = Self::default(); - // NOTE(eddyb) `delay_span_bug` ensures that if attribute checking fails + // NOTE(eddyb) `span_delayed_bug` ensures that if attribute checking fails // to see an attribute error, it will cause an ICE instead. for parse_attr_result in crate::symbols::parse_attrs_for_checking(&cx.sym, attrs) { let (span, parsed_attr) = match parse_attr_result { Ok(span_and_parsed_attr) => span_and_parsed_attr, Err((span, msg)) => { - cx.tcx.sess.delay_span_bug(span, msg); + cx.tcx.sess.span_delayed_bug(span, msg); continue; } }; @@ -166,7 +166,7 @@ impl AggregatedSpirvAttributes { }) => { cx.tcx .sess - .delay_span_bug(span, format!("multiple {category} attributes")); + .span_delayed_bug(span, format!("multiple {category} attributes")); } } } diff --git a/crates/rustc_codegen_spirv/src/codegen_cx/constant.rs b/crates/rustc_codegen_spirv/src/codegen_cx/constant.rs index 83b60b4fdd..eed04cd4c1 100644 --- a/crates/rustc_codegen_spirv/src/codegen_cx/constant.rs +++ b/crates/rustc_codegen_spirv/src/codegen_cx/constant.rs @@ -290,7 +290,8 @@ impl<'tcx> ConstMethods<'tcx> for CodegenCx<'tcx> { } } Scalar::Ptr(ptr, _) => { - let (alloc_id, offset) = ptr.into_parts(); + let (prov, offset) = ptr.into_parts(); + let alloc_id = prov.alloc_id(); let (base_addr, _base_addr_space) = match self.tcx.global_alloc(alloc_id) { GlobalAlloc::Memory(alloc) => { let pointee = match self.lookup_type(ty) { diff --git a/crates/rustc_codegen_spirv/src/lib.rs b/crates/rustc_codegen_spirv/src/lib.rs index 89e81668f0..864d767394 100644 --- a/crates/rustc_codegen_spirv/src/lib.rs +++ b/crates/rustc_codegen_spirv/src/lib.rs @@ -99,7 +99,7 @@ use rustc_codegen_ssa::traits::{ }; use rustc_codegen_ssa::{CodegenResults, CompiledModule, ModuleCodegen, ModuleKind}; use rustc_data_structures::fx::FxIndexMap; -use rustc_errors::{ErrorGuaranteed, FatalError, Handler}; +use rustc_errors::{DiagCtxt, ErrorGuaranteed, FatalError}; use rustc_metadata::EncodedMetadata; use rustc_middle::dep_graph::{WorkProduct, WorkProductId}; use rustc_middle::mir::mono::{MonoItem, MonoItemData}; @@ -294,7 +294,7 @@ impl WriteBackendMethods for SpirvCodegenBackend { fn run_link( _cgcx: &CodegenContext, - _diag_handler: &Handler, + _diag_handler: &DiagCtxt, _modules: Vec>, ) -> Result, FatalError> { todo!() @@ -326,7 +326,7 @@ impl WriteBackendMethods for SpirvCodegenBackend { unsafe fn optimize( _: &CodegenContext, - _: &Handler, + _: &DiagCtxt, _: &ModuleCodegen, _: &ModuleConfig, ) -> Result<(), FatalError> { @@ -357,7 +357,7 @@ impl WriteBackendMethods for SpirvCodegenBackend { unsafe fn codegen( cgcx: &CodegenContext, - _diag_handler: &Handler, + _diag_handler: &DiagCtxt, module: ModuleCodegen, _config: &ModuleConfig, ) -> Result { @@ -500,7 +500,7 @@ pub fn __rustc_codegen_backend() -> Box { rustc_driver::install_ice_hook( "https://github.com/EmbarkStudios/rust-gpu/issues/new", |handler| { - handler.note_without_error(concat!( + handler.note(concat!( "`rust-gpu` version `", env!("CARGO_PKG_VERSION"), "`" diff --git a/crates/rustc_codegen_spirv/src/link.rs b/crates/rustc_codegen_spirv/src/link.rs index 08df00797b..a926a2ae08 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 => sess.struct_err(msg.message).forget_guarantee(), Level::Warning => sess.struct_warn(msg.message), - Level::Info | Level::Debug => sess.struct_note_without_error(msg.message), + Level::Info | Level::Debug => sess.struct_note(msg.message), }; err.note(format!("module `{}`", filename.display())); diff --git a/crates/rustc_codegen_spirv/src/linker/mod.rs b/crates/rustc_codegen_spirv/src/linker/mod.rs index 3606779ee9..8c5b93235e 100644 --- a/crates/rustc_codegen_spirv/src/linker/mod.rs +++ b/crates/rustc_codegen_spirv/src/linker/mod.rs @@ -534,7 +534,7 @@ pub fn link( } if any_spirt_bugs { - let mut note = sess.struct_note_without_error("SPIR-T bugs were reported"); + let mut note = sess.struct_note("SPIR-T bugs were reported"); note.help(format!( "pretty-printed SPIR-T was saved to {}.html", dump_spirt_file_path.as_ref().unwrap().display() diff --git a/crates/rustc_codegen_spirv/src/linker/test.rs b/crates/rustc_codegen_spirv/src/linker/test.rs index 417408576c..bbf7a3e0a8 100644 --- a/crates/rustc_codegen_spirv/src/linker/test.rs +++ b/crates/rustc_codegen_spirv/src/linker/test.rs @@ -122,9 +122,9 @@ fn link_with_linker_opts( // is really a silent unwinding device, that should be treated the same as // `Err(ErrorGuaranteed)` returns from `link`). rustc_driver::catch_fatal_errors(|| { - let mut early_error_handler = rustc_session::EarlyErrorHandler::new( - rustc_session::config::ErrorOutputType::default(), - ); + let mut early_error_handler = + rustc_session::EarlyDiagCtxt::new(rustc_session::config::ErrorOutputType::default()); + early_error_handler.initialize_checked_jobserver(); let matches = rustc_driver::handle_options( &early_error_handler, &["".to_string(), "x.rs".to_string()], @@ -135,7 +135,7 @@ fn link_with_linker_opts( rustc_span::create_session_globals_then(sopts.edition, || { let mut sess = rustc_session::build_session( - &early_error_handler, + early_error_handler, sopts, CompilerIO { input: Input::Str { @@ -160,7 +160,7 @@ fn link_with_linker_opts( // HACK(eddyb) inject `write_diags` into `sess`, to work around // the removals in https://github.com/rust-lang/rust/pull/102992. - sess.parse_sess.span_diagnostic = { + sess.parse_sess.dcx = { let fallback_bundle = { extern crate rustc_error_messages; rustc_error_messages::fallback_fluent_bundle( @@ -172,8 +172,8 @@ fn link_with_linker_opts( rustc_errors::emitter::EmitterWriter::new(Box::new(buf), fallback_bundle) .sm(Some(sess.parse_sess.clone_source_map())); - rustc_errors::Handler::with_emitter(Box::new(emitter)) - .with_flags(sess.opts.unstable_opts.diagnostic_handler_flags(true)) + rustc_errors::DiagCtxt::with_emitter(Box::new(emitter)) + .with_flags(sess.opts.unstable_opts.dcx_flags(true)) }; let res = link( diff --git a/crates/rustc_codegen_spirv/src/symbols.rs b/crates/rustc_codegen_spirv/src/symbols.rs index 4129187b39..5fbd18e036 100644 --- a/crates/rustc_codegen_spirv/src/symbols.rs +++ b/crates/rustc_codegen_spirv/src/symbols.rs @@ -569,7 +569,7 @@ fn parse_local_size_attr(arg: &NestedMetaItem) -> Result<[u32; 3], ParseAttrErro } Ok(local_size) } - Some(tuple) if tuple.is_empty() => Err(( + Some([]) => Err(( arg.span, "#[spirv(compute(threads(x, y, z)))] must have the x dimension specified, trailing ones may be elided".to_string(), )), diff --git a/crates/spirv-builder/README.md b/crates/spirv-builder/README.md index ffca313fd1..29faf9be15 100644 --- a/crates/spirv-builder/README.md +++ b/crates/spirv-builder/README.md @@ -2,7 +2,7 @@ # `spirv-builder` -![Rust version](https://img.shields.io/badge/rust-nightly--2023--05--27-purple.svg) +![Rust version](https://img.shields.io/badge/rust-nightly--2023--12--21-purple.svg) This crate gives you `SpirvBuilder`, a tool to build shaders using [rust-gpu][rustgpu]. @@ -31,12 +31,13 @@ const SHADER: &[u8] = include_bytes!(env!("my_shaders.spv")); As `spirv-builder` relies on `rustc_codegen_spirv` being built for it (by Cargo, as a direct dependency), and due to the special nature of the latter (as a `rustc` codegen backend "plugin"), both end up sharing the requirement for a very specific nightly toolchain version of Rust. -**The current Rust toolchain version is: `nightly-2023-05-27`.** +**The current Rust toolchain version is: `nightly-2023-12-21`.** Rust toolchain version history across [rust-gpu releases](https://github.com/EmbarkStudios/rust-gpu/releases) (since `0.4`): |`spirv-builder`
version|Rust toolchain
version| |:-:|:-:| +|`0.10`|`nightly-2023-12-21`| |`0.9`|`nightly-2023-05-27`| |`0.8`|`nightly-2023-04-15`| |`0.7`|`nightly-2023-03-04`| diff --git a/rust-toolchain.toml b/rust-toolchain.toml index 98315c67df..fe86280587 100644 --- a/rust-toolchain.toml +++ b/rust-toolchain.toml @@ -1,7 +1,7 @@ [toolchain] -channel = "nightly-2023-11-26" +channel = "nightly-2023-12-21" components = ["rust-src", "rustc-dev", "llvm-tools"] -# commit_hash = f5dc2653fdd8b5d177b2ccbd84057954340a89fc +# commit_hash = 5ac4c8a63ee305742071ac6dd11817f7c24adce2 # 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. diff --git a/tests/ui/dis/ptr_copy.normal.stderr b/tests/ui/dis/ptr_copy.normal.stderr index 7182c5f4ba..76c49bd4e5 100644 --- a/tests/ui/dis/ptr_copy.normal.stderr +++ b/tests/ui/dis/ptr_copy.normal.stderr @@ -1,13 +1,13 @@ error: cannot memcpy dynamically sized data - --> $CORE_SRC/intrinsics.rs:2776:9 + --> $CORE_SRC/intrinsics.rs:2793:9 | -2776 | copy(src, dst, count) +2793 | copy(src, dst, count) | ^^^^^^^^^^^^^^^^^^^^^ | note: used from within `core::intrinsics::copy::` - --> $CORE_SRC/intrinsics.rs:2762:21 + --> $CORE_SRC/intrinsics.rs:2779:21 | -2762 | pub const unsafe fn copy(src: *const T, dst: *mut T, count: usize) { +2779 | pub const unsafe fn copy(src: *const T, dst: *mut T, count: usize) { | ^^^^ note: called by `ptr_copy::copy_via_raw_ptr` --> $DIR/ptr_copy.rs:28:18 diff --git a/tests/ui/dis/ptr_read.stderr b/tests/ui/dis/ptr_read.stderr index c4f70a0853..17cc16c310 100644 --- a/tests/ui/dis/ptr_read.stderr +++ b/tests/ui/dis/ptr_read.stderr @@ -2,7 +2,7 @@ %4 = OpFunctionParameter %5 %6 = OpFunctionParameter %5 %7 = OpLabel -OpLine %8 1200 8 +OpLine %8 1215 8 %9 = OpLoad %10 %4 OpLine %11 7 13 OpStore %6 %9 diff --git a/tests/ui/dis/ptr_read_method.stderr b/tests/ui/dis/ptr_read_method.stderr index c4f70a0853..17cc16c310 100644 --- a/tests/ui/dis/ptr_read_method.stderr +++ b/tests/ui/dis/ptr_read_method.stderr @@ -2,7 +2,7 @@ %4 = OpFunctionParameter %5 %6 = OpFunctionParameter %5 %7 = OpLabel -OpLine %8 1200 8 +OpLine %8 1215 8 %9 = OpLoad %10 %4 OpLine %11 7 13 OpStore %6 %9 diff --git a/tests/ui/dis/ptr_write.stderr b/tests/ui/dis/ptr_write.stderr index f2f9af23c9..a34bffdedc 100644 --- a/tests/ui/dis/ptr_write.stderr +++ b/tests/ui/dis/ptr_write.stderr @@ -4,7 +4,7 @@ %7 = OpLabel OpLine %8 7 35 %9 = OpLoad %10 %4 -OpLine %11 1400 8 +OpLine %11 1415 8 OpStore %6 %9 OpNoLine OpReturn diff --git a/tests/ui/dis/ptr_write_method.stderr b/tests/ui/dis/ptr_write_method.stderr index 2141c5964c..c6607d192d 100644 --- a/tests/ui/dis/ptr_write_method.stderr +++ b/tests/ui/dis/ptr_write_method.stderr @@ -4,7 +4,7 @@ %7 = OpLabel OpLine %8 7 37 %9 = OpLoad %10 %4 -OpLine %11 1400 8 +OpLine %11 1415 8 OpStore %6 %9 OpNoLine OpReturn diff --git a/tests/ui/lang/core/ptr/allocate_const_scalar.stderr b/tests/ui/lang/core/ptr/allocate_const_scalar.stderr index df6374b37b..b52a31b6a3 100644 --- a/tests/ui/lang/core/ptr/allocate_const_scalar.stderr +++ b/tests/ui/lang/core/ptr/allocate_const_scalar.stderr @@ -1,3 +1,12 @@ +warning: the feature `ptr_internals` is internal to the compiler or standard library + --> $DIR/allocate_const_scalar.rs:6:12 + | +6 | #![feature(ptr_internals)] + | ^^^^^^^^^^^^^ + | + = note: using it is strongly discouraged + = note: `#[warn(internal_features)]` on by default + error: pointer has non-null integer address | note: used from within `allocate_const_scalar::main` @@ -11,5 +20,5 @@ note: called by `main` 15 | pub fn main(output: &mut Unique<[u8; 4]>) { | ^^^^ -error: aborting due to 1 previous error +error: aborting due to 1 previous error; 1 warning emitted diff --git a/tests/ui/lang/core/ptr/allocate_vec_like.stderr b/tests/ui/lang/core/ptr/allocate_vec_like.stderr new file mode 100644 index 0000000000..d4376b8486 --- /dev/null +++ b/tests/ui/lang/core/ptr/allocate_vec_like.stderr @@ -0,0 +1,11 @@ +warning: the feature `ptr_internals` is internal to the compiler or standard library + --> $DIR/allocate_vec_like.rs:4:12 + | +4 | #![feature(ptr_internals)] + | ^^^^^^^^^^^^^ + | + = note: using it is strongly discouraged + = note: `#[warn(internal_features)]` on by default + +warning: 1 warning emitted +