From 36d10f8fd100079d17bdb0ac95d633fdf21c7287 Mon Sep 17 00:00:00 2001 From: David Palm Date: Wed, 5 Nov 2025 15:35:32 +0100 Subject: [PATCH 1/5] update toolchain to 2025-10-28, rustc 1.92.0 --- crates/rustc_codegen_spirv/build.rs | 11 +++- .../src/builder/builder_methods.rs | 4 +- crates/rustc_codegen_spirv/src/builder/mod.rs | 17 ++++++- .../src/codegen_cx/constant.rs | 3 +- .../src/codegen_cx/declare.rs | 6 +-- crates/rustc_codegen_spirv/src/lib.rs | 50 +++++++------------ crates/rustc_codegen_spirv/src/link.rs | 13 +++-- rust-toolchain.toml | 4 +- 8 files changed, 61 insertions(+), 47 deletions(-) diff --git a/crates/rustc_codegen_spirv/build.rs b/crates/rustc_codegen_spirv/build.rs index 96fe4a5f59..4a199352c3 100644 --- a/crates/rustc_codegen_spirv/build.rs +++ b/crates/rustc_codegen_spirv/build.rs @@ -19,9 +19,9 @@ use std::{env, fs, mem}; /// `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-2025-08-04" +channel = "nightly-2025-10-28" components = ["rust-src", "rustc-dev", "llvm-tools"] -# commit_hash = f34ba774c78ea32b7c40598b8ad23e75cdac42a6"#; +# commit_hash = adaa838976ff99a4f0661136322f64cb466b58a0"#; fn rustc_output(arg: &str) -> Result> { let rustc = env::var("RUSTC").unwrap_or_else(|_| "rustc".into()); @@ -198,6 +198,13 @@ mod win {", for link_path in raw_dylib::", ); } + src = src.replace( + " + for (link_path, as_needed) in raw_dylib::", + " + #[cfg(any())] + for (link_path, as_needed) in raw_dylib::", + ); if relative_path == Path::new("src/back/metadata.rs") { // HACK(eddyb) remove `object` dependency. src = src.replace( diff --git a/crates/rustc_codegen_spirv/src/builder/builder_methods.rs b/crates/rustc_codegen_spirv/src/builder/builder_methods.rs index 0d0b809fa2..05157d7f93 100644 --- a/crates/rustc_codegen_spirv/src/builder/builder_methods.rs +++ b/crates/rustc_codegen_spirv/src/builder/builder_methods.rs @@ -2792,6 +2792,7 @@ impl<'a, 'tcx> BuilderMethods<'a, 'tcx> for Builder<'a, 'tcx> { _src_align: Align, size: Self::Value, flags: MemFlags, + _tt: Option, ) { if flags != MemFlags::empty() { self.err(format!( @@ -2878,7 +2879,7 @@ impl<'a, 'tcx> BuilderMethods<'a, 'tcx> for Builder<'a, 'tcx> { size: Self::Value, flags: MemFlags, ) { - self.memcpy(dst, dst_align, src, src_align, size, flags); + self.memcpy(dst, dst_align, src, src_align, size, flags, None); } fn memset( @@ -3124,6 +3125,7 @@ impl<'a, 'tcx> BuilderMethods<'a, 'tcx> for Builder<'a, 'tcx> { dst: Self::Value, src: Self::Value, order: AtomicOrdering, + _ret_ptr: bool, ) -> Self::Value { let ty = src.ty; diff --git a/crates/rustc_codegen_spirv/src/builder/mod.rs b/crates/rustc_codegen_spirv/src/builder/mod.rs index 07c8966961..7135e144c8 100644 --- a/crates/rustc_codegen_spirv/src/builder/mod.rs +++ b/crates/rustc_codegen_spirv/src/builder/mod.rs @@ -183,7 +183,7 @@ impl<'a, 'tcx> DebugInfoBuilderMethods for Builder<'a, 'tcx> { _direct_offset: Size, // NB: each offset implies a deref (i.e. they're steps in a pointer chain). _indirect_offsets: &[Size], - _fragment: Option>, + _fragment: &Option>, ) { todo!() } @@ -203,6 +203,21 @@ impl<'a, 'tcx> DebugInfoBuilderMethods for Builder<'a, 'tcx> { fn set_var_name(&mut self, _value: Self::Value, _name: &str) { todo!() } + + fn dbg_var_value( + &mut self, + _dbg_var: Self::DIVariable, + _dbg_loc: Self::DILocation, + _value: Self::Value, + _direct_offset: Size, + // NB: each offset implies a deref (i.e. they're steps in a pointer chain). + _indirect_offsets: &[Size], + // Byte range in the `dbg_var` covered by this fragment, + // if this is a fragment of a composite `DIVariable`. + _fragment: &Option>, + ) { + todo!() + } } impl<'a, 'tcx> ArgAbiBuilderMethods<'tcx> for Builder<'a, 'tcx> { diff --git a/crates/rustc_codegen_spirv/src/codegen_cx/constant.rs b/crates/rustc_codegen_spirv/src/codegen_cx/constant.rs index 3e3f97a48e..f4e73354d6 100644 --- a/crates/rustc_codegen_spirv/src/codegen_cx/constant.rs +++ b/crates/rustc_codegen_spirv/src/codegen_cx/constant.rs @@ -506,8 +506,7 @@ impl<'tcx> CodegenCx<'tcx> { // HACK(eddyb) these should never happen when using // `read_scalar`, but better not outright crash. - AllocError::ScalarSizeMismatch(_) - | AllocError::OverwritePartialPointer(_) => { + AllocError::ScalarSizeMismatch(_) => { Err(format!("unrecognized `AllocError::{err:?}`")) } }, diff --git a/crates/rustc_codegen_spirv/src/codegen_cx/declare.rs b/crates/rustc_codegen_spirv/src/codegen_cx/declare.rs index 9dbb827ddb..71eeb5085a 100644 --- a/crates/rustc_codegen_spirv/src/codegen_cx/declare.rs +++ b/crates/rustc_codegen_spirv/src/codegen_cx/declare.rs @@ -11,10 +11,10 @@ use itertools::Itertools; use rspirv::spirv::{FunctionControl, LinkageType, StorageClass, Word}; use rustc_abi::Align; use rustc_codegen_ssa::traits::{PreDefineCodegenMethods, StaticCodegenMethods}; -use rustc_hir::attrs::InlineAttr; +use rustc_hir::attrs::{InlineAttr, Linkage}; use rustc_middle::bug; use rustc_middle::middle::codegen_fn_attrs::{CodegenFnAttrFlags, CodegenFnAttrs}; -use rustc_middle::mir::mono::{Linkage, MonoItem, Visibility}; +use rustc_middle::mir::mono::{MonoItem, Visibility}; use rustc_middle::ty::layout::{FnAbiOf, LayoutOf}; use rustc_middle::ty::{self, Instance, TypeVisitableExt, TypingEnv}; use rustc_span::Span; @@ -178,7 +178,7 @@ impl<'tcx> CodegenCx<'tcx> { // Check if this is a From trait implementation if let Some(impl_def_id) = self.tcx.impl_of_assoc(def_id) - && let Some(trait_ref) = self.tcx.impl_trait_ref(impl_def_id) + && let Some(trait_ref) = self.tcx.impl_opt_trait_ref(impl_def_id) { let trait_def_id = trait_ref.skip_binder().def_id; diff --git a/crates/rustc_codegen_spirv/src/lib.rs b/crates/rustc_codegen_spirv/src/lib.rs index 0e15cebf24..76f5f5bc71 100644 --- a/crates/rustc_codegen_spirv/src/lib.rs +++ b/crates/rustc_codegen_spirv/src/lib.rs @@ -151,10 +151,9 @@ use maybe_pqp_cg_ssa::traits::{ }; use maybe_pqp_cg_ssa::{CodegenResults, CompiledModule, ModuleCodegen, ModuleKind, TargetConfig}; use rspirv::binary::Assemble; -use rustc_ast::expand::allocator::AllocatorKind; -use rustc_ast::expand::autodiff_attrs::AutoDiffItem; +use rustc_ast::expand::allocator::AllocatorMethod; use rustc_data_structures::fx::FxIndexMap; -use rustc_errors::{DiagCtxtHandle, FatalError}; +use rustc_errors::DiagCtxtHandle; use rustc_metadata::EncodedMetadata; use rustc_middle::dep_graph::{WorkProduct, WorkProductId}; use rustc_middle::mir::mono::{MonoItem, MonoItemData}; @@ -281,6 +280,10 @@ impl CodegenBackend for SpirvCodegenBackend { ); drop(timer); } + + fn name(&self) -> &'static str { + "SpirvCodegenBackend" + } } struct SpirvModuleBuffer(Vec); @@ -299,16 +302,13 @@ impl ThinBufferMethods for SpirvModuleBuffer { fn data(&self) -> &[u8] { self.as_bytes() } - fn thin_link_data(&self) -> &[u8] { - &[] - } } impl SpirvCodegenBackend { fn optimize_common( _cgcx: &CodegenContext, module: &mut ModuleCodegen<::Module>, - ) -> Result<(), FatalError> { + ) { // Apply DCE ("dead code elimination") to modules before ever serializing // them as `.spv` files (technically, `.rcgu.o` files inside `.rlib`s), // that will later get linked (potentially many times, esp. if this is @@ -317,8 +317,6 @@ impl SpirvCodegenBackend { linker::dce::dce(&mut module.module_llvm); // FIXME(eddyb) run as many optimization passes as possible, not just DCE. - - Ok(()) } } @@ -339,8 +337,7 @@ impl WriteBackendMethods for SpirvCodegenBackend { _exported_symbols_for_lto: &[String], _each_linked_rlib_for_lto: &[PathBuf], _modules: Vec>, - _diff_fncs: Vec, - ) -> Result, FatalError> { + ) -> ModuleCodegen { assert!( cgcx.lto == rustc_session::config::Lto::Fat, "`run_and_optimize_fat_lto` (for `WorkItemResult::NeedsFatLto`) should \ @@ -356,7 +353,7 @@ impl WriteBackendMethods for SpirvCodegenBackend { _each_linked_rlib_for_lto: &[PathBuf], // njn: ? modules: Vec<(String, Self::ThinBuffer)>, cached_modules: Vec<(SerializedModule, WorkProduct)>, - ) -> Result<(Vec>, Vec), FatalError> { + ) -> (Vec>, Vec) { link::run_thin(cgcx, modules, cached_modules) } @@ -373,14 +370,14 @@ impl WriteBackendMethods for SpirvCodegenBackend { _dcx: DiagCtxtHandle<'_>, module: &mut ModuleCodegen, _config: &ModuleConfig, - ) -> Result<(), FatalError> { - Self::optimize_common(cgcx, module) + ) { + Self::optimize_common(cgcx, module); } fn optimize_thin( cgcx: &CodegenContext, thin_module: ThinModule, - ) -> Result, FatalError> { + ) -> ModuleCodegen { // FIXME(eddyb) the inefficiency of Module -> [u8] -> Module roundtrips // comes from upstream and it applies to `rustc_codegen_llvm` as well, // eventually it should be properly addressed (for `ThinLocal` at least). @@ -393,15 +390,15 @@ impl WriteBackendMethods for SpirvCodegenBackend { kind: ModuleKind::Regular, thin_lto_buffer: None, }; - Self::optimize_common(cgcx, &mut module)?; - Ok(module) + Self::optimize_common(cgcx, &mut module); + module } fn codegen( cgcx: &CodegenContext, module: ModuleCodegen, _config: &ModuleConfig, - ) -> Result { + ) -> CompiledModule { let kind = module.kind; let (name, module_buffer) = Self::serialize_module(module); @@ -412,7 +409,7 @@ impl WriteBackendMethods for SpirvCodegenBackend { ); fs::write(&path, module_buffer.as_bytes()).unwrap(); - Ok(CompiledModule { + CompiledModule { name, kind, object: Some(path), @@ -421,13 +418,10 @@ impl WriteBackendMethods for SpirvCodegenBackend { assembly: None, llvm_ir: None, links_from_incr_cache: vec![], - }) + } } - fn prepare_thin( - module: ModuleCodegen, - _want_summary: bool, - ) -> (String, Self::ThinBuffer) { + fn prepare_thin(module: ModuleCodegen) -> (String, Self::ThinBuffer) { Self::serialize_module(module) } @@ -440,13 +434,7 @@ impl WriteBackendMethods for SpirvCodegenBackend { } impl ExtraBackendMethods for SpirvCodegenBackend { - fn codegen_allocator( - &self, - _: TyCtxt<'_>, - _: &str, - _: AllocatorKind, - _: AllocatorKind, - ) -> Self::Module { + fn codegen_allocator(&self, _: TyCtxt<'_>, _: &str, _: &[AllocatorMethod]) -> Self::Module { todo!() } diff --git a/crates/rustc_codegen_spirv/src/link.rs b/crates/rustc_codegen_spirv/src/link.rs index 6e129c491c..430cbac59b 100644 --- a/crates/rustc_codegen_spirv/src/link.rs +++ b/crates/rustc_codegen_spirv/src/link.rs @@ -7,12 +7,14 @@ use ar::{Archive, GnuBuilder, Header}; use rspirv::binary::Assemble; use rspirv::dr::Module; use rustc_ast::CRATE_NODE_ID; +use rustc_attr_parsing::{ShouldEmit, eval_config_entry}; use rustc_codegen_spirv_types::{CompileResult, ModuleResult}; use rustc_codegen_ssa::back::lto::{SerializedModule, ThinModule, ThinShared}; use rustc_codegen_ssa::back::write::CodegenContext; use rustc_codegen_ssa::{CodegenResults, NativeLib}; use rustc_data_structures::fx::FxHashSet; -use rustc_errors::{Diag, FatalError}; +use rustc_errors::Diag; +use rustc_hir::attrs::NativeLibKind; use rustc_metadata::{EncodedMetadata, fs::METADATA_FILENAME}; use rustc_middle::bug; use rustc_middle::dep_graph::WorkProduct; @@ -22,7 +24,6 @@ use rustc_session::config::{ CrateType, DebugInfo, Lto, OptLevel, OutFileName, OutputFilenames, OutputType, }; use rustc_session::output::{check_file_is_writeable, invalid_output_for_target, out_filename}; -use rustc_session::utils::NativeLibKind; use rustc_span::Symbol; use std::collections::BTreeMap; use std::ffi::{CString, OsStr}; @@ -496,7 +497,9 @@ fn add_upstream_native_libraries( // (see `compiler/rustc_codegen_ssa/src/back/link.rs`) fn relevant_lib(sess: &Session, lib: &NativeLib) -> bool { match lib.cfg { - Some(ref cfg) => rustc_attr_parsing::cfg_matches(cfg, sess, CRATE_NODE_ID, None), + Some(ref cfg) => { + eval_config_entry(sess, cfg, CRATE_NODE_ID, None, ShouldEmit::ErrorsAndLints).as_bool() + } None => true, } } @@ -634,7 +637,7 @@ pub(crate) fn run_thin( cgcx: &CodegenContext, modules: Vec<(String, SpirvModuleBuffer)>, cached_modules: Vec<(SerializedModule, WorkProduct)>, -) -> Result<(Vec>, Vec), FatalError> { +) -> (Vec>, Vec) { if cgcx.opts.cg.linker_plugin_lto.enabled() { unreachable!("We should never reach this case if the LTO step is deferred to the linker"); } @@ -674,5 +677,5 @@ pub(crate) fn run_thin( }); } - Ok((opt_jobs, vec![])) + (opt_jobs, vec![]) } diff --git a/rust-toolchain.toml b/rust-toolchain.toml index 2dad704aad..853b90472e 100644 --- a/rust-toolchain.toml +++ b/rust-toolchain.toml @@ -1,7 +1,7 @@ [toolchain] -channel = "nightly-2025-08-04" +channel = "nightly-2025-10-28" components = ["rust-src", "rustc-dev", "llvm-tools"] -# commit_hash = f34ba774c78ea32b7c40598b8ad23e75cdac42a6 +# commit_hash = adaa838976ff99a4f0661136322f64cb466b58a0 # Whenever changing the nightly channel, update the commit hash above, and # change `REQUIRED_RUST_TOOLCHAIN` in `crates/rustc_codegen_spirv/build.rs` too. From cd0f292041abcf8034635c8fbb066400c0f2dded Mon Sep 17 00:00:00 2001 From: firestar99 Date: Thu, 26 Feb 2026 12:40:19 +0100 Subject: [PATCH 2/5] adjust target specs for rustc 1.93.0 --- .../rustc_codegen_spirv-types/src/target_spec.rs | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/crates/rustc_codegen_spirv-types/src/target_spec.rs b/crates/rustc_codegen_spirv-types/src/target_spec.rs index 67d339423b..3af35c8a8c 100644 --- a/crates/rustc_codegen_spirv-types/src/target_spec.rs +++ b/crates/rustc_codegen_spirv-types/src/target_spec.rs @@ -16,6 +16,8 @@ pub enum TargetSpecVersion { /// Some later version requires them. /// Some earlier version fails with them (notably our 0.9.0 release). Rustc_1_76_0, + /// rustc 1.93 requires that the value of "target-pointer-width" is no longer a string but u16 + Rustc_1_93_0, } impl TargetSpecVersion { @@ -39,7 +41,9 @@ impl TargetSpecVersion { /// Returns the version of the target spec required for a certain rustc version. May return `None` if the version /// is old enough to not need target specs. pub fn from_rustc_version(rustc_version: Version) -> Option { - if rustc_version >= Version::new(1, 85, 0) { + if rustc_version >= Version::new(1, 93, 0) { + Some(Self::Rustc_1_93_0) + } else if rustc_version >= Version::new(1, 85, 0) { Some(Self::Rustc_1_85_0) } else if rustc_version >= Version::new(1, 76, 0) { Some(Self::Rustc_1_76_0) @@ -52,8 +56,12 @@ impl TargetSpecVersion { pub fn format_spec(&self, target: &SpirvTarget) -> String { let target_env = target.env(); let extra = match self { - TargetSpecVersion::Rustc_1_85_0 => r#""crt-static-respected": true,"#, TargetSpecVersion::Rustc_1_76_0 => r#""os": "unknown","#, + _ => r#""crt-static-respected": true,"#, + }; + let target_pointer_width = match self { + TargetSpecVersion::Rustc_1_76_0 | TargetSpecVersion::Rustc_1_85_0 => "\"32\"", + TargetSpecVersion::Rustc_1_93_0 => "32", }; format!( r#"{{ @@ -80,7 +88,7 @@ impl TargetSpecVersion { {extra} "panic-strategy": "abort", "simd-types-indirect": false, - "target-pointer-width": "32" + "target-pointer-width": {target_pointer_width} }}"# ) } From 124a8e47ca38ccdea59e314dca9be215ebee491f Mon Sep 17 00:00:00 2001 From: firestar99 Date: Thu, 26 Feb 2026 12:43:22 +0100 Subject: [PATCH 3/5] bless compiletests --- .../subgroup_cluster_size_0_fail.stderr | 2 +- ..._cluster_size_non_power_of_two_fail.stderr | 2 +- .../subgroup_composite_enum_err.stderr | 11 ++- tests/compiletests/ui/dis/issue-1062.stderr | 2 +- .../ui/dis/panic_builtin_bounds_check.stderr | 4 +- .../ui/dis/panic_sequential_many.stderr | 36 ++++---- tests/compiletests/ui/dis/ptr_read.stderr | 2 +- .../ui/dis/ptr_read_method.stderr | 2 +- tests/compiletests/ui/dis/ptr_write.stderr | 2 +- .../ui/dis/ptr_write_method.stderr | 2 +- .../ui/lang/asm/block_tracking_fail.stderr | 12 +-- .../ui/lang/asm/issue-1002.stderr | 16 ++-- .../consts/nested-ref-in-composite.stderr | 34 +++---- .../ui/lang/core/intrinsics/black_box.stderr | 2 +- .../ui/lang/core/unwrap_or.stderr | 4 +- tests/compiletests/ui/lang/issue-452.stderr | 33 +------ .../ui/lang/panic/track_caller.stderr | 11 --- .../ui/spirv-attr/invalid-target.stderr | 88 +++++++++---------- 18 files changed, 116 insertions(+), 149 deletions(-) delete mode 100644 tests/compiletests/ui/lang/panic/track_caller.stderr diff --git a/tests/compiletests/ui/arch/subgroup/subgroup_cluster_size_0_fail.stderr b/tests/compiletests/ui/arch/subgroup/subgroup_cluster_size_0_fail.stderr index d5f06bdb4b..f6e00334ed 100644 --- a/tests/compiletests/ui/arch/subgroup/subgroup_cluster_size_0_fail.stderr +++ b/tests/compiletests/ui/arch/subgroup/subgroup_cluster_size_0_fail.stderr @@ -26,7 +26,7 @@ LL | | "); | = note: this note originates in the macro `macro_subgroup_op_clustered` (in Nightly builds, run with -Z macro-backtrace for more info) -note: the above error was encountered while instantiating `fn spirv_std::arch::subgroup_clustered_i_add::<0, u32, u32>` +note: the above error was encountered while instantiating `fn subgroup_clustered_i_add::<0, u32, u32>` --> $DIR/subgroup_cluster_size_0_fail.rs:10:5 | LL | spirv_std::arch::subgroup_clustered_i_add::<0, _>(value) diff --git a/tests/compiletests/ui/arch/subgroup/subgroup_cluster_size_non_power_of_two_fail.stderr b/tests/compiletests/ui/arch/subgroup/subgroup_cluster_size_non_power_of_two_fail.stderr index db300c3e12..2ce2568495 100644 --- a/tests/compiletests/ui/arch/subgroup/subgroup_cluster_size_non_power_of_two_fail.stderr +++ b/tests/compiletests/ui/arch/subgroup/subgroup_cluster_size_non_power_of_two_fail.stderr @@ -26,7 +26,7 @@ LL | | "); | = note: this note originates in the macro `macro_subgroup_op_clustered` (in Nightly builds, run with -Z macro-backtrace for more info) -note: the above error was encountered while instantiating `fn spirv_std::arch::subgroup_clustered_i_add::<5, u32, u32>` +note: the above error was encountered while instantiating `fn subgroup_clustered_i_add::<5, u32, u32>` --> $DIR/subgroup_cluster_size_non_power_of_two_fail.rs:10:5 | LL | spirv_std::arch::subgroup_clustered_i_add::<5, _>(value) diff --git a/tests/compiletests/ui/arch/subgroup/subgroup_composite_enum_err.stderr b/tests/compiletests/ui/arch/subgroup/subgroup_composite_enum_err.stderr index c30f70f2da..a6aa555235 100644 --- a/tests/compiletests/ui/arch/subgroup/subgroup_composite_enum_err.stderr +++ b/tests/compiletests/ui/arch/subgroup/subgroup_composite_enum_err.stderr @@ -60,14 +60,19 @@ LL | #[repr(u16)] | = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! = note: for more information, see issue #68585 - = note: `#[deny(conflicting_repr_hints)]` on by default + = note: `#[deny(conflicting_repr_hints)]` (part of `#[deny(future_incompatible)]`) on by default error[E0277]: the trait bound `NoFrom: From` is not satisfied --> $DIR/subgroup_composite_enum_err.rs: | LL | #[derive(Copy, Clone, Default, ScalarComposite)] - | ^^^^^^^^^^^^^^^ the trait `From` is not implemented for `NoFrom` + | ^^^^^^^^^^^^^^^ unsatisfied trait bound | +help: the trait `From` is not implemented for `NoFrom` + --> $DIR/subgroup_composite_enum_err.rs: + | +LL | pub enum NoFrom { + | ^^^^^^^^^^^^^^^ = note: this error originates in the derive macro `ScalarComposite` (in Nightly builds, run with -Z macro-backtrace for more info) error[E0277]: the trait bound `i32: From` is not satisfied @@ -90,7 +95,7 @@ error[E0277]: the trait bound `WrongFrom: From` is not satisfied --> $DIR/subgroup_composite_enum_err.rs: | LL | #[derive(Copy, Clone, Default, ScalarComposite)] - | ^^^^^^^^^^^^^^^ the trait `From` is not implemented for `WrongFrom` + | ^^^^^^^^^^^^^^^ unsatisfied trait bound | = help: the trait `From` is not implemented for `WrongFrom` but trait `From` is implemented for it diff --git a/tests/compiletests/ui/dis/issue-1062.stderr b/tests/compiletests/ui/dis/issue-1062.stderr index 5019327bfb..9a72a047cb 100644 --- a/tests/compiletests/ui/dis/issue-1062.stderr +++ b/tests/compiletests/ui/dis/issue-1062.stderr @@ -4,7 +4,7 @@ OpLine %5 11 12 %6 = OpLoad %7 %8 OpLine %5 11 35 %9 = OpLoad %7 %10 -OpLine %11 1128 4 +OpLine %11 1134 4 %12 = OpBitwiseAnd %7 %9 %13 %14 = OpISub %7 %15 %12 %16 = OpShiftLeftLogical %7 %6 %12 diff --git a/tests/compiletests/ui/dis/panic_builtin_bounds_check.stderr b/tests/compiletests/ui/dis/panic_builtin_bounds_check.stderr index a3bee642b1..6486f832eb 100644 --- a/tests/compiletests/ui/dis/panic_builtin_bounds_check.stderr +++ b/tests/compiletests/ui/dis/panic_builtin_bounds_check.stderr @@ -4,7 +4,7 @@ OpExtension "SPV_KHR_non_semantic_info" OpMemoryModel Logical Simple OpEntryPoint Fragment %2 "main" OpExecutionMode %2 OriginUpperLeft -%3 = OpString "/n[Rust panicked at $SYSROOT/lib/rustlib/src/rust/library/core/src/panicking.rs:280:5]/n index out of bounds: the len is %u but the index is %u/n in main()/n" +%3 = OpString "/n[Rust panicked at $SYSROOT/lib/rustlib/src/rust/library/core/src/panicking.rs:276:5]/n index out of bounds: the len is %u but the index is %u/n in main()/n" %4 = OpString $SYSROOT/lib/rustlib/src/rust/library/core/src/panicking.rs" %5 = OpString "$DIR/panic_builtin_bounds_check.rs" OpDecorate %6 ArrayStride 4 @@ -42,7 +42,7 @@ OpBranchConditional %28 %30 %31 %30 = OpLabel OpBranch %29 %31 = OpLabel -OpLine %4 280 4 +OpLine %4 276 4 %32 = OpExtInst %7 %1 1 %3 %10 %18 OpNoLine OpReturn diff --git a/tests/compiletests/ui/dis/panic_sequential_many.stderr b/tests/compiletests/ui/dis/panic_sequential_many.stderr index ad3952f81b..ffe854c6fe 100644 --- a/tests/compiletests/ui/dis/panic_sequential_many.stderr +++ b/tests/compiletests/ui/dis/panic_sequential_many.stderr @@ -4,7 +4,7 @@ OpExtension "SPV_KHR_non_semantic_info" OpMemoryModel Logical Simple OpEntryPoint Fragment %2 "main" %3 %4 %5 OpExecutionMode %2 OriginUpperLeft -%6 = OpString "/n[Rust panicked at $SYSROOT/lib/rustlib/src/rust/library/core/src/panicking.rs:187:5]/n attempt to divide by zero/n in main()/n" +%6 = OpString "/n[Rust panicked at $SYSROOT/lib/rustlib/src/rust/library/core/src/panicking.rs:192:5]/n attempt to divide by zero/n in main()/n" %7 = OpString $SYSROOT/lib/rustlib/src/rust/library/core/src/panicking.rs" %8 = OpString "$DIR/panic_sequential_many.rs" OpName %3 "x" @@ -37,7 +37,7 @@ OpNoLine OpSelectionMerge %20 None OpBranchConditional %19 %21 %22 %21 = OpLabel -OpLine %7 187 4 +OpLine %7 192 4 %23 = OpExtInst %12 %1 1 %6 OpNoLine OpReturn @@ -51,7 +51,7 @@ OpNoLine OpSelectionMerge %26 None OpBranchConditional %25 %27 %28 %27 = OpLabel -OpLine %7 187 4 +OpLine %7 192 4 %29 = OpExtInst %12 %1 1 %6 OpNoLine OpReturn @@ -65,7 +65,7 @@ OpNoLine OpSelectionMerge %32 None OpBranchConditional %31 %33 %34 %33 = OpLabel -OpLine %7 187 4 +OpLine %7 192 4 %35 = OpExtInst %12 %1 1 %6 OpNoLine OpReturn @@ -79,7 +79,7 @@ OpNoLine OpSelectionMerge %38 None OpBranchConditional %37 %39 %40 %39 = OpLabel -OpLine %7 187 4 +OpLine %7 192 4 %41 = OpExtInst %12 %1 1 %6 OpNoLine OpReturn @@ -93,7 +93,7 @@ OpNoLine OpSelectionMerge %44 None OpBranchConditional %43 %45 %46 %45 = OpLabel -OpLine %7 187 4 +OpLine %7 192 4 %47 = OpExtInst %12 %1 1 %6 OpNoLine OpReturn @@ -107,7 +107,7 @@ OpNoLine OpSelectionMerge %50 None OpBranchConditional %49 %51 %52 %51 = OpLabel -OpLine %7 187 4 +OpLine %7 192 4 %53 = OpExtInst %12 %1 1 %6 OpNoLine OpReturn @@ -121,7 +121,7 @@ OpNoLine OpSelectionMerge %56 None OpBranchConditional %55 %57 %58 %57 = OpLabel -OpLine %7 187 4 +OpLine %7 192 4 %59 = OpExtInst %12 %1 1 %6 OpNoLine OpReturn @@ -135,7 +135,7 @@ OpNoLine OpSelectionMerge %62 None OpBranchConditional %61 %63 %64 %63 = OpLabel -OpLine %7 187 4 +OpLine %7 192 4 %65 = OpExtInst %12 %1 1 %6 OpNoLine OpReturn @@ -149,7 +149,7 @@ OpNoLine OpSelectionMerge %68 None OpBranchConditional %67 %69 %70 %69 = OpLabel -OpLine %7 187 4 +OpLine %7 192 4 %71 = OpExtInst %12 %1 1 %6 OpNoLine OpReturn @@ -163,7 +163,7 @@ OpNoLine OpSelectionMerge %74 None OpBranchConditional %73 %75 %76 %75 = OpLabel -OpLine %7 187 4 +OpLine %7 192 4 %77 = OpExtInst %12 %1 1 %6 OpNoLine OpReturn @@ -177,7 +177,7 @@ OpNoLine OpSelectionMerge %80 None OpBranchConditional %79 %81 %82 %81 = OpLabel -OpLine %7 187 4 +OpLine %7 192 4 %83 = OpExtInst %12 %1 1 %6 OpNoLine OpReturn @@ -191,7 +191,7 @@ OpNoLine OpSelectionMerge %86 None OpBranchConditional %85 %87 %88 %87 = OpLabel -OpLine %7 187 4 +OpLine %7 192 4 %89 = OpExtInst %12 %1 1 %6 OpNoLine OpReturn @@ -205,7 +205,7 @@ OpNoLine OpSelectionMerge %92 None OpBranchConditional %91 %93 %94 %93 = OpLabel -OpLine %7 187 4 +OpLine %7 192 4 %95 = OpExtInst %12 %1 1 %6 OpNoLine OpReturn @@ -219,7 +219,7 @@ OpNoLine OpSelectionMerge %98 None OpBranchConditional %97 %99 %100 %99 = OpLabel -OpLine %7 187 4 +OpLine %7 192 4 %101 = OpExtInst %12 %1 1 %6 OpNoLine OpReturn @@ -233,7 +233,7 @@ OpNoLine OpSelectionMerge %104 None OpBranchConditional %103 %105 %106 %105 = OpLabel -OpLine %7 187 4 +OpLine %7 192 4 %107 = OpExtInst %12 %1 1 %6 OpNoLine OpReturn @@ -247,7 +247,7 @@ OpNoLine OpSelectionMerge %110 None OpBranchConditional %109 %111 %112 %111 = OpLabel -OpLine %7 187 4 +OpLine %7 192 4 %113 = OpExtInst %12 %1 1 %6 OpNoLine OpReturn @@ -261,7 +261,7 @@ OpNoLine OpSelectionMerge %116 None OpBranchConditional %115 %117 %118 %117 = OpLabel -OpLine %7 187 4 +OpLine %7 192 4 %119 = OpExtInst %12 %1 1 %6 OpNoLine OpReturn diff --git a/tests/compiletests/ui/dis/ptr_read.stderr b/tests/compiletests/ui/dis/ptr_read.stderr index 356ab80393..9ddcc0dd96 100644 --- a/tests/compiletests/ui/dis/ptr_read.stderr +++ b/tests/compiletests/ui/dis/ptr_read.stderr @@ -2,7 +2,7 @@ %4 = OpFunctionParameter %5 %6 = OpFunctionParameter %5 %7 = OpLabel -OpLine %8 1739 8 +OpLine %8 1744 8 %9 = OpLoad %10 %4 OpLine %11 7 13 OpStore %6 %9 diff --git a/tests/compiletests/ui/dis/ptr_read_method.stderr b/tests/compiletests/ui/dis/ptr_read_method.stderr index 356ab80393..9ddcc0dd96 100644 --- a/tests/compiletests/ui/dis/ptr_read_method.stderr +++ b/tests/compiletests/ui/dis/ptr_read_method.stderr @@ -2,7 +2,7 @@ %4 = OpFunctionParameter %5 %6 = OpFunctionParameter %5 %7 = OpLabel -OpLine %8 1739 8 +OpLine %8 1744 8 %9 = OpLoad %10 %4 OpLine %11 7 13 OpStore %6 %9 diff --git a/tests/compiletests/ui/dis/ptr_write.stderr b/tests/compiletests/ui/dis/ptr_write.stderr index 6a82111894..3b8503a01c 100644 --- a/tests/compiletests/ui/dis/ptr_write.stderr +++ b/tests/compiletests/ui/dis/ptr_write.stderr @@ -4,7 +4,7 @@ %7 = OpLabel OpLine %8 7 35 %9 = OpLoad %10 %4 -OpLine %11 1939 8 +OpLine %11 1944 8 OpStore %6 %9 OpNoLine OpReturn diff --git a/tests/compiletests/ui/dis/ptr_write_method.stderr b/tests/compiletests/ui/dis/ptr_write_method.stderr index b882dca670..c9dcea78f4 100644 --- a/tests/compiletests/ui/dis/ptr_write_method.stderr +++ b/tests/compiletests/ui/dis/ptr_write_method.stderr @@ -4,7 +4,7 @@ %7 = OpLabel OpLine %8 7 37 %9 = OpLoad %10 %4 -OpLine %11 1939 8 +OpLine %11 1944 8 OpStore %6 %9 OpNoLine OpReturn diff --git a/tests/compiletests/ui/lang/asm/block_tracking_fail.stderr b/tests/compiletests/ui/lang/asm/block_tracking_fail.stderr index cdd2c7b0b3..a498a6a77a 100644 --- a/tests/compiletests/ui/lang/asm/block_tracking_fail.stderr +++ b/tests/compiletests/ui/lang/asm/block_tracking_fail.stderr @@ -1,15 +1,15 @@ -error: `noreturn` requires a terminator at the end - --> $DIR/block_tracking_fail.rs:11:15 - | -LL | asm!("", options(noreturn)); - | ^ - error: trailing terminator `OpUnreachable` requires `options(noreturn)` --> $DIR/block_tracking_fail.rs:18:15 | LL | asm!("OpUnreachable"); | ^^^^^^^^^^^^^ +error: `noreturn` requires a terminator at the end + --> $DIR/block_tracking_fail.rs:11:15 + | +LL | asm!("", options(noreturn)); + | ^ + error: expected `OpLabel` after terminator `OpKill` --> $DIR/block_tracking_fail.rs:26:14 | diff --git a/tests/compiletests/ui/lang/asm/issue-1002.stderr b/tests/compiletests/ui/lang/asm/issue-1002.stderr index 8b811d8ae9..974ce761ab 100644 --- a/tests/compiletests/ui/lang/asm/issue-1002.stderr +++ b/tests/compiletests/ui/lang/asm/issue-1002.stderr @@ -6,14 +6,6 @@ LL | asm!("OpReturn", options(noreturn)); | = note: resuming execution, without falling through the end of the `asm!` block, is always undefined behavior -error: using `OpReturnValue` to return from within `asm!` is disallowed - --> $DIR/issue-1002.rs:16:14 - | -LL | "OpReturnValue {x}", - | ^^^^^^^^^^^^^^^^^ - | - = note: resuming execution, without falling through the end of the `asm!` block, is always undefined behavior - error: using `OpReturn` to return from within `asm!` is disallowed --> $DIR/issue-1002.rs:26:14 | @@ -22,6 +14,14 @@ LL | "OpReturn", // close active block | = note: resuming execution, without falling through the end of the `asm!` block, is always undefined behavior +error: using `OpReturnValue` to return from within `asm!` is disallowed + --> $DIR/issue-1002.rs:16:14 + | +LL | "OpReturnValue {x}", + | ^^^^^^^^^^^^^^^^^ + | + = note: resuming execution, without falling through the end of the `asm!` block, is always undefined behavior + error: using `OpReturnValue` to return from within `asm!` is disallowed --> $DIR/issue-1002.rs:35:14 | diff --git a/tests/compiletests/ui/lang/consts/nested-ref-in-composite.stderr b/tests/compiletests/ui/lang/consts/nested-ref-in-composite.stderr index 4b1883e454..b2da8063b8 100644 --- a/tests/compiletests/ui/lang/consts/nested-ref-in-composite.stderr +++ b/tests/compiletests/ui/lang/consts/nested-ref-in-composite.stderr @@ -1,20 +1,3 @@ -error: constant arrays/structs cannot contain pointers to other constants - --> $DIR/nested-ref-in-composite.rs:20:17 - | -LL | *pair_out = pair_deep_load(&(&123, &3.14)); - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - | -note: used from within `nested_ref_in_composite::main_pair` - --> $DIR/nested-ref-in-composite.rs:20:17 - | -LL | *pair_out = pair_deep_load(&(&123, &3.14)); - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -note: called by `main_pair` - --> $DIR/nested-ref-in-composite.rs:19:8 - | -LL | pub fn main_pair(pair_out: &mut (u32, f32)) { - | ^^^^^^^^^ - error: constant arrays/structs cannot contain pointers to other constants --> $DIR/nested-ref-in-composite.rs:25:19 | @@ -32,5 +15,22 @@ note: called by `main_array3` LL | pub fn main_array3(array3_out: &mut [u32; 3]) { | ^^^^^^^^^^^ +error: constant arrays/structs cannot contain pointers to other constants + --> $DIR/nested-ref-in-composite.rs:20:17 + | +LL | *pair_out = pair_deep_load(&(&123, &3.14)); + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | +note: used from within `nested_ref_in_composite::main_pair` + --> $DIR/nested-ref-in-composite.rs:20:17 + | +LL | *pair_out = pair_deep_load(&(&123, &3.14)); + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +note: called by `main_pair` + --> $DIR/nested-ref-in-composite.rs:19:8 + | +LL | pub fn main_pair(pair_out: &mut (u32, f32)) { + | ^^^^^^^^^ + error: aborting due to 2 previous errors diff --git a/tests/compiletests/ui/lang/core/intrinsics/black_box.stderr b/tests/compiletests/ui/lang/core/intrinsics/black_box.stderr index 192a37e3a3..c5dfb04dea 100644 --- a/tests/compiletests/ui/lang/core/intrinsics/black_box.stderr +++ b/tests/compiletests/ui/lang/core/intrinsics/black_box.stderr @@ -8,7 +8,7 @@ OpLine %5 41 19 %10 = OpIAdd %7 %11 %12 OpLine %5 47 8 %13 = OpBitcast %7 %14 -OpLine %15 1092 17 +OpLine %15 1103 17 %16 = OpBitcast %7 %17 OpLine %5 46 4 %18 = OpCompositeConstruct %2 %13 %16 %19 %20 %21 %22 %6 %23 %10 %24 %24 %24 diff --git a/tests/compiletests/ui/lang/core/unwrap_or.stderr b/tests/compiletests/ui/lang/core/unwrap_or.stderr index 56ecc9fb21..a5bcc86afb 100644 --- a/tests/compiletests/ui/lang/core/unwrap_or.stderr +++ b/tests/compiletests/ui/lang/core/unwrap_or.stderr @@ -1,8 +1,8 @@ %1 = OpFunction %2 None %3 %4 = OpLabel -OpLine %5 1035 14 +OpLine %5 1041 14 %6 = OpBitcast %7 %8 -OpLine %5 1035 8 +OpLine %5 1041 8 %9 = OpINotEqual %10 %6 %11 OpNoLine OpSelectionMerge %12 None diff --git a/tests/compiletests/ui/lang/issue-452.stderr b/tests/compiletests/ui/lang/issue-452.stderr index adc228530a..2f6b71f042 100644 --- a/tests/compiletests/ui/lang/issue-452.stderr +++ b/tests/compiletests/ui/lang/issue-452.stderr @@ -4,35 +4,8 @@ error: function pointer types are not allowed LL | fn use_cmp(cmp: fn(&Position) -> u32) { | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | - = note: used by unnamed global (%10) -note: used from within `issue_452::use_cmp` - --> $DIR/issue-452.rs:8:4 - | -LL | fn use_cmp(cmp: fn(&Position) -> u32) { - | ^^^^^^^ -note: called by `issue_452::main` - --> $DIR/issue-452.rs:17:5 - | -LL | use_cmp(|p| p.0); - | ^^^^^^^^^^^^^^^^ -note: called by `main` - --> $DIR/issue-452.rs:16:8 - | -LL | pub fn main() { - | ^^^^ - -error: indirect calls are not supported in SPIR-V - --> $DIR/issue-452.rs:12:27 - | -LL | let _ = if cmp(&a) <= cmp(&b) { a } else { b }; - | ^^^^^^^ - | -note: used from within `issue_452::use_cmp` - --> $DIR/issue-452.rs:8:4 - | -LL | fn use_cmp(cmp: fn(&Position) -> u32) { - | ^^^^^^^ -note: called by `issue_452::main` + = note: used by unnamed global (%44) +note: used from within `issue_452::main` --> $DIR/issue-452.rs:17:5 | LL | use_cmp(|p| p.0); @@ -43,5 +16,5 @@ note: called by `main` LL | pub fn main() { | ^^^^ -error: aborting due to 2 previous errors +error: aborting due to 1 previous error diff --git a/tests/compiletests/ui/lang/panic/track_caller.stderr b/tests/compiletests/ui/lang/panic/track_caller.stderr deleted file mode 100644 index b18b2fed0d..0000000000 --- a/tests/compiletests/ui/lang/panic/track_caller.stderr +++ /dev/null @@ -1,11 +0,0 @@ -warning: `#[inline(never)]` function `track_caller::track_caller_maybe_panic::panic_cold_explicit` has been inlined - --> $DIR/track_caller.rs:10:9 - | -LL | panic!(); - | ^^^^^^^^ - | - = note: inlining was required due to panicking - = note: called from `track_caller::track_caller_maybe_panic` - -warning: 1 warning emitted - diff --git a/tests/compiletests/ui/spirv-attr/invalid-target.stderr b/tests/compiletests/ui/spirv-attr/invalid-target.stderr index e796b01656..4e5cb57615 100644 --- a/tests/compiletests/ui/spirv-attr/invalid-target.stderr +++ b/tests/compiletests/ui/spirv-attr/invalid-target.stderr @@ -328,133 +328,133 @@ error: attribute is only valid on a function parameter, not on a foreign module LL | uniform, position, descriptor_set = 0, binding = 0, flat, invariant, // param-only | ^^^^^^^^^ -error: attribute is only valid on a struct, not on a static item +error: attribute is only valid on a struct, not on a static --> $DIR/invalid-target.rs:96:5 | LL | sampler, block, sampled_image, generic_image_type, // struct-only | ^^^^^^^ -error: attribute is only valid on a struct, not on a static item +error: attribute is only valid on a struct, not on a static --> $DIR/invalid-target.rs:96:14 | LL | sampler, block, sampled_image, generic_image_type, // struct-only | ^^^^^ -error: attribute is only valid on a struct, not on a static item +error: attribute is only valid on a struct, not on a static --> $DIR/invalid-target.rs:96:21 | LL | sampler, block, sampled_image, generic_image_type, // struct-only | ^^^^^^^^^^^^^ -error: attribute is only valid on a struct, not on a static item +error: attribute is only valid on a struct, not on a static --> $DIR/invalid-target.rs:96:36 | LL | sampler, block, sampled_image, generic_image_type, // struct-only | ^^^^^^^^^^^^^^^^^^ -error: attribute is only valid on a function, not on a static item +error: attribute is only valid on a function, not on a static --> $DIR/invalid-target.rs:97:5 | LL | vertex, // fn-only | ^^^^^^ -error: attribute is only valid on a function parameter, not on a static item +error: attribute is only valid on a function parameter, not on a static --> $DIR/invalid-target.rs:98:5 | LL | uniform, position, descriptor_set = 0, binding = 0, flat, invariant, // param-only | ^^^^^^^ -error: attribute is only valid on a function parameter, not on a static item +error: attribute is only valid on a function parameter, not on a static --> $DIR/invalid-target.rs:98:14 | LL | uniform, position, descriptor_set = 0, binding = 0, flat, invariant, // param-only | ^^^^^^^^ -error: attribute is only valid on a function parameter, not on a static item +error: attribute is only valid on a function parameter, not on a static --> $DIR/invalid-target.rs:98:24 | LL | uniform, position, descriptor_set = 0, binding = 0, flat, invariant, // param-only | ^^^^^^^^^^^^^^^^^^ -error: attribute is only valid on a function parameter, not on a static item +error: attribute is only valid on a function parameter, not on a static --> $DIR/invalid-target.rs:98:44 | LL | uniform, position, descriptor_set = 0, binding = 0, flat, invariant, // param-only | ^^^^^^^^^^^ -error: attribute is only valid on a function parameter, not on a static item +error: attribute is only valid on a function parameter, not on a static --> $DIR/invalid-target.rs:98:57 | LL | uniform, position, descriptor_set = 0, binding = 0, flat, invariant, // param-only | ^^^^ -error: attribute is only valid on a function parameter, not on a static item +error: attribute is only valid on a function parameter, not on a static --> $DIR/invalid-target.rs:98:63 | LL | uniform, position, descriptor_set = 0, binding = 0, flat, invariant, // param-only | ^^^^^^^^^ -error: attribute is only valid on a struct, not on a constant item +error: attribute is only valid on a struct, not on a constant --> $DIR/invalid-target.rs:103:5 | LL | sampler, block, sampled_image, generic_image_type, // struct-only | ^^^^^^^ -error: attribute is only valid on a struct, not on a constant item +error: attribute is only valid on a struct, not on a constant --> $DIR/invalid-target.rs:103:14 | LL | sampler, block, sampled_image, generic_image_type, // struct-only | ^^^^^ -error: attribute is only valid on a struct, not on a constant item +error: attribute is only valid on a struct, not on a constant --> $DIR/invalid-target.rs:103:21 | LL | sampler, block, sampled_image, generic_image_type, // struct-only | ^^^^^^^^^^^^^ -error: attribute is only valid on a struct, not on a constant item +error: attribute is only valid on a struct, not on a constant --> $DIR/invalid-target.rs:103:36 | LL | sampler, block, sampled_image, generic_image_type, // struct-only | ^^^^^^^^^^^^^^^^^^ -error: attribute is only valid on a function, not on a constant item +error: attribute is only valid on a function, not on a constant --> $DIR/invalid-target.rs:104:5 | LL | vertex, // fn-only | ^^^^^^ -error: attribute is only valid on a function parameter, not on a constant item +error: attribute is only valid on a function parameter, not on a constant --> $DIR/invalid-target.rs:105:5 | LL | uniform, position, descriptor_set = 0, binding = 0, flat, invariant, // param-only | ^^^^^^^ -error: attribute is only valid on a function parameter, not on a constant item +error: attribute is only valid on a function parameter, not on a constant --> $DIR/invalid-target.rs:105:14 | LL | uniform, position, descriptor_set = 0, binding = 0, flat, invariant, // param-only | ^^^^^^^^ -error: attribute is only valid on a function parameter, not on a constant item +error: attribute is only valid on a function parameter, not on a constant --> $DIR/invalid-target.rs:105:24 | LL | uniform, position, descriptor_set = 0, binding = 0, flat, invariant, // param-only | ^^^^^^^^^^^^^^^^^^ -error: attribute is only valid on a function parameter, not on a constant item +error: attribute is only valid on a function parameter, not on a constant --> $DIR/invalid-target.rs:105:44 | LL | uniform, position, descriptor_set = 0, binding = 0, flat, invariant, // param-only | ^^^^^^^^^^^ -error: attribute is only valid on a function parameter, not on a constant item +error: attribute is only valid on a function parameter, not on a constant --> $DIR/invalid-target.rs:105:57 | LL | uniform, position, descriptor_set = 0, binding = 0, flat, invariant, // param-only | ^^^^ -error: attribute is only valid on a function parameter, not on a constant item +error: attribute is only valid on a function parameter, not on a constant --> $DIR/invalid-target.rs:105:63 | LL | uniform, position, descriptor_set = 0, binding = 0, flat, invariant, // param-only @@ -1030,67 +1030,67 @@ error: attribute is only valid on a function parameter, not on a struct field LL | uniform, position, descriptor_set = 0, binding = 0, flat, invariant, // param-only | ^^^^^^^^^ -error: attribute is only valid on a struct, not on a inherent implementation block +error: attribute is only valid on a struct, not on a implementation block --> $DIR/invalid-target.rs:176:5 | LL | sampler, block, sampled_image, generic_image_type, // struct-only | ^^^^^^^ -error: attribute is only valid on a struct, not on a inherent implementation block +error: attribute is only valid on a struct, not on a implementation block --> $DIR/invalid-target.rs:176:14 | LL | sampler, block, sampled_image, generic_image_type, // struct-only | ^^^^^ -error: attribute is only valid on a struct, not on a inherent implementation block +error: attribute is only valid on a struct, not on a implementation block --> $DIR/invalid-target.rs:176:21 | LL | sampler, block, sampled_image, generic_image_type, // struct-only | ^^^^^^^^^^^^^ -error: attribute is only valid on a struct, not on a inherent implementation block +error: attribute is only valid on a struct, not on a implementation block --> $DIR/invalid-target.rs:176:36 | LL | sampler, block, sampled_image, generic_image_type, // struct-only | ^^^^^^^^^^^^^^^^^^ -error: attribute is only valid on a function, not on a inherent implementation block +error: attribute is only valid on a function, not on a implementation block --> $DIR/invalid-target.rs:177:5 | LL | vertex, // fn-only | ^^^^^^ -error: attribute is only valid on a function parameter, not on a inherent implementation block +error: attribute is only valid on a function parameter, not on a implementation block --> $DIR/invalid-target.rs:178:5 | LL | uniform, position, descriptor_set = 0, binding = 0, flat, invariant, // param-only | ^^^^^^^ -error: attribute is only valid on a function parameter, not on a inherent implementation block +error: attribute is only valid on a function parameter, not on a implementation block --> $DIR/invalid-target.rs:178:14 | LL | uniform, position, descriptor_set = 0, binding = 0, flat, invariant, // param-only | ^^^^^^^^ -error: attribute is only valid on a function parameter, not on a inherent implementation block +error: attribute is only valid on a function parameter, not on a implementation block --> $DIR/invalid-target.rs:178:24 | LL | uniform, position, descriptor_set = 0, binding = 0, flat, invariant, // param-only | ^^^^^^^^^^^^^^^^^^ -error: attribute is only valid on a function parameter, not on a inherent implementation block +error: attribute is only valid on a function parameter, not on a implementation block --> $DIR/invalid-target.rs:178:44 | LL | uniform, position, descriptor_set = 0, binding = 0, flat, invariant, // param-only | ^^^^^^^^^^^ -error: attribute is only valid on a function parameter, not on a inherent implementation block +error: attribute is only valid on a function parameter, not on a implementation block --> $DIR/invalid-target.rs:178:57 | LL | uniform, position, descriptor_set = 0, binding = 0, flat, invariant, // param-only | ^^^^ -error: attribute is only valid on a function parameter, not on a inherent implementation block +error: attribute is only valid on a function parameter, not on a implementation block --> $DIR/invalid-target.rs:178:63 | LL | uniform, position, descriptor_set = 0, binding = 0, flat, invariant, // param-only @@ -1228,67 +1228,67 @@ error: attribute is only valid on a function parameter, not on a trait LL | uniform, position, descriptor_set = 0, binding = 0, flat, invariant, // param-only | ^^^^^^^^^ -error: attribute is only valid on a struct, not on a trait implementation block +error: attribute is only valid on a struct, not on a implementation block --> $DIR/invalid-target.rs:237:5 | LL | sampler, block, sampled_image, generic_image_type, // struct-only | ^^^^^^^ -error: attribute is only valid on a struct, not on a trait implementation block +error: attribute is only valid on a struct, not on a implementation block --> $DIR/invalid-target.rs:237:14 | LL | sampler, block, sampled_image, generic_image_type, // struct-only | ^^^^^ -error: attribute is only valid on a struct, not on a trait implementation block +error: attribute is only valid on a struct, not on a implementation block --> $DIR/invalid-target.rs:237:21 | LL | sampler, block, sampled_image, generic_image_type, // struct-only | ^^^^^^^^^^^^^ -error: attribute is only valid on a struct, not on a trait implementation block +error: attribute is only valid on a struct, not on a implementation block --> $DIR/invalid-target.rs:237:36 | LL | sampler, block, sampled_image, generic_image_type, // struct-only | ^^^^^^^^^^^^^^^^^^ -error: attribute is only valid on a function, not on a trait implementation block +error: attribute is only valid on a function, not on a implementation block --> $DIR/invalid-target.rs:238:5 | LL | vertex, // fn-only | ^^^^^^ -error: attribute is only valid on a function parameter, not on a trait implementation block +error: attribute is only valid on a function parameter, not on a implementation block --> $DIR/invalid-target.rs:239:5 | LL | uniform, position, descriptor_set = 0, binding = 0, flat, invariant, // param-only | ^^^^^^^ -error: attribute is only valid on a function parameter, not on a trait implementation block +error: attribute is only valid on a function parameter, not on a implementation block --> $DIR/invalid-target.rs:239:14 | LL | uniform, position, descriptor_set = 0, binding = 0, flat, invariant, // param-only | ^^^^^^^^ -error: attribute is only valid on a function parameter, not on a trait implementation block +error: attribute is only valid on a function parameter, not on a implementation block --> $DIR/invalid-target.rs:239:24 | LL | uniform, position, descriptor_set = 0, binding = 0, flat, invariant, // param-only | ^^^^^^^^^^^^^^^^^^ -error: attribute is only valid on a function parameter, not on a trait implementation block +error: attribute is only valid on a function parameter, not on a implementation block --> $DIR/invalid-target.rs:239:44 | LL | uniform, position, descriptor_set = 0, binding = 0, flat, invariant, // param-only | ^^^^^^^^^^^ -error: attribute is only valid on a function parameter, not on a trait implementation block +error: attribute is only valid on a function parameter, not on a implementation block --> $DIR/invalid-target.rs:239:57 | LL | uniform, position, descriptor_set = 0, binding = 0, flat, invariant, // param-only | ^^^^ -error: attribute is only valid on a function parameter, not on a trait implementation block +error: attribute is only valid on a function parameter, not on a implementation block --> $DIR/invalid-target.rs:239:63 | LL | uniform, position, descriptor_set = 0, binding = 0, flat, invariant, // param-only From 50672e3564155a7e9f745a19f4cdb28af9ef185c Mon Sep 17 00:00:00 2001 From: David Palm Date: Thu, 26 Feb 2026 13:10:16 +0100 Subject: [PATCH 4/5] fix linker test --- Cargo.lock | 1 + crates/rustc_codegen_spirv/Cargo.toml | 1 + crates/rustc_codegen_spirv/src/linker/test.rs | 11 ++--------- 3 files changed, 4 insertions(+), 9 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index ed781d9060..e0b1ed7a7b 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2743,6 +2743,7 @@ dependencies = [ "spirt", "spirv-std-types", "spirv-tools", + "termcolor", "thorin-dwp", "tracing", "tracing-subscriber", diff --git a/crates/rustc_codegen_spirv/Cargo.toml b/crates/rustc_codegen_spirv/Cargo.toml index 2357ae1f7f..ed72fbd280 100644 --- a/crates/rustc_codegen_spirv/Cargo.toml +++ b/crates/rustc_codegen_spirv/Cargo.toml @@ -64,6 +64,7 @@ tracing-tree = "0.4.0" [dev-dependencies] pretty_assertions = "1.0" +termcolor = "1.1.3" # HACK(eddyb) can't re-introduce deps of `rustc_codegen_ssa`, for `pqp_cg_ssa` # (see `build.rs`). diff --git a/crates/rustc_codegen_spirv/src/linker/test.rs b/crates/rustc_codegen_spirv/src/linker/test.rs index 3fdd7185af..e71e31b493 100644 --- a/crates/rustc_codegen_spirv/src/linker/test.rs +++ b/crates/rustc_codegen_spirv/src/linker/test.rs @@ -6,13 +6,6 @@ use rustc_session::config::{Input, OutputFilenames, OutputTypes}; use rustc_span::FileName; use std::io::Write; use std::sync::{Arc, Mutex}; - -// `termcolor` is needed because we cannot construct an Emitter after it was added in -// https://github.com/rust-lang/rust/pull/114104. This can be removed when -// https://github.com/rust-lang/rust/pull/115393 lands. -// We need to construct an emitter as yet another workaround, -// see https://github.com/rust-lang/rust/pull/102992. -extern crate termcolor; use termcolor::{ColorSpec, WriteColor}; // https://github.com/colin-kiegel/rust-pretty-assertions/issues/24 @@ -162,7 +155,6 @@ fn link_with_linker_opts( rustc_interface::util::rustc_version_str().unwrap_or("unknown"), Default::default(), &rustc_driver_impl::USING_INTERNAL_FEATURES, - Default::default(), ); // HACK(eddyb) inject `write_diags` into `sess`, to work around @@ -171,7 +163,7 @@ fn link_with_linker_opts( let source_map = sess.psess.clone_source_map(); let emitter = rustc_errors::emitter::HumanEmitter::new( - Box::new(buf), + rustc_errors::AutoStream::new(Box::new(buf), rustc_errors::ColorChoice::Never), rustc_driver_impl::default_translator(), ) .sm(Some(source_map.clone())); @@ -193,6 +185,7 @@ fn link_with_linker_opts( "".into(), None, None, + None, "".into(), OutputTypes::new(&[]), ), From 04cfbfcc411361bb4abd1aef3cd345ce3f013482 Mon Sep 17 00:00:00 2001 From: firestar99 Date: Thu, 26 Feb 2026 14:23:05 +0100 Subject: [PATCH 5/5] adjust clippy lints, remove deprecated `string_to_string` --- .cargo/config.toml | 1 - crates/spirv-builder/src/lib.rs | 1 - crates/spirv-std/macros/src/lib.rs | 1 - crates/spirv-std/src/lib.rs | 1 - examples/runners/ash/src/main.rs | 1 - examples/runners/cpu/src/main.rs | 1 - examples/runners/wgpu/src/lib.rs | 1 - 7 files changed, 7 deletions(-) diff --git a/.cargo/config.toml b/.cargo/config.toml index 946679c088..388ac776f1 100644 --- a/.cargo/config.toml +++ b/.cargo/config.toml @@ -82,7 +82,6 @@ rustflags = [ "-Wclippy::string_add_assign", "-Wclippy::string_add", "-Wclippy::string_lit_as_bytes", - "-Wclippy::string_to_string", "-Wclippy::todo", "-Wclippy::trait_duplication_in_bounds", "-Wclippy::unimplemented", diff --git a/crates/spirv-builder/src/lib.rs b/crates/spirv-builder/src/lib.rs index 9adfb3d112..b84c70969b 100644 --- a/crates/spirv-builder/src/lib.rs +++ b/crates/spirv-builder/src/lib.rs @@ -53,7 +53,6 @@ clippy::string_add_assign, clippy::string_add, clippy::string_lit_as_bytes, - clippy::string_to_string, clippy::todo, clippy::trait_duplication_in_bounds, clippy::unimplemented, diff --git a/crates/spirv-std/macros/src/lib.rs b/crates/spirv-std/macros/src/lib.rs index 05d14af6ed..8822d82fb8 100644 --- a/crates/spirv-std/macros/src/lib.rs +++ b/crates/spirv-std/macros/src/lib.rs @@ -53,7 +53,6 @@ clippy::string_add_assign, clippy::string_add, clippy::string_lit_as_bytes, - clippy::string_to_string, clippy::todo, clippy::trait_duplication_in_bounds, clippy::unimplemented, diff --git a/crates/spirv-std/src/lib.rs b/crates/spirv-std/src/lib.rs index 6e178fe874..78457b3ad8 100644 --- a/crates/spirv-std/src/lib.rs +++ b/crates/spirv-std/src/lib.rs @@ -59,7 +59,6 @@ clippy::string_add_assign, clippy::string_add, clippy::string_lit_as_bytes, - clippy::string_to_string, clippy::todo, clippy::trait_duplication_in_bounds, clippy::unimplemented, diff --git a/examples/runners/ash/src/main.rs b/examples/runners/ash/src/main.rs index a62d58709f..4c479e2074 100644 --- a/examples/runners/ash/src/main.rs +++ b/examples/runners/ash/src/main.rs @@ -53,7 +53,6 @@ clippy::string_add_assign, clippy::string_add, clippy::string_lit_as_bytes, - clippy::string_to_string, clippy::todo, clippy::trait_duplication_in_bounds, clippy::unimplemented, diff --git a/examples/runners/cpu/src/main.rs b/examples/runners/cpu/src/main.rs index 318f729a5d..4b4328faa0 100644 --- a/examples/runners/cpu/src/main.rs +++ b/examples/runners/cpu/src/main.rs @@ -53,7 +53,6 @@ clippy::string_add_assign, clippy::string_add, clippy::string_lit_as_bytes, - clippy::string_to_string, clippy::todo, clippy::trait_duplication_in_bounds, clippy::unimplemented, diff --git a/examples/runners/wgpu/src/lib.rs b/examples/runners/wgpu/src/lib.rs index 58dcbf677e..3f601b43f1 100644 --- a/examples/runners/wgpu/src/lib.rs +++ b/examples/runners/wgpu/src/lib.rs @@ -53,7 +53,6 @@ clippy::string_add_assign, clippy::string_add, clippy::string_lit_as_bytes, - clippy::string_to_string, clippy::todo, clippy::trait_duplication_in_bounds, clippy::unimplemented,