From 7d652399d1bd8f5763b153004df4b42ea7aac03d Mon Sep 17 00:00:00 2001 From: Nicholas Nethercote Date: Tue, 30 Sep 2025 13:59:42 +1000 Subject: [PATCH 01/16] Update to `nightly-2025-07-07`. - We now get warnings about unnecessary parentheses around `dyn` types. - Spelling of `sf.name.prefer_remapped_unconditionaly` was fixed (now ends in `lly`). - `Pointer::into_parts` has been replaced with `Pointer::prov_and_relative_offset`. --- crates/rustc_codegen_spirv/build.rs | 4 ++-- crates/rustc_codegen_spirv/src/builder_spirv.rs | 2 +- crates/rustc_codegen_spirv/src/codegen_cx/constant.rs | 4 ++-- crates/rustc_codegen_spirv/src/lib.rs | 3 +-- rust-toolchain.toml | 4 ++-- 5 files changed, 8 insertions(+), 9 deletions(-) diff --git a/crates/rustc_codegen_spirv/build.rs b/crates/rustc_codegen_spirv/build.rs index 3cf04312e1..0e04d5f798 100644 --- a/crates/rustc_codegen_spirv/build.rs +++ b/crates/rustc_codegen_spirv/build.rs @@ -18,9 +18,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-06-30" +channel = "nightly-2025-07-07" components = ["rust-src", "rustc-dev", "llvm-tools"] -# commit_hash = 35f6036521777bdc0dcea1f980be4c192962a168"#; +# commit_hash = a84ab0ce6c4557a2f01a3a6c3fdb0f92098db78d"#; fn rustc_output(arg: &str) -> Result> { let rustc = env::var("RUSTC").unwrap_or_else(|_| "rustc".into()); diff --git a/crates/rustc_codegen_spirv/src/builder_spirv.rs b/crates/rustc_codegen_spirv/src/builder_spirv.rs index e05b433057..ba8e01fd44 100644 --- a/crates/rustc_codegen_spirv/src/builder_spirv.rs +++ b/crates/rustc_codegen_spirv/src/builder_spirv.rs @@ -887,7 +887,7 @@ impl<'tcx> BuilderSpirv<'tcx> { FileName::Real(name) => { name.to_string_lossy(FileNameDisplayPreference::Remapped) } - _ => sf.name.prefer_remapped_unconditionaly().to_string().into(), + _ => sf.name.prefer_remapped_unconditionally().to_string().into(), }; let file_name = { // FIXME(eddyb) it should be possible to arena-allocate a diff --git a/crates/rustc_codegen_spirv/src/codegen_cx/constant.rs b/crates/rustc_codegen_spirv/src/codegen_cx/constant.rs index acd9b42172..a9ec6ad0f8 100644 --- a/crates/rustc_codegen_spirv/src/codegen_cx/constant.rs +++ b/crates/rustc_codegen_spirv/src/codegen_cx/constant.rs @@ -246,7 +246,7 @@ impl ConstCodegenMethods for CodegenCx<'_> { } } Scalar::Ptr(ptr, _) => { - let (prov, offset) = ptr.into_parts(); + let (prov, offset) = ptr.prov_and_relative_offset(); let alloc_id = prov.alloc_id(); let (base_addr, _base_addr_space) = match self.tcx.global_alloc(alloc_id) { GlobalAlloc::Memory(alloc) => { @@ -449,7 +449,7 @@ impl<'tcx> CodegenCx<'tcx> { .inner() .read_scalar(self, range, /* read_provenance */ true) { - let (prov, _offset) = ptr.into_parts(); + let (prov, _offset) = ptr.prov_and_relative_offset(); primitive = Primitive::Pointer( self.tcx.global_alloc(prov.alloc_id()).address_space(self), ); diff --git a/crates/rustc_codegen_spirv/src/lib.rs b/crates/rustc_codegen_spirv/src/lib.rs index 3e57d8648d..c88d4fcf39 100644 --- a/crates/rustc_codegen_spirv/src/lib.rs +++ b/crates/rustc_codegen_spirv/src/lib.rs @@ -547,8 +547,7 @@ impl ExtraBackendMethods for SpirvCodegenBackend { _sess: &Session, _opt_level: config::OptLevel, _target_features: &[String], - ) -> Arc<(dyn Fn(TargetMachineFactoryConfig) -> Result<(), String> + Send + Sync + 'static)> - { + ) -> Arc Result<(), String> + Send + Sync + 'static> { Arc::new(|_| Ok(())) } } diff --git a/rust-toolchain.toml b/rust-toolchain.toml index 06deb6d52d..0e0847c587 100644 --- a/rust-toolchain.toml +++ b/rust-toolchain.toml @@ -1,7 +1,7 @@ [toolchain] -channel = "nightly-2025-06-30" +channel = "nightly-2025-07-07" components = ["rust-src", "rustc-dev", "llvm-tools"] -# commit_hash = 35f6036521777bdc0dcea1f980be4c192962a168 +# commit_hash = a84ab0ce6c4557a2f01a3a6c3fdb0f92098db78d # Whenever changing the nightly channel, update the commit hash above, and # change `REQUIRED_RUST_TOOLCHAIN` in `crates/rustc_codegen_spirv/build.rs` too. From e3a060c6da916bee21888e68fcbc18b3c0a963fd Mon Sep 17 00:00:00 2001 From: Nicholas Nethercote Date: Tue, 30 Sep 2025 16:04:10 +1000 Subject: [PATCH 02/16] Update to `nightly-2025-07-14`. - `BuilderMethods::dynamic_alloca` was removed. - `TargetDataLayout::pointer_{size,align}` were changed from fields to methods. - `AddressSpace::DATA` was renamed `AddressSpace::ZERO`. --- crates/rustc_codegen_spirv/build.rs | 4 ++-- crates/rustc_codegen_spirv/src/abi.rs | 4 ++-- .../src/builder/builder_methods.rs | 4 ---- .../src/codegen_cx/constant.rs | 22 ++++++++++++++----- .../src/codegen_cx/type_.rs | 4 ++-- crates/rustc_codegen_spirv/src/spirv_type.rs | 4 ++-- rust-toolchain.toml | 4 ++-- 7 files changed, 27 insertions(+), 19 deletions(-) diff --git a/crates/rustc_codegen_spirv/build.rs b/crates/rustc_codegen_spirv/build.rs index 0e04d5f798..134b66f47e 100644 --- a/crates/rustc_codegen_spirv/build.rs +++ b/crates/rustc_codegen_spirv/build.rs @@ -18,9 +18,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-07-07" +channel = "nightly-2025-07-14" components = ["rust-src", "rustc-dev", "llvm-tools"] -# commit_hash = a84ab0ce6c4557a2f01a3a6c3fdb0f92098db78d"#; +# commit_hash = e9182f195b8505c87c4bd055b9f6e114ccda0981"#; fn rustc_output(arg: &str) -> Result> { let rustc = env::var("RUSTC").unwrap_or_else(|_| "rustc".into()); diff --git a/crates/rustc_codegen_spirv/src/abi.rs b/crates/rustc_codegen_spirv/src/abi.rs index 0c5cf69f4d..c42d64a518 100644 --- a/crates/rustc_codegen_spirv/src/abi.rs +++ b/crates/rustc_codegen_spirv/src/abi.rs @@ -791,7 +791,7 @@ fn trans_intrinsic_type<'tcx>( let sampled_type = match args.type_at(0).kind() { TyKind::Int(int) => match int { IntTy::Isize => { - SpirvType::Integer(cx.tcx.data_layout.pointer_size.bits() as u32, true) + SpirvType::Integer(cx.tcx.data_layout.pointer_size().bits() as u32, true) .def(span, cx) } IntTy::I8 => SpirvType::Integer(8, true).def(span, cx), @@ -802,7 +802,7 @@ fn trans_intrinsic_type<'tcx>( }, TyKind::Uint(uint) => match uint { UintTy::Usize => { - SpirvType::Integer(cx.tcx.data_layout.pointer_size.bits() as u32, false) + SpirvType::Integer(cx.tcx.data_layout.pointer_size().bits() as u32, false) .def(span, cx) } UintTy::U8 => SpirvType::Integer(8, false).def(span, cx), diff --git a/crates/rustc_codegen_spirv/src/builder/builder_methods.rs b/crates/rustc_codegen_spirv/src/builder/builder_methods.rs index e44fc1e25c..d780723dfa 100644 --- a/crates/rustc_codegen_spirv/src/builder/builder_methods.rs +++ b/crates/rustc_codegen_spirv/src/builder/builder_methods.rs @@ -1828,10 +1828,6 @@ impl<'a, 'tcx> BuilderMethods<'a, 'tcx> for Builder<'a, 'tcx> { self.declare_func_local_var(self.type_array(self.type_i8(), size.bytes()), align) } - fn dynamic_alloca(&mut self, _len: Self::Value, _align: Align) -> Self::Value { - self.fatal("dynamic alloca not supported yet") - } - fn load(&mut self, ty: Self::Type, ptr: Self::Value, _align: Align) -> Self::Value { let (ptr, access_ty) = self.adjust_pointer_for_typed_access(ptr, ty); let loaded_val = ptr.const_fold_load(self).unwrap_or_else(|| { diff --git a/crates/rustc_codegen_spirv/src/codegen_cx/constant.rs b/crates/rustc_codegen_spirv/src/codegen_cx/constant.rs index a9ec6ad0f8..3e3f97a48e 100644 --- a/crates/rustc_codegen_spirv/src/codegen_cx/constant.rs +++ b/crates/rustc_codegen_spirv/src/codegen_cx/constant.rs @@ -152,7 +152,7 @@ impl ConstCodegenMethods for CodegenCx<'_> { self.const_uint_big(ty, i) } fn const_usize(&self, i: u64) -> Self::Value { - let ptr_size = self.tcx.data_layout.pointer_size.bits() as u32; + let ptr_size = self.tcx.data_layout.pointer_size().bits() as u32; let t = SpirvType::Integer(ptr_size, false).def(DUMMY_SP, self); self.constant_int(t, i.into()) } @@ -263,7 +263,7 @@ impl ConstCodegenMethods for CodegenCx<'_> { .try_read_from_const_alloc(alloc, pointee) .unwrap_or_else(|| self.const_data_from_alloc(alloc)); let value = self.static_addr_of(init, alloc.inner().align, None); - (value, AddressSpace::DATA) + (value, AddressSpace::ZERO) } GlobalAlloc::Function { instance } => ( self.get_fn_addr(instance), @@ -292,12 +292,24 @@ impl ConstCodegenMethods for CodegenCx<'_> { .try_read_from_const_alloc(alloc, pointee) .unwrap_or_else(|| self.const_data_from_alloc(alloc)); let value = self.static_addr_of(init, alloc.inner().align, None); - (value, AddressSpace::DATA) + (value, AddressSpace::ZERO) } GlobalAlloc::Static(def_id) => { assert!(self.tcx.is_static(def_id)); assert!(!self.tcx.is_thread_local_static(def_id)); - (self.get_static(def_id), AddressSpace::DATA) + (self.get_static(def_id), AddressSpace::ZERO) + } + GlobalAlloc::TypeId { .. } => { + return if offset.bytes() == 0 { + self.constant_null(ty) + } else { + let result = self.undef(ty); + self.zombie_no_span( + result.def_cx(self), + "pointer has non-null integer address", + ); + result + }; } }; self.const_bitcast(self.const_ptr_byte_offset(base_addr, offset), ty) @@ -430,7 +442,7 @@ impl<'tcx> CodegenCx<'tcx> { .fatal(format!("invalid size for float: {other}")); } }), - SpirvType::Pointer { .. } => Primitive::Pointer(AddressSpace::DATA), + SpirvType::Pointer { .. } => Primitive::Pointer(AddressSpace::ZERO), _ => unreachable!(), }; diff --git a/crates/rustc_codegen_spirv/src/codegen_cx/type_.rs b/crates/rustc_codegen_spirv/src/codegen_cx/type_.rs index 6ed23ead89..be570c7015 100644 --- a/crates/rustc_codegen_spirv/src/codegen_cx/type_.rs +++ b/crates/rustc_codegen_spirv/src/codegen_cx/type_.rs @@ -124,7 +124,7 @@ impl<'tcx> LayoutTypeCodegenMethods<'tcx> for CodegenCx<'tcx> { impl<'tcx> CodegenCx<'tcx> { pub fn type_usize(&self) -> Word { - let ptr_size = self.tcx.data_layout.pointer_size.bits() as u32; + let ptr_size = self.tcx.data_layout.pointer_size().bits() as u32; SpirvType::Integer(ptr_size, false).def(DUMMY_SP, self) } } @@ -146,7 +146,7 @@ impl BaseTypeCodegenMethods for CodegenCx<'_> { SpirvType::Integer(128, false).def(DUMMY_SP, self) } fn type_isize(&self) -> Self::Type { - let ptr_size = self.tcx.data_layout.pointer_size.bits() as u32; + let ptr_size = self.tcx.data_layout.pointer_size().bits() as u32; SpirvType::Integer(ptr_size, false).def(DUMMY_SP, self) } diff --git a/crates/rustc_codegen_spirv/src/spirv_type.rs b/crates/rustc_codegen_spirv/src/spirv_type.rs index c2d85dcbac..30fa9327da 100644 --- a/crates/rustc_codegen_spirv/src/spirv_type.rs +++ b/crates/rustc_codegen_spirv/src/spirv_type.rs @@ -294,7 +294,7 @@ impl SpirvType<'_> { .try_into() .unwrap() } - Self::Pointer { .. } => cx.tcx.data_layout.pointer_size, + Self::Pointer { .. } => cx.tcx.data_layout.pointer_size(), Self::Image { .. } | Self::AccelerationStructureKhr | Self::RayQueryKhr @@ -316,7 +316,7 @@ impl SpirvType<'_> { Self::Array { element, .. } | Self::RuntimeArray { element } | Self::Matrix { element, .. } => cx.lookup_type(element).alignof(cx), - Self::Pointer { .. } => cx.tcx.data_layout.pointer_align.abi, + Self::Pointer { .. } => cx.tcx.data_layout.pointer_align().abi, Self::Image { .. } | Self::AccelerationStructureKhr | Self::RayQueryKhr diff --git a/rust-toolchain.toml b/rust-toolchain.toml index 0e0847c587..833f167631 100644 --- a/rust-toolchain.toml +++ b/rust-toolchain.toml @@ -1,7 +1,7 @@ [toolchain] -channel = "nightly-2025-07-07" +channel = "nightly-2025-07-14" components = ["rust-src", "rustc-dev", "llvm-tools"] -# commit_hash = a84ab0ce6c4557a2f01a3a6c3fdb0f92098db78d +# commit_hash = e9182f195b8505c87c4bd055b9f6e114ccda0981 # Whenever changing the nightly channel, update the commit hash above, and # change `REQUIRED_RUST_TOOLCHAIN` in `crates/rustc_codegen_spirv/build.rs` too. From 0e381815a6ada7fcd692dcb52e016a5f6e64c112 Mon Sep 17 00:00:00 2001 From: Nicholas Nethercote Date: Thu, 2 Oct 2025 09:28:23 +1000 Subject: [PATCH 03/16] Update to `nightly-2025-07-28`. - `run_fat_lto`, `optimize_fat`, and `autodiff` were merged into `run_and_optimize_fat_lto`, and the parameters were changed. - `run_thin_lto` parameters were changed. - `codegen` parameters were changed. - `LtoModuleCodegen` was removed. - Minor error message changes: - Some line number changes in rustc. - Some error message wording tweaks. The LTO changes occurred in rust-lang/rust PR 143388 and PR 144062. --- crates/rustc_codegen_spirv/build.rs | 4 +- crates/rustc_codegen_spirv/src/lib.rs | 38 ++++++---------- crates/rustc_codegen_spirv/src/link.rs | 8 ++-- rust-toolchain.toml | 4 +- .../ui/dis/ptr_copy.normal.stderr | 32 +++++++------- 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/spirv-attr/invalid-target.stderr | 44 +++++++++---------- 10 files changed, 63 insertions(+), 75 deletions(-) diff --git a/crates/rustc_codegen_spirv/build.rs b/crates/rustc_codegen_spirv/build.rs index 134b66f47e..c83e56ac85 100644 --- a/crates/rustc_codegen_spirv/build.rs +++ b/crates/rustc_codegen_spirv/build.rs @@ -18,9 +18,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-07-14" +channel = "nightly-2025-07-28" components = ["rust-src", "rustc-dev", "llvm-tools"] -# commit_hash = e9182f195b8505c87c4bd055b9f6e114ccda0981"#; +# commit_hash = f8e355c230c6eb7b78ffce6a92fd81f78c890524"#; fn rustc_output(arg: &str) -> Result> { let rustc = env::var("RUSTC").unwrap_or_else(|_| "rustc".into()); diff --git a/crates/rustc_codegen_spirv/src/lib.rs b/crates/rustc_codegen_spirv/src/lib.rs index c88d4fcf39..9f28a26a22 100644 --- a/crates/rustc_codegen_spirv/src/lib.rs +++ b/crates/rustc_codegen_spirv/src/lib.rs @@ -141,7 +141,7 @@ mod target_feature; use builder::Builder; use codegen_cx::CodegenCx; -use maybe_pqp_cg_ssa::back::lto::{LtoModuleCodegen, SerializedModule, ThinModule}; +use maybe_pqp_cg_ssa::back::lto::{SerializedModule, ThinModule}; use maybe_pqp_cg_ssa::back::write::{ CodegenContext, FatLtoInput, ModuleConfig, OngoingCodegen, TargetMachineFactoryConfig, }; @@ -170,7 +170,7 @@ use std::any::Any; use std::fs; use std::io::Cursor; use std::io::Write; -use std::path::Path; +use std::path::{Path, PathBuf}; use std::sync::Arc; use tracing::{error, warn}; @@ -333,7 +333,7 @@ impl WriteBackendMethods for SpirvCodegenBackend { type ThinBuffer = SpirvModuleBuffer; // FIXME(eddyb) reuse the "merge" stage of `crate::linker` for this, or even - // delegate to `run_fat_lto` (although `-Zcombine-cgu` is much more niche). + // delegate to `run_and_optimize_fat_lto` (although `-Zcombine-cgu` is much more niche). fn run_link( cgcx: &CodegenContext, diag_handler: DiagCtxtHandle<'_>, @@ -351,14 +351,16 @@ impl WriteBackendMethods for SpirvCodegenBackend { // consider setting `requires_lto = true` in the target specs and moving the // entirety of `crate::linker` into this stage (lacking diagnostics may be // an issue - it's surprising `CodegenBackend::link` has `Session` at all). - fn run_fat_lto( + fn run_and_optimize_fat_lto( cgcx: &CodegenContext, + _exported_symbols_for_lto: &[String], + _each_linked_rlib_for_lto: &[PathBuf], _modules: Vec>, - _cached_modules: Vec<(SerializedModule, WorkProduct)>, - ) -> Result, FatalError> { + _diff_fncs: Vec, + ) -> Result, FatalError> { assert!( cgcx.lto == rustc_session::config::Lto::Fat, - "`run_fat_lto` (for `WorkItemResult::NeedsFatLto`) should \ + "`run_and_optimize_fat_lto` (for `WorkItemResult::NeedsFatLto`) should \ only be invoked due to `-Clto` (or equivalent)" ); unreachable!("Rust-GPU does not support fat LTO") @@ -366,9 +368,12 @@ impl WriteBackendMethods for SpirvCodegenBackend { fn run_thin_lto( cgcx: &CodegenContext, + // FIXME(bjorn3): Limit LTO exports to these symbols + _exported_symbols_for_lto: &[String], + _each_linked_rlib_for_lto: &[PathBuf], // njn: ? modules: Vec<(String, Self::ThinBuffer)>, cached_modules: Vec<(SerializedModule, WorkProduct)>, - ) -> Result<(Vec>, Vec), FatalError> { + ) -> Result<(Vec>, Vec), FatalError> { link::run_thin(cgcx, modules, cached_modules) } @@ -409,16 +414,8 @@ impl WriteBackendMethods for SpirvCodegenBackend { Ok(module) } - fn optimize_fat( - cgcx: &CodegenContext, - module: &mut ModuleCodegen, - ) -> Result<(), FatalError> { - Self::optimize_common(cgcx, module) - } - fn codegen( cgcx: &CodegenContext, - _diag_handler: DiagCtxtHandle<'_>, module: ModuleCodegen, _config: &ModuleConfig, ) -> Result { @@ -457,15 +454,6 @@ impl WriteBackendMethods for SpirvCodegenBackend { SpirvModuleBuffer(module.module_llvm.assemble()), ) } - - fn autodiff( - _cgcx: &CodegenContext, - _module: &ModuleCodegen, - _diff_fncs: Vec, - _config: &ModuleConfig, - ) -> Result<(), FatalError> { - unreachable!("Rust-GPU does not support autodiff") - } } impl ExtraBackendMethods for SpirvCodegenBackend { diff --git a/crates/rustc_codegen_spirv/src/link.rs b/crates/rustc_codegen_spirv/src/link.rs index 30c45f433a..c99c5e6aa3 100644 --- a/crates/rustc_codegen_spirv/src/link.rs +++ b/crates/rustc_codegen_spirv/src/link.rs @@ -8,7 +8,7 @@ use rspirv::binary::Assemble; use rspirv::dr::Module; use rustc_ast::CRATE_NODE_ID; use rustc_codegen_spirv_types::{CompileResult, ModuleResult}; -use rustc_codegen_ssa::back::lto::{LtoModuleCodegen, SerializedModule, ThinModule, ThinShared}; +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; @@ -634,7 +634,7 @@ pub(crate) fn run_thin( cgcx: &CodegenContext, modules: Vec<(String, SpirvModuleBuffer)>, cached_modules: Vec<(SerializedModule, WorkProduct)>, -) -> Result<(Vec>, Vec), FatalError> { +) -> Result<(Vec>, Vec), FatalError> { if cgcx.opts.cg.linker_plugin_lto.enabled() { unreachable!("We should never reach this case if the LTO step is deferred to the linker"); } @@ -668,10 +668,10 @@ pub(crate) fn run_thin( let mut opt_jobs = vec![]; for (module_index, _) in shared.module_names.iter().enumerate() { - opt_jobs.push(LtoModuleCodegen::Thin(ThinModule { + opt_jobs.push(ThinModule { shared: shared.clone(), idx: module_index, - })); + }); } Ok((opt_jobs, vec![])) diff --git a/rust-toolchain.toml b/rust-toolchain.toml index 833f167631..54f82d0844 100644 --- a/rust-toolchain.toml +++ b/rust-toolchain.toml @@ -1,7 +1,7 @@ [toolchain] -channel = "nightly-2025-07-14" +channel = "nightly-2025-07-28" components = ["rust-src", "rustc-dev", "llvm-tools"] -# commit_hash = e9182f195b8505c87c4bd055b9f6e114ccda0981 +# commit_hash = f8e355c230c6eb7b78ffce6a92fd81f78c890524 # Whenever changing the nightly channel, update the commit hash above, and # change `REQUIRED_RUST_TOOLCHAIN` in `crates/rustc_codegen_spirv/build.rs` too. diff --git a/tests/compiletests/ui/dis/ptr_copy.normal.stderr b/tests/compiletests/ui/dis/ptr_copy.normal.stderr index c7db2ddf11..e8539e5d0f 100644 --- a/tests/compiletests/ui/dis/ptr_copy.normal.stderr +++ b/tests/compiletests/ui/dis/ptr_copy.normal.stderr @@ -1,13 +1,13 @@ error: cannot memcpy dynamically sized data - --> $CORE_SRC/ptr/mod.rs:633:9 + --> $CORE_SRC/ptr/mod.rs:638:9 | -633 | crate::intrinsics::copy(src, dst, count) +638 | crate::intrinsics::copy(src, dst, count) | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | note: used from within `core::ptr::copy::` - --> $CORE_SRC/ptr/mod.rs:618:21 + --> $CORE_SRC/ptr/mod.rs:623:21 | -618 | pub const unsafe fn copy(src: *const T, dst: *mut T, count: usize) { +623 | 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 @@ -28,25 +28,25 @@ note: called by `main` error: cannot cast between pointer types from `*f32` to `*struct () { }` - --> $CORE_SRC/ptr/mod.rs:621:9 + --> $CORE_SRC/ptr/mod.rs:626:9 | -621 | / ub_checks::assert_unsafe_precondition!( -622 | | check_language_ub, -623 | | "ptr::copy requires that both pointer arguments are aligned and non-null", +626 | / ub_checks::assert_unsafe_precondition!( +627 | | check_language_ub, +628 | | "ptr::copy requires that both pointer arguments are aligned and non-null", ... | -631 | | && ub_checks::maybe_is_aligned_and_not_null(dst, align, zero_size) -632 | | ); +636 | | && ub_checks::maybe_is_aligned_and_not_null(dst, align, zero_size) +637 | | ); | |_________^ | note: used from within `core::ptr::copy::` - --> $CORE_SRC/ptr/mod.rs:621:9 + --> $CORE_SRC/ptr/mod.rs:626:9 | -621 | / ub_checks::assert_unsafe_precondition!( -622 | | check_language_ub, -623 | | "ptr::copy requires that both pointer arguments are aligned and non-null", +626 | / ub_checks::assert_unsafe_precondition!( +627 | | check_language_ub, +628 | | "ptr::copy requires that both pointer arguments are aligned and non-null", ... | -631 | | && ub_checks::maybe_is_aligned_and_not_null(dst, align, zero_size) -632 | | ); +636 | | && ub_checks::maybe_is_aligned_and_not_null(dst, align, zero_size) +637 | | ); | |_________^ note: called by `ptr_copy::copy_via_raw_ptr` --> $DIR/ptr_copy.rs:28:18 diff --git a/tests/compiletests/ui/dis/ptr_read.stderr b/tests/compiletests/ui/dis/ptr_read.stderr index 87764b0941..93d0921375 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 1732 8 +OpLine %8 1737 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 87764b0941..93d0921375 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 1732 8 +OpLine %8 1737 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 26d592becb..e2075881c2 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 1932 8 +OpLine %11 1937 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 7b94da100b..3d539802b8 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 1932 8 +OpLine %11 1937 8 OpStore %6 %9 OpNoLine OpReturn diff --git a/tests/compiletests/ui/spirv-attr/invalid-target.stderr b/tests/compiletests/ui/spirv-attr/invalid-target.stderr index 78ae3de546..9a848bf39f 100644 --- a/tests/compiletests/ui/spirv-attr/invalid-target.stderr +++ b/tests/compiletests/ui/spirv-attr/invalid-target.stderr @@ -1030,67 +1030,67 @@ error: attribute is only valid on a function parameter, not on a struct field 170 | uniform, position, descriptor_set = 0, binding = 0, flat, invariant, // param-only | ^^^^^^^^^ -error: attribute is only valid on a struct, not on a implementation block +error: attribute is only valid on a struct, not on a inherent implementation block --> $DIR/invalid-target.rs:176:5 | 176 | sampler, block, sampled_image, generic_image_type, // struct-only | ^^^^^^^ -error: attribute is only valid on a struct, not on a implementation block +error: attribute is only valid on a struct, not on a inherent implementation block --> $DIR/invalid-target.rs:176:14 | 176 | sampler, block, sampled_image, generic_image_type, // struct-only | ^^^^^ -error: attribute is only valid on a struct, not on a implementation block +error: attribute is only valid on a struct, not on a inherent implementation block --> $DIR/invalid-target.rs:176:21 | 176 | sampler, block, sampled_image, generic_image_type, // struct-only | ^^^^^^^^^^^^^ -error: attribute is only valid on a struct, not on a implementation block +error: attribute is only valid on a struct, not on a inherent implementation block --> $DIR/invalid-target.rs:176:36 | 176 | sampler, block, sampled_image, generic_image_type, // struct-only | ^^^^^^^^^^^^^^^^^^ -error: attribute is only valid on a function, not on a implementation block +error: attribute is only valid on a function, not on a inherent implementation block --> $DIR/invalid-target.rs:177:5 | 177 | vertex, // fn-only | ^^^^^^ -error: attribute is only valid on a function parameter, not on a implementation block +error: attribute is only valid on a function parameter, not on a inherent implementation block --> $DIR/invalid-target.rs:178:5 | 178 | uniform, position, descriptor_set = 0, binding = 0, flat, invariant, // param-only | ^^^^^^^ -error: attribute is only valid on a function parameter, not on a implementation block +error: attribute is only valid on a function parameter, not on a inherent implementation block --> $DIR/invalid-target.rs:178:14 | 178 | uniform, position, descriptor_set = 0, binding = 0, flat, invariant, // param-only | ^^^^^^^^ -error: attribute is only valid on a function parameter, not on a implementation block +error: attribute is only valid on a function parameter, not on a inherent implementation block --> $DIR/invalid-target.rs:178:24 | 178 | uniform, position, descriptor_set = 0, binding = 0, flat, invariant, // param-only | ^^^^^^^^^^^^^^^^^^ -error: attribute is only valid on a function parameter, not on a implementation block +error: attribute is only valid on a function parameter, not on a inherent implementation block --> $DIR/invalid-target.rs:178:44 | 178 | uniform, position, descriptor_set = 0, binding = 0, flat, invariant, // param-only | ^^^^^^^^^^^ -error: attribute is only valid on a function parameter, not on a implementation block +error: attribute is only valid on a function parameter, not on a inherent implementation block --> $DIR/invalid-target.rs:178:57 | 178 | uniform, position, descriptor_set = 0, binding = 0, flat, invariant, // param-only | ^^^^ -error: attribute is only valid on a function parameter, not on a implementation block +error: attribute is only valid on a function parameter, not on a inherent implementation block --> $DIR/invalid-target.rs:178:63 | 178 | 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 205 | uniform, position, descriptor_set = 0, binding = 0, flat, invariant, // param-only | ^^^^^^^^^ -error: attribute is only valid on a struct, not on a implementation block +error: attribute is only valid on a struct, not on a trait implementation block --> $DIR/invalid-target.rs:237:5 | 237 | sampler, block, sampled_image, generic_image_type, // struct-only | ^^^^^^^ -error: attribute is only valid on a struct, not on a implementation block +error: attribute is only valid on a struct, not on a trait implementation block --> $DIR/invalid-target.rs:237:14 | 237 | sampler, block, sampled_image, generic_image_type, // struct-only | ^^^^^ -error: attribute is only valid on a struct, not on a implementation block +error: attribute is only valid on a struct, not on a trait implementation block --> $DIR/invalid-target.rs:237:21 | 237 | sampler, block, sampled_image, generic_image_type, // struct-only | ^^^^^^^^^^^^^ -error: attribute is only valid on a struct, not on a implementation block +error: attribute is only valid on a struct, not on a trait implementation block --> $DIR/invalid-target.rs:237:36 | 237 | sampler, block, sampled_image, generic_image_type, // struct-only | ^^^^^^^^^^^^^^^^^^ -error: attribute is only valid on a function, not on a implementation block +error: attribute is only valid on a function, not on a trait implementation block --> $DIR/invalid-target.rs:238:5 | 238 | vertex, // fn-only | ^^^^^^ -error: attribute is only valid on a function parameter, not on a implementation block +error: attribute is only valid on a function parameter, not on a trait implementation block --> $DIR/invalid-target.rs:239:5 | 239 | uniform, position, descriptor_set = 0, binding = 0, flat, invariant, // param-only | ^^^^^^^ -error: attribute is only valid on a function parameter, not on a implementation block +error: attribute is only valid on a function parameter, not on a trait implementation block --> $DIR/invalid-target.rs:239:14 | 239 | uniform, position, descriptor_set = 0, binding = 0, flat, invariant, // param-only | ^^^^^^^^ -error: attribute is only valid on a function parameter, not on a implementation block +error: attribute is only valid on a function parameter, not on a trait implementation block --> $DIR/invalid-target.rs:239:24 | 239 | uniform, position, descriptor_set = 0, binding = 0, flat, invariant, // param-only | ^^^^^^^^^^^^^^^^^^ -error: attribute is only valid on a function parameter, not on a implementation block +error: attribute is only valid on a function parameter, not on a trait implementation block --> $DIR/invalid-target.rs:239:44 | 239 | uniform, position, descriptor_set = 0, binding = 0, flat, invariant, // param-only | ^^^^^^^^^^^ -error: attribute is only valid on a function parameter, not on a implementation block +error: attribute is only valid on a function parameter, not on a trait implementation block --> $DIR/invalid-target.rs:239:57 | 239 | uniform, position, descriptor_set = 0, binding = 0, flat, invariant, // param-only | ^^^^ -error: attribute is only valid on a function parameter, not on a implementation block +error: attribute is only valid on a function parameter, not on a trait implementation block --> $DIR/invalid-target.rs:239:63 | 239 | uniform, position, descriptor_set = 0, binding = 0, flat, invariant, // param-only From 9727d5e720fa3b55e67395281cfe372f0518ee01 Mon Sep 17 00:00:00 2001 From: Nicholas Nethercote Date: Thu, 2 Oct 2025 11:41:33 +1000 Subject: [PATCH 04/16] Update to `nightly-2025-08-04`. - `tcx.get_attrs_unchecked(...)` was replaced with `tcx.get_all_attrs(...)`. - `run_link` has been removed. - `BuilderMethods::tail_call` was added. It's currently `todo!()`. - Adjust expected test outputs for very minor error message formatting changes. - And update to glam 0.30.8. --- crates/rustc_codegen_spirv/build.rs | 4 ++-- crates/rustc_codegen_spirv/src/abi.rs | 2 +- .../src/builder/builder_methods.rs | 13 +++++++++++ .../src/codegen_cx/declare.rs | 6 ++--- crates/rustc_codegen_spirv/src/lib.rs | 15 ------------- rust-toolchain.toml | 4 ++-- .../ui/arch/debug_printf_type_checking.stderr | 22 +++++++++---------- .../ui/dis/ptr_copy.normal.stderr | 12 +++++----- 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 +- tests/compiletests/ui/image/gather_err.stderr | 4 ++-- .../ui/image/query/query_levels_err.stderr | 2 +- .../ui/image/query/query_lod_err.stderr | 2 +- .../ui/image/query/query_size_err.stderr | 2 +- .../ui/image/query/query_size_lod_err.stderr | 2 +- 17 files changed, 48 insertions(+), 50 deletions(-) diff --git a/crates/rustc_codegen_spirv/build.rs b/crates/rustc_codegen_spirv/build.rs index c83e56ac85..3eec06cc9c 100644 --- a/crates/rustc_codegen_spirv/build.rs +++ b/crates/rustc_codegen_spirv/build.rs @@ -18,9 +18,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-07-28" +channel = "nightly-2025-08-04" components = ["rust-src", "rustc-dev", "llvm-tools"] -# commit_hash = f8e355c230c6eb7b78ffce6a92fd81f78c890524"#; +# commit_hash = f34ba774c78ea32b7c40598b8ad23e75cdac42a6"#; fn rustc_output(arg: &str) -> Result> { let rustc = env::var("RUSTC").unwrap_or_else(|_| "rustc".into()); diff --git a/crates/rustc_codegen_spirv/src/abi.rs b/crates/rustc_codegen_spirv/src/abi.rs index c42d64a518..bcfa0d86af 100644 --- a/crates/rustc_codegen_spirv/src/abi.rs +++ b/crates/rustc_codegen_spirv/src/abi.rs @@ -286,7 +286,7 @@ impl<'tcx> ConvSpirvType<'tcx> for TyAndLayout<'tcx> { span = cx.tcx.def_span(adt.did()); } - let attrs = AggregatedSpirvAttributes::parse(cx, cx.tcx.get_attrs_unchecked(adt.did())); + let attrs = AggregatedSpirvAttributes::parse(cx, cx.tcx.get_all_attrs(adt.did())); if let Some(intrinsic_type_attr) = attrs.intrinsic_type.map(|attr| attr.value) && let Ok(spirv_type) = diff --git a/crates/rustc_codegen_spirv/src/builder/builder_methods.rs b/crates/rustc_codegen_spirv/src/builder/builder_methods.rs index d780723dfa..9160ed9ce0 100644 --- a/crates/rustc_codegen_spirv/src/builder/builder_methods.rs +++ b/crates/rustc_codegen_spirv/src/builder/builder_methods.rs @@ -4160,6 +4160,19 @@ impl<'a, 'tcx> BuilderMethods<'a, 'tcx> for Builder<'a, 'tcx> { .with_type(result_type) } + fn tail_call( + &mut self, + _llty: Self::Type, + _fn_attrs: Option<&CodegenFnAttrs>, + _fn_abi: &FnAbi<'tcx, Ty<'tcx>>, + _llfn: Self::Value, + _args: &[Self::Value], + _funclet: Option<&Self::Funclet>, + _instance: Option>, + ) { + todo!() + } + fn zext(&mut self, val: Self::Value, dest_ty: Self::Type) -> Self::Value { self.intcast(val, dest_ty, false) } diff --git a/crates/rustc_codegen_spirv/src/codegen_cx/declare.rs b/crates/rustc_codegen_spirv/src/codegen_cx/declare.rs index af14f8b037..d6bf4b60be 100644 --- a/crates/rustc_codegen_spirv/src/codegen_cx/declare.rs +++ b/crates/rustc_codegen_spirv/src/codegen_cx/declare.rs @@ -10,8 +10,8 @@ use crate::spirv_type::SpirvType; use itertools::Itertools; use rspirv::spirv::{FunctionControl, LinkageType, StorageClass, Word}; use rustc_abi::Align; -use rustc_attr_data_structures::InlineAttr; use rustc_codegen_ssa::traits::{PreDefineCodegenMethods, StaticCodegenMethods}; +use rustc_hir::attrs::InlineAttr; use rustc_middle::bug; use rustc_middle::middle::codegen_fn_attrs::{CodegenFnAttrFlags, CodegenFnAttrs}; use rustc_middle::mir::mono::{Linkage, MonoItem, Visibility}; @@ -133,7 +133,7 @@ impl<'tcx> CodegenCx<'tcx> { self.set_linkage(fn_id, symbol_name.to_owned(), linkage); } - let attrs = AggregatedSpirvAttributes::parse(self, self.tcx.get_attrs_unchecked(def_id)); + let attrs = AggregatedSpirvAttributes::parse(self, self.tcx.get_all_attrs(def_id)); if let Some(entry) = attrs.entry.map(|attr| attr.value) { // HACK(eddyb) early insert to let `shader_entry_stub` call this // very function via `get_fn_addr`. @@ -167,7 +167,7 @@ impl<'tcx> CodegenCx<'tcx> { } // Check if this is a From trait implementation - if let Some(impl_def_id) = self.tcx.impl_of_method(def_id) + 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 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 9f28a26a22..61a2b3d3c2 100644 --- a/crates/rustc_codegen_spirv/src/lib.rs +++ b/crates/rustc_codegen_spirv/src/lib.rs @@ -332,21 +332,6 @@ impl WriteBackendMethods for SpirvCodegenBackend { type ThinData = (); type ThinBuffer = SpirvModuleBuffer; - // FIXME(eddyb) reuse the "merge" stage of `crate::linker` for this, or even - // delegate to `run_and_optimize_fat_lto` (although `-Zcombine-cgu` is much more niche). - fn run_link( - cgcx: &CodegenContext, - diag_handler: DiagCtxtHandle<'_>, - _modules: Vec>, - ) -> Result, FatalError> { - assert!( - cgcx.opts.unstable_opts.combine_cgu, - "`run_link` (for `WorkItemResult::NeedsLink`) should \ - only be invoked due to `-Zcombine-cgu`" - ); - diag_handler.fatal("Rust-GPU does not support `-Zcombine-cgu`") - } - // FIXME(eddyb) reuse the "merge" stage of `crate::linker` for this, or even // consider setting `requires_lto = true` in the target specs and moving the // entirety of `crate::linker` into this stage (lacking diagnostics may be diff --git a/rust-toolchain.toml b/rust-toolchain.toml index 54f82d0844..2dad704aad 100644 --- a/rust-toolchain.toml +++ b/rust-toolchain.toml @@ -1,7 +1,7 @@ [toolchain] -channel = "nightly-2025-07-28" +channel = "nightly-2025-08-04" components = ["rust-src", "rustc-dev", "llvm-tools"] -# commit_hash = f8e355c230c6eb7b78ffce6a92fd81f78c890524 +# commit_hash = f34ba774c78ea32b7c40598b8ad23e75cdac42a6 # Whenever changing the nightly channel, update the commit hash above, and # change `REQUIRED_RUST_TOOLCHAIN` in `crates/rustc_codegen_spirv/build.rs` too. diff --git a/tests/compiletests/ui/arch/debug_printf_type_checking.stderr b/tests/compiletests/ui/arch/debug_printf_type_checking.stderr index 6ec5956a55..d9815d7fc9 100644 --- a/tests/compiletests/ui/arch/debug_printf_type_checking.stderr +++ b/tests/compiletests/ui/arch/debug_printf_type_checking.stderr @@ -61,7 +61,7 @@ error: Unrecognised format specifier: 'r' error[E0308]: mismatched types --> $DIR/debug_printf_type_checking.rs:21:29 | -21 | debug_printf!("%f", 11_u32); + 21 | debug_printf!("%f", 11_u32); | --------------------^^^^^^- | | | | | expected `f32`, found `u32` @@ -70,7 +70,7 @@ error[E0308]: mismatched types help: the return type of this call is `u32` due to the type of the argument passed --> $DIR/debug_printf_type_checking.rs:21:9 | -21 | debug_printf!("%f", 11_u32); + 21 | debug_printf!("%f", 11_u32); | ^^^^^^^^^^^^^^^^^^^^------^ | | | this argument influences the return type of `debug_printf_assert_is_type` @@ -82,14 +82,14 @@ note: function defined here = note: this error originates in the macro `debug_printf` (in Nightly builds, run with -Z macro-backtrace for more info) help: change the type of the numeric literal from `u32` to `f32` | -21 - debug_printf!("%f", 11_u32); -21 + debug_printf!("%f", 11_f32); + 21 - debug_printf!("%f", 11_u32); + 21 + debug_printf!("%f", 11_f32); | error[E0308]: mismatched types --> $DIR/debug_printf_type_checking.rs:22:29 | -22 | debug_printf!("%u", 11.0_f32); + 22 | debug_printf!("%u", 11.0_f32); | --------------------^^^^^^^^- | | | | | expected `u32`, found `f32` @@ -98,7 +98,7 @@ error[E0308]: mismatched types help: the return type of this call is `f32` due to the type of the argument passed --> $DIR/debug_printf_type_checking.rs:22:9 | -22 | debug_printf!("%u", 11.0_f32); + 22 | debug_printf!("%u", 11.0_f32); | ^^^^^^^^^^^^^^^^^^^^--------^ | | | this argument influences the return type of `debug_printf_assert_is_type` @@ -110,14 +110,14 @@ note: function defined here = note: this error originates in the macro `debug_printf` (in Nightly builds, run with -Z macro-backtrace for more info) help: change the type of the numeric literal from `f32` to `u32` | -22 - debug_printf!("%u", 11.0_f32); -22 + debug_printf!("%u", 11u32); + 22 - debug_printf!("%u", 11.0_f32); + 22 + debug_printf!("%u", 11u32); | error[E0277]: the trait bound `{float}: Vector` is not satisfied --> $DIR/debug_printf_type_checking.rs:23:9 | -23 | debug_printf!("%v2f", 11.0); + 23 | debug_printf!("%v2f", 11.0); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `Vector` is not implemented for `{float}` | = help: the following other types implement trait `Vector`: @@ -143,7 +143,7 @@ note: required by a bound in `debug_printf_assert_is_vector` error[E0308]: mismatched types --> $DIR/debug_printf_type_checking.rs:24:29 | -24 | debug_printf!("%f", Vec2::splat(33.3)); + 24 | debug_printf!("%f", Vec2::splat(33.3)); | --------------------^^^^^^^^^^^^^^^^^- | | | | | expected `f32`, found `Vec2` @@ -152,7 +152,7 @@ error[E0308]: mismatched types help: the return type of this call is `Vec2` due to the type of the argument passed --> $DIR/debug_printf_type_checking.rs:24:9 | -24 | debug_printf!("%f", Vec2::splat(33.3)); + 24 | debug_printf!("%f", Vec2::splat(33.3)); | ^^^^^^^^^^^^^^^^^^^^-----------------^ | | | this argument influences the return type of `debug_printf_assert_is_type` diff --git a/tests/compiletests/ui/dis/ptr_copy.normal.stderr b/tests/compiletests/ui/dis/ptr_copy.normal.stderr index e8539e5d0f..b60fa81606 100644 --- a/tests/compiletests/ui/dis/ptr_copy.normal.stderr +++ b/tests/compiletests/ui/dis/ptr_copy.normal.stderr @@ -12,17 +12,17 @@ note: used from within `core::ptr::copy::` note: called by `ptr_copy::copy_via_raw_ptr` --> $DIR/ptr_copy.rs:28:18 | -28 | unsafe { core::ptr::copy(src, dst, 1) } + 28 | unsafe { core::ptr::copy(src, dst, 1) } | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ note: called by `ptr_copy::main` --> $DIR/ptr_copy.rs:33:5 | -33 | copy_via_raw_ptr(&i, o); + 33 | copy_via_raw_ptr(&i, o); | ^^^^^^^^^^^^^^^^^^^^^^^ note: called by `main` --> $DIR/ptr_copy.rs:32:8 | -32 | pub fn main(i: f32, o: &mut f32) { + 32 | pub fn main(i: f32, o: &mut f32) { | ^^^^ error: cannot cast between pointer types @@ -51,17 +51,17 @@ note: used from within `core::ptr::copy::` note: called by `ptr_copy::copy_via_raw_ptr` --> $DIR/ptr_copy.rs:28:18 | -28 | unsafe { core::ptr::copy(src, dst, 1) } + 28 | unsafe { core::ptr::copy(src, dst, 1) } | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ note: called by `ptr_copy::main` --> $DIR/ptr_copy.rs:33:5 | -33 | copy_via_raw_ptr(&i, o); + 33 | copy_via_raw_ptr(&i, o); | ^^^^^^^^^^^^^^^^^^^^^^^ note: called by `main` --> $DIR/ptr_copy.rs:32:8 | -32 | pub fn main(i: f32, o: &mut f32) { + 32 | pub fn main(i: f32, o: &mut f32) { | ^^^^ error: aborting due to 2 previous errors diff --git a/tests/compiletests/ui/dis/ptr_read.stderr b/tests/compiletests/ui/dis/ptr_read.stderr index 93d0921375..356ab80393 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 1737 8 +OpLine %8 1739 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 93d0921375..356ab80393 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 1737 8 +OpLine %8 1739 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 e2075881c2..6a82111894 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 1937 8 +OpLine %11 1939 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 3d539802b8..b882dca670 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 1937 8 +OpLine %11 1939 8 OpStore %6 %9 OpNoLine OpReturn diff --git a/tests/compiletests/ui/image/gather_err.stderr b/tests/compiletests/ui/image/gather_err.stderr index a2d0519500..4914b62d05 100644 --- a/tests/compiletests/ui/image/gather_err.stderr +++ b/tests/compiletests/ui/image/gather_err.stderr @@ -1,7 +1,7 @@ error[E0277]: the trait bound `Image: HasGather` is not satisfied --> $DIR/gather_err.rs:15:34 | -15 | let r1: glam::Vec4 = image1d.gather(*sampler, 0.0f32, 0); + 15 | let r1: glam::Vec4 = image1d.gather(*sampler, 0.0f32, 0); | ^^^^^^ the trait `HasGather` is not implemented for `Image` | = help: the following other types implement trait `HasGather`: @@ -20,7 +20,7 @@ note: required by a bound in `Image::: HasGather` is not satisfied --> $DIR/gather_err.rs:16:34 | -16 | let r2: glam::Vec4 = image3d.gather(*sampler, v3, 0); + 16 | let r2: glam::Vec4 = image3d.gather(*sampler, v3, 0); | ^^^^^^ the trait `HasGather` is not implemented for `Image` | = help: the following other types implement trait `HasGather`: diff --git a/tests/compiletests/ui/image/query/query_levels_err.stderr b/tests/compiletests/ui/image/query/query_levels_err.stderr index dd3220d9f3..ff5377bb1f 100644 --- a/tests/compiletests/ui/image/query/query_levels_err.stderr +++ b/tests/compiletests/ui/image/query/query_levels_err.stderr @@ -1,7 +1,7 @@ error[E0277]: the trait bound `Image: HasQueryLevels` is not satisfied --> $DIR/query_levels_err.rs:12:21 | -12 | *output = image.query_levels(); + 12 | *output = image.query_levels(); | ^^^^^^^^^^^^ the trait `HasQueryLevels` is not implemented for `Image` | = help: the following other types implement trait `HasQueryLevels`: diff --git a/tests/compiletests/ui/image/query/query_lod_err.stderr b/tests/compiletests/ui/image/query/query_lod_err.stderr index 868bab22da..b4cb52fea0 100644 --- a/tests/compiletests/ui/image/query/query_lod_err.stderr +++ b/tests/compiletests/ui/image/query/query_lod_err.stderr @@ -1,7 +1,7 @@ error[E0277]: the trait bound `Image: HasQueryLevels` is not satisfied --> $DIR/query_lod_err.rs:13:21 | -13 | *output = image.query_lod(*sampler, glam::Vec2::new(0.0, 1.0)); + 13 | *output = image.query_lod(*sampler, glam::Vec2::new(0.0, 1.0)); | ^^^^^^^^^ the trait `HasQueryLevels` is not implemented for `Image` | = help: the following other types implement trait `HasQueryLevels`: diff --git a/tests/compiletests/ui/image/query/query_size_err.stderr b/tests/compiletests/ui/image/query/query_size_err.stderr index cdbd9245f5..0750ee1785 100644 --- a/tests/compiletests/ui/image/query/query_size_err.stderr +++ b/tests/compiletests/ui/image/query/query_size_err.stderr @@ -1,7 +1,7 @@ error[E0277]: the trait bound `Image: HasQuerySize` is not satisfied --> $DIR/query_size_err.rs:12:21 | -12 | *output = image.query_size(); + 12 | *output = image.query_size(); | ^^^^^^^^^^ the trait `HasQuerySize` is not implemented for `Image` | = help: the following other types implement trait `HasQuerySize`: diff --git a/tests/compiletests/ui/image/query/query_size_lod_err.stderr b/tests/compiletests/ui/image/query/query_size_lod_err.stderr index 69662c8e79..21eae48bd6 100644 --- a/tests/compiletests/ui/image/query/query_size_lod_err.stderr +++ b/tests/compiletests/ui/image/query/query_size_lod_err.stderr @@ -1,7 +1,7 @@ error[E0277]: the trait bound `Image: HasQuerySizeLod` is not satisfied --> $DIR/query_size_lod_err.rs:12:21 | -12 | *output = image.query_size_lod(0); + 12 | *output = image.query_size_lod(0); | ^^^^^^^^^^^^^^ the trait `HasQuerySizeLod` is not implemented for `Image` | = help: the following other types implement trait `HasQuerySizeLod`: From 42dc34a0180fb660be9ccc5716730a6137df7456 Mon Sep 17 00:00:00 2001 From: David Palm Date: Wed, 5 Nov 2025 15:35:08 +0100 Subject: [PATCH 05/16] Update target specs to new format --- .../target-specs/spirv-unknown-opengl4.0.json | 48 +++++++++---------- .../target-specs/spirv-unknown-opengl4.1.json | 48 +++++++++---------- .../target-specs/spirv-unknown-opengl4.2.json | 48 +++++++++---------- .../target-specs/spirv-unknown-opengl4.3.json | 48 +++++++++---------- .../target-specs/spirv-unknown-opengl4.5.json | 48 +++++++++---------- .../target-specs/spirv-unknown-spv1.0.json | 48 +++++++++---------- .../target-specs/spirv-unknown-spv1.1.json | 48 +++++++++---------- .../target-specs/spirv-unknown-spv1.2.json | 48 +++++++++---------- .../target-specs/spirv-unknown-spv1.3.json | 48 +++++++++---------- .../target-specs/spirv-unknown-spv1.4.json | 48 +++++++++---------- .../target-specs/spirv-unknown-spv1.5.json | 48 +++++++++---------- .../target-specs/spirv-unknown-spv1.6.json | 48 +++++++++---------- .../target-specs/spirv-unknown-vulkan1.0.json | 48 +++++++++---------- .../target-specs/spirv-unknown-vulkan1.1.json | 48 +++++++++---------- .../spirv-unknown-vulkan1.1spv1.4.json | 48 +++++++++---------- .../target-specs/spirv-unknown-vulkan1.2.json | 48 +++++++++---------- .../target-specs/spirv-unknown-vulkan1.3.json | 48 +++++++++---------- .../target-specs/spirv-unknown-vulkan1.4.json | 48 +++++++++---------- 18 files changed, 432 insertions(+), 432 deletions(-) diff --git a/crates/rustc_codegen_spirv-target-specs/target-specs/spirv-unknown-opengl4.0.json b/crates/rustc_codegen_spirv-target-specs/target-specs/spirv-unknown-opengl4.0.json index d76e303e2a..a0057ac3b0 100644 --- a/crates/rustc_codegen_spirv-target-specs/target-specs/spirv-unknown-opengl4.0.json +++ b/crates/rustc_codegen_spirv-target-specs/target-specs/spirv-unknown-opengl4.0.json @@ -1,26 +1,26 @@ { - "allows-weak-linkage": false, - "arch": "spirv", - "crt-objects-fallback": "false", - "crt-static-allows-dylibs": true, - "crt-static-respected": true, - "data-layout": "e-m:e-p:32:32:32-i64:64-n8:16:32:64", - "dll-prefix": "", - "dll-suffix": ".spv.json", - "dynamic-linking": true, - "emit-debug-gdb-scripts": false, - "env": "opengl4.0", - "linker-flavor": "unix", - "linker-is-gnu": false, - "llvm-target": "spirv-unknown-opengl4.0", - "main-needs-argc-argv": false, - "metadata": { - "description": null, - "host_tools": null, - "std": null, - "tier": null - }, - "panic-strategy": "abort", - "simd-types-indirect": false, - "target-pointer-width": "32" + "allows-weak-linkage": false, + "arch": "spirv", + "crt-objects-fallback": "false", + "crt-static-allows-dylibs": true, + "crt-static-respected": true, + "data-layout": "e-m:e-p:32:32:32-i64:64-n8:16:32:64", + "dll-prefix": "", + "dll-suffix": ".spv.json", + "dynamic-linking": true, + "emit-debug-gdb-scripts": false, + "env": "opengl4.0", + "linker-flavor": "unix", + "linker-is-gnu": false, + "llvm-target": "spirv-unknown-opengl4.0", + "main-needs-argc-argv": false, + "metadata": { + "description": null, + "host_tools": null, + "std": null, + "tier": null + }, + "panic-strategy": "abort", + "simd-types-indirect": false, + "target-pointer-width": 32 } diff --git a/crates/rustc_codegen_spirv-target-specs/target-specs/spirv-unknown-opengl4.1.json b/crates/rustc_codegen_spirv-target-specs/target-specs/spirv-unknown-opengl4.1.json index 10eaa2f6ed..2d3b942449 100644 --- a/crates/rustc_codegen_spirv-target-specs/target-specs/spirv-unknown-opengl4.1.json +++ b/crates/rustc_codegen_spirv-target-specs/target-specs/spirv-unknown-opengl4.1.json @@ -1,26 +1,26 @@ { - "allows-weak-linkage": false, - "arch": "spirv", - "crt-objects-fallback": "false", - "crt-static-allows-dylibs": true, - "crt-static-respected": true, - "data-layout": "e-m:e-p:32:32:32-i64:64-n8:16:32:64", - "dll-prefix": "", - "dll-suffix": ".spv.json", - "dynamic-linking": true, - "emit-debug-gdb-scripts": false, - "env": "opengl4.1", - "linker-flavor": "unix", - "linker-is-gnu": false, - "llvm-target": "spirv-unknown-opengl4.1", - "main-needs-argc-argv": false, - "metadata": { - "description": null, - "host_tools": null, - "std": null, - "tier": null - }, - "panic-strategy": "abort", - "simd-types-indirect": false, - "target-pointer-width": "32" + "allows-weak-linkage": false, + "arch": "spirv", + "crt-objects-fallback": "false", + "crt-static-allows-dylibs": true, + "crt-static-respected": true, + "data-layout": "e-m:e-p:32:32:32-i64:64-n8:16:32:64", + "dll-prefix": "", + "dll-suffix": ".spv.json", + "dynamic-linking": true, + "emit-debug-gdb-scripts": false, + "env": "opengl4.1", + "linker-flavor": "unix", + "linker-is-gnu": false, + "llvm-target": "spirv-unknown-opengl4.1", + "main-needs-argc-argv": false, + "metadata": { + "description": null, + "host_tools": null, + "std": null, + "tier": null + }, + "panic-strategy": "abort", + "simd-types-indirect": false, + "target-pointer-width": 32 } diff --git a/crates/rustc_codegen_spirv-target-specs/target-specs/spirv-unknown-opengl4.2.json b/crates/rustc_codegen_spirv-target-specs/target-specs/spirv-unknown-opengl4.2.json index 9a8e14bced..15b1b92a6a 100644 --- a/crates/rustc_codegen_spirv-target-specs/target-specs/spirv-unknown-opengl4.2.json +++ b/crates/rustc_codegen_spirv-target-specs/target-specs/spirv-unknown-opengl4.2.json @@ -1,26 +1,26 @@ { - "allows-weak-linkage": false, - "arch": "spirv", - "crt-objects-fallback": "false", - "crt-static-allows-dylibs": true, - "crt-static-respected": true, - "data-layout": "e-m:e-p:32:32:32-i64:64-n8:16:32:64", - "dll-prefix": "", - "dll-suffix": ".spv.json", - "dynamic-linking": true, - "emit-debug-gdb-scripts": false, - "env": "opengl4.2", - "linker-flavor": "unix", - "linker-is-gnu": false, - "llvm-target": "spirv-unknown-opengl4.2", - "main-needs-argc-argv": false, - "metadata": { - "description": null, - "host_tools": null, - "std": null, - "tier": null - }, - "panic-strategy": "abort", - "simd-types-indirect": false, - "target-pointer-width": "32" + "allows-weak-linkage": false, + "arch": "spirv", + "crt-objects-fallback": "false", + "crt-static-allows-dylibs": true, + "crt-static-respected": true, + "data-layout": "e-m:e-p:32:32:32-i64:64-n8:16:32:64", + "dll-prefix": "", + "dll-suffix": ".spv.json", + "dynamic-linking": true, + "emit-debug-gdb-scripts": false, + "env": "opengl4.2", + "linker-flavor": "unix", + "linker-is-gnu": false, + "llvm-target": "spirv-unknown-opengl4.2", + "main-needs-argc-argv": false, + "metadata": { + "description": null, + "host_tools": null, + "std": null, + "tier": null + }, + "panic-strategy": "abort", + "simd-types-indirect": false, + "target-pointer-width": 32 } diff --git a/crates/rustc_codegen_spirv-target-specs/target-specs/spirv-unknown-opengl4.3.json b/crates/rustc_codegen_spirv-target-specs/target-specs/spirv-unknown-opengl4.3.json index a164073671..eee9577270 100644 --- a/crates/rustc_codegen_spirv-target-specs/target-specs/spirv-unknown-opengl4.3.json +++ b/crates/rustc_codegen_spirv-target-specs/target-specs/spirv-unknown-opengl4.3.json @@ -1,26 +1,26 @@ { - "allows-weak-linkage": false, - "arch": "spirv", - "crt-objects-fallback": "false", - "crt-static-allows-dylibs": true, - "crt-static-respected": true, - "data-layout": "e-m:e-p:32:32:32-i64:64-n8:16:32:64", - "dll-prefix": "", - "dll-suffix": ".spv.json", - "dynamic-linking": true, - "emit-debug-gdb-scripts": false, - "env": "opengl4.3", - "linker-flavor": "unix", - "linker-is-gnu": false, - "llvm-target": "spirv-unknown-opengl4.3", - "main-needs-argc-argv": false, - "metadata": { - "description": null, - "host_tools": null, - "std": null, - "tier": null - }, - "panic-strategy": "abort", - "simd-types-indirect": false, - "target-pointer-width": "32" + "allows-weak-linkage": false, + "arch": "spirv", + "crt-objects-fallback": "false", + "crt-static-allows-dylibs": true, + "crt-static-respected": true, + "data-layout": "e-m:e-p:32:32:32-i64:64-n8:16:32:64", + "dll-prefix": "", + "dll-suffix": ".spv.json", + "dynamic-linking": true, + "emit-debug-gdb-scripts": false, + "env": "opengl4.3", + "linker-flavor": "unix", + "linker-is-gnu": false, + "llvm-target": "spirv-unknown-opengl4.3", + "main-needs-argc-argv": false, + "metadata": { + "description": null, + "host_tools": null, + "std": null, + "tier": null + }, + "panic-strategy": "abort", + "simd-types-indirect": false, + "target-pointer-width": 32 } diff --git a/crates/rustc_codegen_spirv-target-specs/target-specs/spirv-unknown-opengl4.5.json b/crates/rustc_codegen_spirv-target-specs/target-specs/spirv-unknown-opengl4.5.json index 00d23b035d..bb10d76350 100644 --- a/crates/rustc_codegen_spirv-target-specs/target-specs/spirv-unknown-opengl4.5.json +++ b/crates/rustc_codegen_spirv-target-specs/target-specs/spirv-unknown-opengl4.5.json @@ -1,26 +1,26 @@ { - "allows-weak-linkage": false, - "arch": "spirv", - "crt-objects-fallback": "false", - "crt-static-allows-dylibs": true, - "crt-static-respected": true, - "data-layout": "e-m:e-p:32:32:32-i64:64-n8:16:32:64", - "dll-prefix": "", - "dll-suffix": ".spv.json", - "dynamic-linking": true, - "emit-debug-gdb-scripts": false, - "env": "opengl4.5", - "linker-flavor": "unix", - "linker-is-gnu": false, - "llvm-target": "spirv-unknown-opengl4.5", - "main-needs-argc-argv": false, - "metadata": { - "description": null, - "host_tools": null, - "std": null, - "tier": null - }, - "panic-strategy": "abort", - "simd-types-indirect": false, - "target-pointer-width": "32" + "allows-weak-linkage": false, + "arch": "spirv", + "crt-objects-fallback": "false", + "crt-static-allows-dylibs": true, + "crt-static-respected": true, + "data-layout": "e-m:e-p:32:32:32-i64:64-n8:16:32:64", + "dll-prefix": "", + "dll-suffix": ".spv.json", + "dynamic-linking": true, + "emit-debug-gdb-scripts": false, + "env": "opengl4.5", + "linker-flavor": "unix", + "linker-is-gnu": false, + "llvm-target": "spirv-unknown-opengl4.5", + "main-needs-argc-argv": false, + "metadata": { + "description": null, + "host_tools": null, + "std": null, + "tier": null + }, + "panic-strategy": "abort", + "simd-types-indirect": false, + "target-pointer-width": 32 } diff --git a/crates/rustc_codegen_spirv-target-specs/target-specs/spirv-unknown-spv1.0.json b/crates/rustc_codegen_spirv-target-specs/target-specs/spirv-unknown-spv1.0.json index b1f7f910c3..4913f81e77 100644 --- a/crates/rustc_codegen_spirv-target-specs/target-specs/spirv-unknown-spv1.0.json +++ b/crates/rustc_codegen_spirv-target-specs/target-specs/spirv-unknown-spv1.0.json @@ -1,26 +1,26 @@ { - "allows-weak-linkage": false, - "arch": "spirv", - "crt-objects-fallback": "false", - "crt-static-allows-dylibs": true, - "crt-static-respected": true, - "data-layout": "e-m:e-p:32:32:32-i64:64-n8:16:32:64", - "dll-prefix": "", - "dll-suffix": ".spv.json", - "dynamic-linking": true, - "emit-debug-gdb-scripts": false, - "env": "spv1.0", - "linker-flavor": "unix", - "linker-is-gnu": false, - "llvm-target": "spirv-unknown-spv1.0", - "main-needs-argc-argv": false, - "metadata": { - "description": null, - "host_tools": null, - "std": null, - "tier": null - }, - "panic-strategy": "abort", - "simd-types-indirect": false, - "target-pointer-width": "32" + "allows-weak-linkage": false, + "arch": "spirv", + "crt-objects-fallback": "false", + "crt-static-allows-dylibs": true, + "crt-static-respected": true, + "data-layout": "e-m:e-p:32:32:32-i64:64-n8:16:32:64", + "dll-prefix": "", + "dll-suffix": ".spv.json", + "dynamic-linking": true, + "emit-debug-gdb-scripts": false, + "env": "spv1.0", + "linker-flavor": "unix", + "linker-is-gnu": false, + "llvm-target": "spirv-unknown-spv1.0", + "main-needs-argc-argv": false, + "metadata": { + "description": null, + "host_tools": null, + "std": null, + "tier": null + }, + "panic-strategy": "abort", + "simd-types-indirect": false, + "target-pointer-width": 32 } diff --git a/crates/rustc_codegen_spirv-target-specs/target-specs/spirv-unknown-spv1.1.json b/crates/rustc_codegen_spirv-target-specs/target-specs/spirv-unknown-spv1.1.json index 4319c16514..ebb6135b64 100644 --- a/crates/rustc_codegen_spirv-target-specs/target-specs/spirv-unknown-spv1.1.json +++ b/crates/rustc_codegen_spirv-target-specs/target-specs/spirv-unknown-spv1.1.json @@ -1,26 +1,26 @@ { - "allows-weak-linkage": false, - "arch": "spirv", - "crt-objects-fallback": "false", - "crt-static-allows-dylibs": true, - "crt-static-respected": true, - "data-layout": "e-m:e-p:32:32:32-i64:64-n8:16:32:64", - "dll-prefix": "", - "dll-suffix": ".spv.json", - "dynamic-linking": true, - "emit-debug-gdb-scripts": false, - "env": "spv1.1", - "linker-flavor": "unix", - "linker-is-gnu": false, - "llvm-target": "spirv-unknown-spv1.1", - "main-needs-argc-argv": false, - "metadata": { - "description": null, - "host_tools": null, - "std": null, - "tier": null - }, - "panic-strategy": "abort", - "simd-types-indirect": false, - "target-pointer-width": "32" + "allows-weak-linkage": false, + "arch": "spirv", + "crt-objects-fallback": "false", + "crt-static-allows-dylibs": true, + "crt-static-respected": true, + "data-layout": "e-m:e-p:32:32:32-i64:64-n8:16:32:64", + "dll-prefix": "", + "dll-suffix": ".spv.json", + "dynamic-linking": true, + "emit-debug-gdb-scripts": false, + "env": "spv1.1", + "linker-flavor": "unix", + "linker-is-gnu": false, + "llvm-target": "spirv-unknown-spv1.1", + "main-needs-argc-argv": false, + "metadata": { + "description": null, + "host_tools": null, + "std": null, + "tier": null + }, + "panic-strategy": "abort", + "simd-types-indirect": false, + "target-pointer-width": 32 } diff --git a/crates/rustc_codegen_spirv-target-specs/target-specs/spirv-unknown-spv1.2.json b/crates/rustc_codegen_spirv-target-specs/target-specs/spirv-unknown-spv1.2.json index 43a4ec9bd8..3b961850fa 100644 --- a/crates/rustc_codegen_spirv-target-specs/target-specs/spirv-unknown-spv1.2.json +++ b/crates/rustc_codegen_spirv-target-specs/target-specs/spirv-unknown-spv1.2.json @@ -1,26 +1,26 @@ { - "allows-weak-linkage": false, - "arch": "spirv", - "crt-objects-fallback": "false", - "crt-static-allows-dylibs": true, - "crt-static-respected": true, - "data-layout": "e-m:e-p:32:32:32-i64:64-n8:16:32:64", - "dll-prefix": "", - "dll-suffix": ".spv.json", - "dynamic-linking": true, - "emit-debug-gdb-scripts": false, - "env": "spv1.2", - "linker-flavor": "unix", - "linker-is-gnu": false, - "llvm-target": "spirv-unknown-spv1.2", - "main-needs-argc-argv": false, - "metadata": { - "description": null, - "host_tools": null, - "std": null, - "tier": null - }, - "panic-strategy": "abort", - "simd-types-indirect": false, - "target-pointer-width": "32" + "allows-weak-linkage": false, + "arch": "spirv", + "crt-objects-fallback": "false", + "crt-static-allows-dylibs": true, + "crt-static-respected": true, + "data-layout": "e-m:e-p:32:32:32-i64:64-n8:16:32:64", + "dll-prefix": "", + "dll-suffix": ".spv.json", + "dynamic-linking": true, + "emit-debug-gdb-scripts": false, + "env": "spv1.2", + "linker-flavor": "unix", + "linker-is-gnu": false, + "llvm-target": "spirv-unknown-spv1.2", + "main-needs-argc-argv": false, + "metadata": { + "description": null, + "host_tools": null, + "std": null, + "tier": null + }, + "panic-strategy": "abort", + "simd-types-indirect": false, + "target-pointer-width": 32 } diff --git a/crates/rustc_codegen_spirv-target-specs/target-specs/spirv-unknown-spv1.3.json b/crates/rustc_codegen_spirv-target-specs/target-specs/spirv-unknown-spv1.3.json index 3903cdba51..aead4bacc2 100644 --- a/crates/rustc_codegen_spirv-target-specs/target-specs/spirv-unknown-spv1.3.json +++ b/crates/rustc_codegen_spirv-target-specs/target-specs/spirv-unknown-spv1.3.json @@ -1,26 +1,26 @@ { - "allows-weak-linkage": false, - "arch": "spirv", - "crt-objects-fallback": "false", - "crt-static-allows-dylibs": true, - "crt-static-respected": true, - "data-layout": "e-m:e-p:32:32:32-i64:64-n8:16:32:64", - "dll-prefix": "", - "dll-suffix": ".spv.json", - "dynamic-linking": true, - "emit-debug-gdb-scripts": false, - "env": "spv1.3", - "linker-flavor": "unix", - "linker-is-gnu": false, - "llvm-target": "spirv-unknown-spv1.3", - "main-needs-argc-argv": false, - "metadata": { - "description": null, - "host_tools": null, - "std": null, - "tier": null - }, - "panic-strategy": "abort", - "simd-types-indirect": false, - "target-pointer-width": "32" + "allows-weak-linkage": false, + "arch": "spirv", + "crt-objects-fallback": "false", + "crt-static-allows-dylibs": true, + "crt-static-respected": true, + "data-layout": "e-m:e-p:32:32:32-i64:64-n8:16:32:64", + "dll-prefix": "", + "dll-suffix": ".spv.json", + "dynamic-linking": true, + "emit-debug-gdb-scripts": false, + "env": "spv1.3", + "linker-flavor": "unix", + "linker-is-gnu": false, + "llvm-target": "spirv-unknown-spv1.3", + "main-needs-argc-argv": false, + "metadata": { + "description": null, + "host_tools": null, + "std": null, + "tier": null + }, + "panic-strategy": "abort", + "simd-types-indirect": false, + "target-pointer-width": 32 } diff --git a/crates/rustc_codegen_spirv-target-specs/target-specs/spirv-unknown-spv1.4.json b/crates/rustc_codegen_spirv-target-specs/target-specs/spirv-unknown-spv1.4.json index a645839c76..afcefb39d3 100644 --- a/crates/rustc_codegen_spirv-target-specs/target-specs/spirv-unknown-spv1.4.json +++ b/crates/rustc_codegen_spirv-target-specs/target-specs/spirv-unknown-spv1.4.json @@ -1,26 +1,26 @@ { - "allows-weak-linkage": false, - "arch": "spirv", - "crt-objects-fallback": "false", - "crt-static-allows-dylibs": true, - "crt-static-respected": true, - "data-layout": "e-m:e-p:32:32:32-i64:64-n8:16:32:64", - "dll-prefix": "", - "dll-suffix": ".spv.json", - "dynamic-linking": true, - "emit-debug-gdb-scripts": false, - "env": "spv1.4", - "linker-flavor": "unix", - "linker-is-gnu": false, - "llvm-target": "spirv-unknown-spv1.4", - "main-needs-argc-argv": false, - "metadata": { - "description": null, - "host_tools": null, - "std": null, - "tier": null - }, - "panic-strategy": "abort", - "simd-types-indirect": false, - "target-pointer-width": "32" + "allows-weak-linkage": false, + "arch": "spirv", + "crt-objects-fallback": "false", + "crt-static-allows-dylibs": true, + "crt-static-respected": true, + "data-layout": "e-m:e-p:32:32:32-i64:64-n8:16:32:64", + "dll-prefix": "", + "dll-suffix": ".spv.json", + "dynamic-linking": true, + "emit-debug-gdb-scripts": false, + "env": "spv1.4", + "linker-flavor": "unix", + "linker-is-gnu": false, + "llvm-target": "spirv-unknown-spv1.4", + "main-needs-argc-argv": false, + "metadata": { + "description": null, + "host_tools": null, + "std": null, + "tier": null + }, + "panic-strategy": "abort", + "simd-types-indirect": false, + "target-pointer-width": 32 } diff --git a/crates/rustc_codegen_spirv-target-specs/target-specs/spirv-unknown-spv1.5.json b/crates/rustc_codegen_spirv-target-specs/target-specs/spirv-unknown-spv1.5.json index 67a2fb375f..5b310ca756 100644 --- a/crates/rustc_codegen_spirv-target-specs/target-specs/spirv-unknown-spv1.5.json +++ b/crates/rustc_codegen_spirv-target-specs/target-specs/spirv-unknown-spv1.5.json @@ -1,26 +1,26 @@ { - "allows-weak-linkage": false, - "arch": "spirv", - "crt-objects-fallback": "false", - "crt-static-allows-dylibs": true, - "crt-static-respected": true, - "data-layout": "e-m:e-p:32:32:32-i64:64-n8:16:32:64", - "dll-prefix": "", - "dll-suffix": ".spv.json", - "dynamic-linking": true, - "emit-debug-gdb-scripts": false, - "env": "spv1.5", - "linker-flavor": "unix", - "linker-is-gnu": false, - "llvm-target": "spirv-unknown-spv1.5", - "main-needs-argc-argv": false, - "metadata": { - "description": null, - "host_tools": null, - "std": null, - "tier": null - }, - "panic-strategy": "abort", - "simd-types-indirect": false, - "target-pointer-width": "32" + "allows-weak-linkage": false, + "arch": "spirv", + "crt-objects-fallback": "false", + "crt-static-allows-dylibs": true, + "crt-static-respected": true, + "data-layout": "e-m:e-p:32:32:32-i64:64-n8:16:32:64", + "dll-prefix": "", + "dll-suffix": ".spv.json", + "dynamic-linking": true, + "emit-debug-gdb-scripts": false, + "env": "spv1.5", + "linker-flavor": "unix", + "linker-is-gnu": false, + "llvm-target": "spirv-unknown-spv1.5", + "main-needs-argc-argv": false, + "metadata": { + "description": null, + "host_tools": null, + "std": null, + "tier": null + }, + "panic-strategy": "abort", + "simd-types-indirect": false, + "target-pointer-width": 32 } diff --git a/crates/rustc_codegen_spirv-target-specs/target-specs/spirv-unknown-spv1.6.json b/crates/rustc_codegen_spirv-target-specs/target-specs/spirv-unknown-spv1.6.json index 0208756e96..5747ac398e 100644 --- a/crates/rustc_codegen_spirv-target-specs/target-specs/spirv-unknown-spv1.6.json +++ b/crates/rustc_codegen_spirv-target-specs/target-specs/spirv-unknown-spv1.6.json @@ -1,26 +1,26 @@ { - "allows-weak-linkage": false, - "arch": "spirv", - "crt-objects-fallback": "false", - "crt-static-allows-dylibs": true, - "crt-static-respected": true, - "data-layout": "e-m:e-p:32:32:32-i64:64-n8:16:32:64", - "dll-prefix": "", - "dll-suffix": ".spv.json", - "dynamic-linking": true, - "emit-debug-gdb-scripts": false, - "env": "spv1.6", - "linker-flavor": "unix", - "linker-is-gnu": false, - "llvm-target": "spirv-unknown-spv1.6", - "main-needs-argc-argv": false, - "metadata": { - "description": null, - "host_tools": null, - "std": null, - "tier": null - }, - "panic-strategy": "abort", - "simd-types-indirect": false, - "target-pointer-width": "32" + "allows-weak-linkage": false, + "arch": "spirv", + "crt-objects-fallback": "false", + "crt-static-allows-dylibs": true, + "crt-static-respected": true, + "data-layout": "e-m:e-p:32:32:32-i64:64-n8:16:32:64", + "dll-prefix": "", + "dll-suffix": ".spv.json", + "dynamic-linking": true, + "emit-debug-gdb-scripts": false, + "env": "spv1.6", + "linker-flavor": "unix", + "linker-is-gnu": false, + "llvm-target": "spirv-unknown-spv1.6", + "main-needs-argc-argv": false, + "metadata": { + "description": null, + "host_tools": null, + "std": null, + "tier": null + }, + "panic-strategy": "abort", + "simd-types-indirect": false, + "target-pointer-width": 32 } diff --git a/crates/rustc_codegen_spirv-target-specs/target-specs/spirv-unknown-vulkan1.0.json b/crates/rustc_codegen_spirv-target-specs/target-specs/spirv-unknown-vulkan1.0.json index 468d7e6049..e448766123 100644 --- a/crates/rustc_codegen_spirv-target-specs/target-specs/spirv-unknown-vulkan1.0.json +++ b/crates/rustc_codegen_spirv-target-specs/target-specs/spirv-unknown-vulkan1.0.json @@ -1,26 +1,26 @@ { - "allows-weak-linkage": false, - "arch": "spirv", - "crt-objects-fallback": "false", - "crt-static-allows-dylibs": true, - "crt-static-respected": true, - "data-layout": "e-m:e-p:32:32:32-i64:64-n8:16:32:64", - "dll-prefix": "", - "dll-suffix": ".spv.json", - "dynamic-linking": true, - "emit-debug-gdb-scripts": false, - "env": "vulkan1.0", - "linker-flavor": "unix", - "linker-is-gnu": false, - "llvm-target": "spirv-unknown-vulkan1.0", - "main-needs-argc-argv": false, - "metadata": { - "description": null, - "host_tools": null, - "std": null, - "tier": null - }, - "panic-strategy": "abort", - "simd-types-indirect": false, - "target-pointer-width": "32" + "allows-weak-linkage": false, + "arch": "spirv", + "crt-objects-fallback": "false", + "crt-static-allows-dylibs": true, + "crt-static-respected": true, + "data-layout": "e-m:e-p:32:32:32-i64:64-n8:16:32:64", + "dll-prefix": "", + "dll-suffix": ".spv.json", + "dynamic-linking": true, + "emit-debug-gdb-scripts": false, + "env": "vulkan1.0", + "linker-flavor": "unix", + "linker-is-gnu": false, + "llvm-target": "spirv-unknown-vulkan1.0", + "main-needs-argc-argv": false, + "metadata": { + "description": null, + "host_tools": null, + "std": null, + "tier": null + }, + "panic-strategy": "abort", + "simd-types-indirect": false, + "target-pointer-width": 32 } diff --git a/crates/rustc_codegen_spirv-target-specs/target-specs/spirv-unknown-vulkan1.1.json b/crates/rustc_codegen_spirv-target-specs/target-specs/spirv-unknown-vulkan1.1.json index b75eaa7dd9..ffff84fa6d 100644 --- a/crates/rustc_codegen_spirv-target-specs/target-specs/spirv-unknown-vulkan1.1.json +++ b/crates/rustc_codegen_spirv-target-specs/target-specs/spirv-unknown-vulkan1.1.json @@ -1,26 +1,26 @@ { - "allows-weak-linkage": false, - "arch": "spirv", - "crt-objects-fallback": "false", - "crt-static-allows-dylibs": true, - "crt-static-respected": true, - "data-layout": "e-m:e-p:32:32:32-i64:64-n8:16:32:64", - "dll-prefix": "", - "dll-suffix": ".spv.json", - "dynamic-linking": true, - "emit-debug-gdb-scripts": false, - "env": "vulkan1.1", - "linker-flavor": "unix", - "linker-is-gnu": false, - "llvm-target": "spirv-unknown-vulkan1.1", - "main-needs-argc-argv": false, - "metadata": { - "description": null, - "host_tools": null, - "std": null, - "tier": null - }, - "panic-strategy": "abort", - "simd-types-indirect": false, - "target-pointer-width": "32" + "allows-weak-linkage": false, + "arch": "spirv", + "crt-objects-fallback": "false", + "crt-static-allows-dylibs": true, + "crt-static-respected": true, + "data-layout": "e-m:e-p:32:32:32-i64:64-n8:16:32:64", + "dll-prefix": "", + "dll-suffix": ".spv.json", + "dynamic-linking": true, + "emit-debug-gdb-scripts": false, + "env": "vulkan1.1", + "linker-flavor": "unix", + "linker-is-gnu": false, + "llvm-target": "spirv-unknown-vulkan1.1", + "main-needs-argc-argv": false, + "metadata": { + "description": null, + "host_tools": null, + "std": null, + "tier": null + }, + "panic-strategy": "abort", + "simd-types-indirect": false, + "target-pointer-width": 32 } diff --git a/crates/rustc_codegen_spirv-target-specs/target-specs/spirv-unknown-vulkan1.1spv1.4.json b/crates/rustc_codegen_spirv-target-specs/target-specs/spirv-unknown-vulkan1.1spv1.4.json index 66eaba431b..c804bbd55a 100644 --- a/crates/rustc_codegen_spirv-target-specs/target-specs/spirv-unknown-vulkan1.1spv1.4.json +++ b/crates/rustc_codegen_spirv-target-specs/target-specs/spirv-unknown-vulkan1.1spv1.4.json @@ -1,26 +1,26 @@ { - "allows-weak-linkage": false, - "arch": "spirv", - "crt-objects-fallback": "false", - "crt-static-allows-dylibs": true, - "crt-static-respected": true, - "data-layout": "e-m:e-p:32:32:32-i64:64-n8:16:32:64", - "dll-prefix": "", - "dll-suffix": ".spv.json", - "dynamic-linking": true, - "emit-debug-gdb-scripts": false, - "env": "vulkan1.1spv1.4", - "linker-flavor": "unix", - "linker-is-gnu": false, - "llvm-target": "spirv-unknown-vulkan1.1spv1.4", - "main-needs-argc-argv": false, - "metadata": { - "description": null, - "host_tools": null, - "std": null, - "tier": null - }, - "panic-strategy": "abort", - "simd-types-indirect": false, - "target-pointer-width": "32" + "allows-weak-linkage": false, + "arch": "spirv", + "crt-objects-fallback": "false", + "crt-static-allows-dylibs": true, + "crt-static-respected": true, + "data-layout": "e-m:e-p:32:32:32-i64:64-n8:16:32:64", + "dll-prefix": "", + "dll-suffix": ".spv.json", + "dynamic-linking": true, + "emit-debug-gdb-scripts": false, + "env": "vulkan1.1spv1.4", + "linker-flavor": "unix", + "linker-is-gnu": false, + "llvm-target": "spirv-unknown-vulkan1.1spv1.4", + "main-needs-argc-argv": false, + "metadata": { + "description": null, + "host_tools": null, + "std": null, + "tier": null + }, + "panic-strategy": "abort", + "simd-types-indirect": false, + "target-pointer-width": 32 } diff --git a/crates/rustc_codegen_spirv-target-specs/target-specs/spirv-unknown-vulkan1.2.json b/crates/rustc_codegen_spirv-target-specs/target-specs/spirv-unknown-vulkan1.2.json index 34032c502a..de77e0e531 100644 --- a/crates/rustc_codegen_spirv-target-specs/target-specs/spirv-unknown-vulkan1.2.json +++ b/crates/rustc_codegen_spirv-target-specs/target-specs/spirv-unknown-vulkan1.2.json @@ -1,26 +1,26 @@ { - "allows-weak-linkage": false, - "arch": "spirv", - "crt-objects-fallback": "false", - "crt-static-allows-dylibs": true, - "crt-static-respected": true, - "data-layout": "e-m:e-p:32:32:32-i64:64-n8:16:32:64", - "dll-prefix": "", - "dll-suffix": ".spv.json", - "dynamic-linking": true, - "emit-debug-gdb-scripts": false, - "env": "vulkan1.2", - "linker-flavor": "unix", - "linker-is-gnu": false, - "llvm-target": "spirv-unknown-vulkan1.2", - "main-needs-argc-argv": false, - "metadata": { - "description": null, - "host_tools": null, - "std": null, - "tier": null - }, - "panic-strategy": "abort", - "simd-types-indirect": false, - "target-pointer-width": "32" + "allows-weak-linkage": false, + "arch": "spirv", + "crt-objects-fallback": "false", + "crt-static-allows-dylibs": true, + "crt-static-respected": true, + "data-layout": "e-m:e-p:32:32:32-i64:64-n8:16:32:64", + "dll-prefix": "", + "dll-suffix": ".spv.json", + "dynamic-linking": true, + "emit-debug-gdb-scripts": false, + "env": "vulkan1.2", + "linker-flavor": "unix", + "linker-is-gnu": false, + "llvm-target": "spirv-unknown-vulkan1.2", + "main-needs-argc-argv": false, + "metadata": { + "description": null, + "host_tools": null, + "std": null, + "tier": null + }, + "panic-strategy": "abort", + "simd-types-indirect": false, + "target-pointer-width": 32 } diff --git a/crates/rustc_codegen_spirv-target-specs/target-specs/spirv-unknown-vulkan1.3.json b/crates/rustc_codegen_spirv-target-specs/target-specs/spirv-unknown-vulkan1.3.json index ef4d7c2726..5d3853afd2 100644 --- a/crates/rustc_codegen_spirv-target-specs/target-specs/spirv-unknown-vulkan1.3.json +++ b/crates/rustc_codegen_spirv-target-specs/target-specs/spirv-unknown-vulkan1.3.json @@ -1,26 +1,26 @@ { - "allows-weak-linkage": false, - "arch": "spirv", - "crt-objects-fallback": "false", - "crt-static-allows-dylibs": true, - "crt-static-respected": true, - "data-layout": "e-m:e-p:32:32:32-i64:64-n8:16:32:64", - "dll-prefix": "", - "dll-suffix": ".spv.json", - "dynamic-linking": true, - "emit-debug-gdb-scripts": false, - "env": "vulkan1.3", - "linker-flavor": "unix", - "linker-is-gnu": false, - "llvm-target": "spirv-unknown-vulkan1.3", - "main-needs-argc-argv": false, - "metadata": { - "description": null, - "host_tools": null, - "std": null, - "tier": null - }, - "panic-strategy": "abort", - "simd-types-indirect": false, - "target-pointer-width": "32" + "allows-weak-linkage": false, + "arch": "spirv", + "crt-objects-fallback": "false", + "crt-static-allows-dylibs": true, + "crt-static-respected": true, + "data-layout": "e-m:e-p:32:32:32-i64:64-n8:16:32:64", + "dll-prefix": "", + "dll-suffix": ".spv.json", + "dynamic-linking": true, + "emit-debug-gdb-scripts": false, + "env": "vulkan1.3", + "linker-flavor": "unix", + "linker-is-gnu": false, + "llvm-target": "spirv-unknown-vulkan1.3", + "main-needs-argc-argv": false, + "metadata": { + "description": null, + "host_tools": null, + "std": null, + "tier": null + }, + "panic-strategy": "abort", + "simd-types-indirect": false, + "target-pointer-width": 32 } diff --git a/crates/rustc_codegen_spirv-target-specs/target-specs/spirv-unknown-vulkan1.4.json b/crates/rustc_codegen_spirv-target-specs/target-specs/spirv-unknown-vulkan1.4.json index f2b4d8ad37..08f3dfff7f 100644 --- a/crates/rustc_codegen_spirv-target-specs/target-specs/spirv-unknown-vulkan1.4.json +++ b/crates/rustc_codegen_spirv-target-specs/target-specs/spirv-unknown-vulkan1.4.json @@ -1,26 +1,26 @@ { - "allows-weak-linkage": false, - "arch": "spirv", - "crt-objects-fallback": "false", - "crt-static-allows-dylibs": true, - "crt-static-respected": true, - "data-layout": "e-m:e-p:32:32:32-i64:64-n8:16:32:64", - "dll-prefix": "", - "dll-suffix": ".spv.json", - "dynamic-linking": true, - "emit-debug-gdb-scripts": false, - "env": "vulkan1.4", - "linker-flavor": "unix", - "linker-is-gnu": false, - "llvm-target": "spirv-unknown-vulkan1.4", - "main-needs-argc-argv": false, - "metadata": { - "description": null, - "host_tools": null, - "std": null, - "tier": null - }, - "panic-strategy": "abort", - "simd-types-indirect": false, - "target-pointer-width": "32" + "allows-weak-linkage": false, + "arch": "spirv", + "crt-objects-fallback": "false", + "crt-static-allows-dylibs": true, + "crt-static-respected": true, + "data-layout": "e-m:e-p:32:32:32-i64:64-n8:16:32:64", + "dll-prefix": "", + "dll-suffix": ".spv.json", + "dynamic-linking": true, + "emit-debug-gdb-scripts": false, + "env": "vulkan1.4", + "linker-flavor": "unix", + "linker-is-gnu": false, + "llvm-target": "spirv-unknown-vulkan1.4", + "main-needs-argc-argv": false, + "metadata": { + "description": null, + "host_tools": null, + "std": null, + "tier": null + }, + "panic-strategy": "abort", + "simd-types-indirect": false, + "target-pointer-width": 32 } From 86f76be8f4f12399008dcd012c45ccc0ccd98f84 Mon Sep 17 00:00:00 2001 From: David Palm Date: Wed, 5 Nov 2025 15:35:32 +0100 Subject: [PATCH 06/16] Update toolchain to Nov 02 --- rust-toolchain.toml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/rust-toolchain.toml b/rust-toolchain.toml index 2dad704aad..b27e9b9dec 100644 --- a/rust-toolchain.toml +++ b/rust-toolchain.toml @@ -1,7 +1,7 @@ [toolchain] -channel = "nightly-2025-08-04" +channel = "nightly-2025-11-02" components = ["rust-src", "rustc-dev", "llvm-tools"] -# commit_hash = f34ba774c78ea32b7c40598b8ad23e75cdac42a6 +# commit_hash = bd3ac0330018c23b111bbee176f32c377be7b319 # Whenever changing the nightly channel, update the commit hash above, and # change `REQUIRED_RUST_TOOLCHAIN` in `crates/rustc_codegen_spirv/build.rs` too. From 75dfd3fa3b615d391ac96d06cc95f08ff25fb4a7 Mon Sep 17 00:00:00 2001 From: David Palm Date: Wed, 5 Nov 2025 15:38:43 +0100 Subject: [PATCH 07/16] Updated arguments and return types --- crates/rustc_codegen_spirv/src/lib.rs | 52 ++++++++----------- crates/rustc_codegen_spirv/src/link.rs | 20 +++---- crates/rustc_codegen_spirv/src/linker/test.rs | 9 +--- 3 files changed, 35 insertions(+), 46 deletions(-) diff --git a/crates/rustc_codegen_spirv/src/lib.rs b/crates/rustc_codegen_spirv/src/lib.rs index 61a2b3d3c2..4a3f7f2b0e 100644 --- a/crates/rustc_codegen_spirv/src/lib.rs +++ b/crates/rustc_codegen_spirv/src/lib.rs @@ -153,10 +153,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}; @@ -283,6 +282,10 @@ impl CodegenBackend for SpirvCodegenBackend { ); drop(timer); } + + fn name(&self) -> &'static str { + "SpirvCodegenBackend" + } } struct SpirvModuleBuffer(Vec); @@ -301,16 +304,16 @@ impl ThinBufferMethods for SpirvModuleBuffer { fn data(&self) -> &[u8] { self.as_bytes() } - fn thin_link_data(&self) -> &[u8] { - &[] - } + // 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 @@ -320,7 +323,7 @@ impl SpirvCodegenBackend { // FIXME(eddyb) run as many optimization passes as possible, not just DCE. - Ok(()) + () } } @@ -341,8 +344,8 @@ impl WriteBackendMethods for SpirvCodegenBackend { _exported_symbols_for_lto: &[String], _each_linked_rlib_for_lto: &[PathBuf], _modules: Vec>, - _diff_fncs: Vec, - ) -> Result, FatalError> { + // _diff_fncs: Vec, + ) -> ModuleCodegen { assert!( cgcx.lto == rustc_session::config::Lto::Fat, "`run_and_optimize_fat_lto` (for `WorkItemResult::NeedsFatLto`) should \ @@ -358,7 +361,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) } @@ -375,14 +378,14 @@ impl WriteBackendMethods for SpirvCodegenBackend { _dcx: DiagCtxtHandle<'_>, module: &mut ModuleCodegen, _config: &ModuleConfig, - ) -> Result<(), FatalError> { + ) -> () { 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). @@ -395,15 +398,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); @@ -414,7 +417,7 @@ impl WriteBackendMethods for SpirvCodegenBackend { ); fs::write(&path, module_buffer.as_bytes()).unwrap(); - Ok(CompiledModule { + CompiledModule { name, kind, object: Some(path), @@ -423,13 +426,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) } @@ -442,13 +442,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 c99c5e6aa3..9debc24408 100644 --- a/crates/rustc_codegen_spirv/src/link.rs +++ b/crates/rustc_codegen_spirv/src/link.rs @@ -6,13 +6,13 @@ use crate::{SpirvCodegenBackend, SpirvModuleBuffer, linker}; use ar::{Archive, GnuBuilder, Header}; use rspirv::binary::Assemble; use rspirv::dr::Module; -use rustc_ast::CRATE_NODE_ID; 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 +22,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}; @@ -494,11 +493,12 @@ fn add_upstream_native_libraries( // FIXME(eddyb) upstream has code like this already, maybe we can reuse most of it? // (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), - None => true, - } +fn relevant_lib(_sess: &Session, _lib: &NativeLib) -> bool { + true + // match lib.cfg { + // Some(ref cfg) => rustc_attr_parsing::cfg_matches(cfg, sess, CRATE_NODE_ID, None), + // None => true, + // } } fn create_archive(files: &[&Path], metadata: &[u8], out_filename: &Path) { @@ -634,7 +634,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 +674,5 @@ pub(crate) fn run_thin( }); } - Ok((opt_jobs, vec![])) + (opt_jobs, vec![]) } diff --git a/crates/rustc_codegen_spirv/src/linker/test.rs b/crates/rustc_codegen_spirv/src/linker/test.rs index 3fdd7185af..a50d81704b 100644 --- a/crates/rustc_codegen_spirv/src/linker/test.rs +++ b/crates/rustc_codegen_spirv/src/linker/test.rs @@ -7,12 +7,6 @@ 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 +156,7 @@ fn link_with_linker_opts( rustc_interface::util::rustc_version_str().unwrap_or("unknown"), Default::default(), &rustc_driver_impl::USING_INTERNAL_FEATURES, - Default::default(), + // Default::default(), ); // HACK(eddyb) inject `write_diags` into `sess`, to work around @@ -193,6 +187,7 @@ fn link_with_linker_opts( "".into(), None, None, + None, "".into(), OutputTypes::new(&[]), ), From 7a474a7426c8cbf1eb42d3cf315e1e10712a278b Mon Sep 17 00:00:00 2001 From: David Palm Date: Wed, 5 Nov 2025 15:39:25 +0100 Subject: [PATCH 08/16] Updated arguments and return types --- crates/rustc_codegen_spirv/src/lib.rs | 4 ---- crates/rustc_codegen_spirv/src/link.rs | 1 + crates/rustc_codegen_spirv/src/linker/test.rs | 1 - 3 files changed, 1 insertion(+), 5 deletions(-) diff --git a/crates/rustc_codegen_spirv/src/lib.rs b/crates/rustc_codegen_spirv/src/lib.rs index 4a3f7f2b0e..c6d60aa0a8 100644 --- a/crates/rustc_codegen_spirv/src/lib.rs +++ b/crates/rustc_codegen_spirv/src/lib.rs @@ -304,9 +304,6 @@ impl ThinBufferMethods for SpirvModuleBuffer { fn data(&self) -> &[u8] { self.as_bytes() } - // fn thin_link_data(&self) -> &[u8] { - // &[] - // } } impl SpirvCodegenBackend { @@ -344,7 +341,6 @@ impl WriteBackendMethods for SpirvCodegenBackend { _exported_symbols_for_lto: &[String], _each_linked_rlib_for_lto: &[PathBuf], _modules: Vec>, - // _diff_fncs: Vec, ) -> ModuleCodegen { assert!( cgcx.lto == rustc_session::config::Lto::Fat, diff --git a/crates/rustc_codegen_spirv/src/link.rs b/crates/rustc_codegen_spirv/src/link.rs index 9debc24408..75049f6348 100644 --- a/crates/rustc_codegen_spirv/src/link.rs +++ b/crates/rustc_codegen_spirv/src/link.rs @@ -494,6 +494,7 @@ fn add_upstream_native_libraries( // FIXME(eddyb) upstream has code like this already, maybe we can reuse most of it? // (see `compiler/rustc_codegen_ssa/src/back/link.rs`) fn relevant_lib(_sess: &Session, _lib: &NativeLib) -> bool { + // FIXME: `lib.cfg` is not of the expected type any more. true // match lib.cfg { // Some(ref cfg) => rustc_attr_parsing::cfg_matches(cfg, sess, CRATE_NODE_ID, None), diff --git a/crates/rustc_codegen_spirv/src/linker/test.rs b/crates/rustc_codegen_spirv/src/linker/test.rs index a50d81704b..5dbfc9937a 100644 --- a/crates/rustc_codegen_spirv/src/linker/test.rs +++ b/crates/rustc_codegen_spirv/src/linker/test.rs @@ -156,7 +156,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 From 9e314314009cd44c2fc9c567b7211ec10d186942 Mon Sep 17 00:00:00 2001 From: David Palm Date: Wed, 5 Nov 2025 15:40:24 +0100 Subject: [PATCH 09/16] Comment out ICEing handling of `From` impls --- .../src/codegen_cx/declare.rs | 59 +++++++++++-------- 1 file changed, 34 insertions(+), 25 deletions(-) diff --git a/crates/rustc_codegen_spirv/src/codegen_cx/declare.rs b/crates/rustc_codegen_spirv/src/codegen_cx/declare.rs index d6bf4b60be..c801b21ff3 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; @@ -166,29 +166,38 @@ 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 trait_def_id = trait_ref.skip_binder().def_id; - - // Check if this is the From trait. - let trait_path = self.tcx.def_path_str(trait_def_id); - if matches!( - trait_path.as_str(), - "core::convert::From" | "std::convert::From" - ) { - // Extract the source and target types from the trait substitutions - let trait_args = trait_ref.skip_binder().args; - if let (Some(target_ty), Some(source_ty)) = - (trait_args.types().nth(0), trait_args.types().nth(1)) - { - self.from_trait_impls - .borrow_mut() - .insert(def_id, (source_ty, target_ty)); - } - } - } + // FIXME: This code ICEs + // // Check if this is a From trait implementation + // if let Some(impl_def_id) = self.tcx.impl_of_assoc(def_id) + // && let Some(local_def_id) = def_id.as_local() + // && self + // .tcx + // .hir_expect_item(local_def_id) + // .expect_impl() + // .of_trait + // .is_some() + // // && let Some(trait_ref) = self.tcx.impl_trait_ref(impl_def_id) + // { + // let trait_ref = self.tcx.impl_trait_ref(impl_def_id); + // let trait_def_id = trait_ref.skip_binder().def_id; + + // // Check if this is the From trait. + // let trait_path = self.tcx.def_path_str(trait_def_id); + // if matches!( + // trait_path.as_str(), + // "core::convert::From" | "std::convert::From" + // ) { + // // Extract the source and target types from the trait substitutions + // let trait_args = trait_ref.skip_binder().args; + // if let (Some(target_ty), Some(source_ty)) = + // (trait_args.types().nth(0), trait_args.types().nth(1)) + // { + // self.from_trait_impls + // .borrow_mut() + // .insert(def_id, (source_ty, target_ty)); + // } + // } + // } if [ self.tcx.lang_items().panic_fn(), From 83f37b017958f4260afb19877e5dd8a98ee486ed Mon Sep 17 00:00:00 2001 From: David Palm Date: Wed, 5 Nov 2025 15:40:59 +0100 Subject: [PATCH 10/16] Updated build script --- crates/rustc_codegen_spirv/build.rs | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/crates/rustc_codegen_spirv/build.rs b/crates/rustc_codegen_spirv/build.rs index 3eec06cc9c..6aff010550 100644 --- a/crates/rustc_codegen_spirv/build.rs +++ b/crates/rustc_codegen_spirv/build.rs @@ -18,9 +18,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-11-02" components = ["rust-src", "rustc-dev", "llvm-tools"] -# commit_hash = f34ba774c78ea32b7c40598b8ad23e75cdac42a6"#; +# commit_hash = bd3ac0330018c23b111bbee176f32c377be7b319"#; fn rustc_output(arg: &str) -> Result> { let rustc = env::var("RUSTC").unwrap_or_else(|_| "rustc".into()); @@ -197,6 +197,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( From 27398fd6a956e5b663ac5508930228a549e34543 Mon Sep 17 00:00:00 2001 From: David Palm Date: Wed, 5 Nov 2025 15:41:36 +0100 Subject: [PATCH 11/16] More new trait methods, changes return types and error variants --- Cargo.lock | 1 + crates/rustc_codegen_spirv/Cargo.toml | 1 + .../src/builder/builder_methods.rs | 4 +++- crates/rustc_codegen_spirv/src/builder/mod.rs | 17 ++++++++++++++++- .../src/codegen_cx/constant.rs | 3 +-- 5 files changed, 22 insertions(+), 4 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index e34454bb23..a8e6809f23 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2795,6 +2795,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 8f7b880855..aac197e6b2 100644 --- a/crates/rustc_codegen_spirv/Cargo.toml +++ b/crates/rustc_codegen_spirv/Cargo.toml @@ -67,6 +67,7 @@ rustc_codegen_spirv-target-specs.workspace = true [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/builder/builder_methods.rs b/crates/rustc_codegen_spirv/src/builder/builder_methods.rs index 9160ed9ce0..d17d82b177 100644 --- a/crates/rustc_codegen_spirv/src/builder/builder_methods.rs +++ b/crates/rustc_codegen_spirv/src/builder/builder_methods.rs @@ -2795,6 +2795,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!( @@ -2881,7 +2882,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( @@ -3127,6 +3128,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 fb418f1018..eeaffc8ac8 100644 --- a/crates/rustc_codegen_spirv/src/builder/mod.rs +++ b/crates/rustc_codegen_spirv/src/builder/mod.rs @@ -182,7 +182,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!() } @@ -202,6 +202,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:?}`")) } }, From a130cfe6c71a0e5c61d3991d46829d44f3366143 Mon Sep 17 00:00:00 2001 From: David Palm Date: Thu, 6 Nov 2025 11:20:18 +0100 Subject: [PATCH 12/16] Revert "Update target specs to new format" This reverts commit 42dc34a0180fb660be9ccc5716730a6137df7456. --- .../target-specs/spirv-unknown-opengl4.0.json | 48 +++++++++---------- .../target-specs/spirv-unknown-opengl4.1.json | 48 +++++++++---------- .../target-specs/spirv-unknown-opengl4.2.json | 48 +++++++++---------- .../target-specs/spirv-unknown-opengl4.3.json | 48 +++++++++---------- .../target-specs/spirv-unknown-opengl4.5.json | 48 +++++++++---------- .../target-specs/spirv-unknown-spv1.0.json | 48 +++++++++---------- .../target-specs/spirv-unknown-spv1.1.json | 48 +++++++++---------- .../target-specs/spirv-unknown-spv1.2.json | 48 +++++++++---------- .../target-specs/spirv-unknown-spv1.3.json | 48 +++++++++---------- .../target-specs/spirv-unknown-spv1.4.json | 48 +++++++++---------- .../target-specs/spirv-unknown-spv1.5.json | 48 +++++++++---------- .../target-specs/spirv-unknown-spv1.6.json | 48 +++++++++---------- .../target-specs/spirv-unknown-vulkan1.0.json | 48 +++++++++---------- .../target-specs/spirv-unknown-vulkan1.1.json | 48 +++++++++---------- .../spirv-unknown-vulkan1.1spv1.4.json | 48 +++++++++---------- .../target-specs/spirv-unknown-vulkan1.2.json | 48 +++++++++---------- .../target-specs/spirv-unknown-vulkan1.3.json | 48 +++++++++---------- .../target-specs/spirv-unknown-vulkan1.4.json | 48 +++++++++---------- 18 files changed, 432 insertions(+), 432 deletions(-) diff --git a/crates/rustc_codegen_spirv-target-specs/target-specs/spirv-unknown-opengl4.0.json b/crates/rustc_codegen_spirv-target-specs/target-specs/spirv-unknown-opengl4.0.json index a0057ac3b0..d76e303e2a 100644 --- a/crates/rustc_codegen_spirv-target-specs/target-specs/spirv-unknown-opengl4.0.json +++ b/crates/rustc_codegen_spirv-target-specs/target-specs/spirv-unknown-opengl4.0.json @@ -1,26 +1,26 @@ { - "allows-weak-linkage": false, - "arch": "spirv", - "crt-objects-fallback": "false", - "crt-static-allows-dylibs": true, - "crt-static-respected": true, - "data-layout": "e-m:e-p:32:32:32-i64:64-n8:16:32:64", - "dll-prefix": "", - "dll-suffix": ".spv.json", - "dynamic-linking": true, - "emit-debug-gdb-scripts": false, - "env": "opengl4.0", - "linker-flavor": "unix", - "linker-is-gnu": false, - "llvm-target": "spirv-unknown-opengl4.0", - "main-needs-argc-argv": false, - "metadata": { - "description": null, - "host_tools": null, - "std": null, - "tier": null - }, - "panic-strategy": "abort", - "simd-types-indirect": false, - "target-pointer-width": 32 + "allows-weak-linkage": false, + "arch": "spirv", + "crt-objects-fallback": "false", + "crt-static-allows-dylibs": true, + "crt-static-respected": true, + "data-layout": "e-m:e-p:32:32:32-i64:64-n8:16:32:64", + "dll-prefix": "", + "dll-suffix": ".spv.json", + "dynamic-linking": true, + "emit-debug-gdb-scripts": false, + "env": "opengl4.0", + "linker-flavor": "unix", + "linker-is-gnu": false, + "llvm-target": "spirv-unknown-opengl4.0", + "main-needs-argc-argv": false, + "metadata": { + "description": null, + "host_tools": null, + "std": null, + "tier": null + }, + "panic-strategy": "abort", + "simd-types-indirect": false, + "target-pointer-width": "32" } diff --git a/crates/rustc_codegen_spirv-target-specs/target-specs/spirv-unknown-opengl4.1.json b/crates/rustc_codegen_spirv-target-specs/target-specs/spirv-unknown-opengl4.1.json index 2d3b942449..10eaa2f6ed 100644 --- a/crates/rustc_codegen_spirv-target-specs/target-specs/spirv-unknown-opengl4.1.json +++ b/crates/rustc_codegen_spirv-target-specs/target-specs/spirv-unknown-opengl4.1.json @@ -1,26 +1,26 @@ { - "allows-weak-linkage": false, - "arch": "spirv", - "crt-objects-fallback": "false", - "crt-static-allows-dylibs": true, - "crt-static-respected": true, - "data-layout": "e-m:e-p:32:32:32-i64:64-n8:16:32:64", - "dll-prefix": "", - "dll-suffix": ".spv.json", - "dynamic-linking": true, - "emit-debug-gdb-scripts": false, - "env": "opengl4.1", - "linker-flavor": "unix", - "linker-is-gnu": false, - "llvm-target": "spirv-unknown-opengl4.1", - "main-needs-argc-argv": false, - "metadata": { - "description": null, - "host_tools": null, - "std": null, - "tier": null - }, - "panic-strategy": "abort", - "simd-types-indirect": false, - "target-pointer-width": 32 + "allows-weak-linkage": false, + "arch": "spirv", + "crt-objects-fallback": "false", + "crt-static-allows-dylibs": true, + "crt-static-respected": true, + "data-layout": "e-m:e-p:32:32:32-i64:64-n8:16:32:64", + "dll-prefix": "", + "dll-suffix": ".spv.json", + "dynamic-linking": true, + "emit-debug-gdb-scripts": false, + "env": "opengl4.1", + "linker-flavor": "unix", + "linker-is-gnu": false, + "llvm-target": "spirv-unknown-opengl4.1", + "main-needs-argc-argv": false, + "metadata": { + "description": null, + "host_tools": null, + "std": null, + "tier": null + }, + "panic-strategy": "abort", + "simd-types-indirect": false, + "target-pointer-width": "32" } diff --git a/crates/rustc_codegen_spirv-target-specs/target-specs/spirv-unknown-opengl4.2.json b/crates/rustc_codegen_spirv-target-specs/target-specs/spirv-unknown-opengl4.2.json index 15b1b92a6a..9a8e14bced 100644 --- a/crates/rustc_codegen_spirv-target-specs/target-specs/spirv-unknown-opengl4.2.json +++ b/crates/rustc_codegen_spirv-target-specs/target-specs/spirv-unknown-opengl4.2.json @@ -1,26 +1,26 @@ { - "allows-weak-linkage": false, - "arch": "spirv", - "crt-objects-fallback": "false", - "crt-static-allows-dylibs": true, - "crt-static-respected": true, - "data-layout": "e-m:e-p:32:32:32-i64:64-n8:16:32:64", - "dll-prefix": "", - "dll-suffix": ".spv.json", - "dynamic-linking": true, - "emit-debug-gdb-scripts": false, - "env": "opengl4.2", - "linker-flavor": "unix", - "linker-is-gnu": false, - "llvm-target": "spirv-unknown-opengl4.2", - "main-needs-argc-argv": false, - "metadata": { - "description": null, - "host_tools": null, - "std": null, - "tier": null - }, - "panic-strategy": "abort", - "simd-types-indirect": false, - "target-pointer-width": 32 + "allows-weak-linkage": false, + "arch": "spirv", + "crt-objects-fallback": "false", + "crt-static-allows-dylibs": true, + "crt-static-respected": true, + "data-layout": "e-m:e-p:32:32:32-i64:64-n8:16:32:64", + "dll-prefix": "", + "dll-suffix": ".spv.json", + "dynamic-linking": true, + "emit-debug-gdb-scripts": false, + "env": "opengl4.2", + "linker-flavor": "unix", + "linker-is-gnu": false, + "llvm-target": "spirv-unknown-opengl4.2", + "main-needs-argc-argv": false, + "metadata": { + "description": null, + "host_tools": null, + "std": null, + "tier": null + }, + "panic-strategy": "abort", + "simd-types-indirect": false, + "target-pointer-width": "32" } diff --git a/crates/rustc_codegen_spirv-target-specs/target-specs/spirv-unknown-opengl4.3.json b/crates/rustc_codegen_spirv-target-specs/target-specs/spirv-unknown-opengl4.3.json index eee9577270..a164073671 100644 --- a/crates/rustc_codegen_spirv-target-specs/target-specs/spirv-unknown-opengl4.3.json +++ b/crates/rustc_codegen_spirv-target-specs/target-specs/spirv-unknown-opengl4.3.json @@ -1,26 +1,26 @@ { - "allows-weak-linkage": false, - "arch": "spirv", - "crt-objects-fallback": "false", - "crt-static-allows-dylibs": true, - "crt-static-respected": true, - "data-layout": "e-m:e-p:32:32:32-i64:64-n8:16:32:64", - "dll-prefix": "", - "dll-suffix": ".spv.json", - "dynamic-linking": true, - "emit-debug-gdb-scripts": false, - "env": "opengl4.3", - "linker-flavor": "unix", - "linker-is-gnu": false, - "llvm-target": "spirv-unknown-opengl4.3", - "main-needs-argc-argv": false, - "metadata": { - "description": null, - "host_tools": null, - "std": null, - "tier": null - }, - "panic-strategy": "abort", - "simd-types-indirect": false, - "target-pointer-width": 32 + "allows-weak-linkage": false, + "arch": "spirv", + "crt-objects-fallback": "false", + "crt-static-allows-dylibs": true, + "crt-static-respected": true, + "data-layout": "e-m:e-p:32:32:32-i64:64-n8:16:32:64", + "dll-prefix": "", + "dll-suffix": ".spv.json", + "dynamic-linking": true, + "emit-debug-gdb-scripts": false, + "env": "opengl4.3", + "linker-flavor": "unix", + "linker-is-gnu": false, + "llvm-target": "spirv-unknown-opengl4.3", + "main-needs-argc-argv": false, + "metadata": { + "description": null, + "host_tools": null, + "std": null, + "tier": null + }, + "panic-strategy": "abort", + "simd-types-indirect": false, + "target-pointer-width": "32" } diff --git a/crates/rustc_codegen_spirv-target-specs/target-specs/spirv-unknown-opengl4.5.json b/crates/rustc_codegen_spirv-target-specs/target-specs/spirv-unknown-opengl4.5.json index bb10d76350..00d23b035d 100644 --- a/crates/rustc_codegen_spirv-target-specs/target-specs/spirv-unknown-opengl4.5.json +++ b/crates/rustc_codegen_spirv-target-specs/target-specs/spirv-unknown-opengl4.5.json @@ -1,26 +1,26 @@ { - "allows-weak-linkage": false, - "arch": "spirv", - "crt-objects-fallback": "false", - "crt-static-allows-dylibs": true, - "crt-static-respected": true, - "data-layout": "e-m:e-p:32:32:32-i64:64-n8:16:32:64", - "dll-prefix": "", - "dll-suffix": ".spv.json", - "dynamic-linking": true, - "emit-debug-gdb-scripts": false, - "env": "opengl4.5", - "linker-flavor": "unix", - "linker-is-gnu": false, - "llvm-target": "spirv-unknown-opengl4.5", - "main-needs-argc-argv": false, - "metadata": { - "description": null, - "host_tools": null, - "std": null, - "tier": null - }, - "panic-strategy": "abort", - "simd-types-indirect": false, - "target-pointer-width": 32 + "allows-weak-linkage": false, + "arch": "spirv", + "crt-objects-fallback": "false", + "crt-static-allows-dylibs": true, + "crt-static-respected": true, + "data-layout": "e-m:e-p:32:32:32-i64:64-n8:16:32:64", + "dll-prefix": "", + "dll-suffix": ".spv.json", + "dynamic-linking": true, + "emit-debug-gdb-scripts": false, + "env": "opengl4.5", + "linker-flavor": "unix", + "linker-is-gnu": false, + "llvm-target": "spirv-unknown-opengl4.5", + "main-needs-argc-argv": false, + "metadata": { + "description": null, + "host_tools": null, + "std": null, + "tier": null + }, + "panic-strategy": "abort", + "simd-types-indirect": false, + "target-pointer-width": "32" } diff --git a/crates/rustc_codegen_spirv-target-specs/target-specs/spirv-unknown-spv1.0.json b/crates/rustc_codegen_spirv-target-specs/target-specs/spirv-unknown-spv1.0.json index 4913f81e77..b1f7f910c3 100644 --- a/crates/rustc_codegen_spirv-target-specs/target-specs/spirv-unknown-spv1.0.json +++ b/crates/rustc_codegen_spirv-target-specs/target-specs/spirv-unknown-spv1.0.json @@ -1,26 +1,26 @@ { - "allows-weak-linkage": false, - "arch": "spirv", - "crt-objects-fallback": "false", - "crt-static-allows-dylibs": true, - "crt-static-respected": true, - "data-layout": "e-m:e-p:32:32:32-i64:64-n8:16:32:64", - "dll-prefix": "", - "dll-suffix": ".spv.json", - "dynamic-linking": true, - "emit-debug-gdb-scripts": false, - "env": "spv1.0", - "linker-flavor": "unix", - "linker-is-gnu": false, - "llvm-target": "spirv-unknown-spv1.0", - "main-needs-argc-argv": false, - "metadata": { - "description": null, - "host_tools": null, - "std": null, - "tier": null - }, - "panic-strategy": "abort", - "simd-types-indirect": false, - "target-pointer-width": 32 + "allows-weak-linkage": false, + "arch": "spirv", + "crt-objects-fallback": "false", + "crt-static-allows-dylibs": true, + "crt-static-respected": true, + "data-layout": "e-m:e-p:32:32:32-i64:64-n8:16:32:64", + "dll-prefix": "", + "dll-suffix": ".spv.json", + "dynamic-linking": true, + "emit-debug-gdb-scripts": false, + "env": "spv1.0", + "linker-flavor": "unix", + "linker-is-gnu": false, + "llvm-target": "spirv-unknown-spv1.0", + "main-needs-argc-argv": false, + "metadata": { + "description": null, + "host_tools": null, + "std": null, + "tier": null + }, + "panic-strategy": "abort", + "simd-types-indirect": false, + "target-pointer-width": "32" } diff --git a/crates/rustc_codegen_spirv-target-specs/target-specs/spirv-unknown-spv1.1.json b/crates/rustc_codegen_spirv-target-specs/target-specs/spirv-unknown-spv1.1.json index ebb6135b64..4319c16514 100644 --- a/crates/rustc_codegen_spirv-target-specs/target-specs/spirv-unknown-spv1.1.json +++ b/crates/rustc_codegen_spirv-target-specs/target-specs/spirv-unknown-spv1.1.json @@ -1,26 +1,26 @@ { - "allows-weak-linkage": false, - "arch": "spirv", - "crt-objects-fallback": "false", - "crt-static-allows-dylibs": true, - "crt-static-respected": true, - "data-layout": "e-m:e-p:32:32:32-i64:64-n8:16:32:64", - "dll-prefix": "", - "dll-suffix": ".spv.json", - "dynamic-linking": true, - "emit-debug-gdb-scripts": false, - "env": "spv1.1", - "linker-flavor": "unix", - "linker-is-gnu": false, - "llvm-target": "spirv-unknown-spv1.1", - "main-needs-argc-argv": false, - "metadata": { - "description": null, - "host_tools": null, - "std": null, - "tier": null - }, - "panic-strategy": "abort", - "simd-types-indirect": false, - "target-pointer-width": 32 + "allows-weak-linkage": false, + "arch": "spirv", + "crt-objects-fallback": "false", + "crt-static-allows-dylibs": true, + "crt-static-respected": true, + "data-layout": "e-m:e-p:32:32:32-i64:64-n8:16:32:64", + "dll-prefix": "", + "dll-suffix": ".spv.json", + "dynamic-linking": true, + "emit-debug-gdb-scripts": false, + "env": "spv1.1", + "linker-flavor": "unix", + "linker-is-gnu": false, + "llvm-target": "spirv-unknown-spv1.1", + "main-needs-argc-argv": false, + "metadata": { + "description": null, + "host_tools": null, + "std": null, + "tier": null + }, + "panic-strategy": "abort", + "simd-types-indirect": false, + "target-pointer-width": "32" } diff --git a/crates/rustc_codegen_spirv-target-specs/target-specs/spirv-unknown-spv1.2.json b/crates/rustc_codegen_spirv-target-specs/target-specs/spirv-unknown-spv1.2.json index 3b961850fa..43a4ec9bd8 100644 --- a/crates/rustc_codegen_spirv-target-specs/target-specs/spirv-unknown-spv1.2.json +++ b/crates/rustc_codegen_spirv-target-specs/target-specs/spirv-unknown-spv1.2.json @@ -1,26 +1,26 @@ { - "allows-weak-linkage": false, - "arch": "spirv", - "crt-objects-fallback": "false", - "crt-static-allows-dylibs": true, - "crt-static-respected": true, - "data-layout": "e-m:e-p:32:32:32-i64:64-n8:16:32:64", - "dll-prefix": "", - "dll-suffix": ".spv.json", - "dynamic-linking": true, - "emit-debug-gdb-scripts": false, - "env": "spv1.2", - "linker-flavor": "unix", - "linker-is-gnu": false, - "llvm-target": "spirv-unknown-spv1.2", - "main-needs-argc-argv": false, - "metadata": { - "description": null, - "host_tools": null, - "std": null, - "tier": null - }, - "panic-strategy": "abort", - "simd-types-indirect": false, - "target-pointer-width": 32 + "allows-weak-linkage": false, + "arch": "spirv", + "crt-objects-fallback": "false", + "crt-static-allows-dylibs": true, + "crt-static-respected": true, + "data-layout": "e-m:e-p:32:32:32-i64:64-n8:16:32:64", + "dll-prefix": "", + "dll-suffix": ".spv.json", + "dynamic-linking": true, + "emit-debug-gdb-scripts": false, + "env": "spv1.2", + "linker-flavor": "unix", + "linker-is-gnu": false, + "llvm-target": "spirv-unknown-spv1.2", + "main-needs-argc-argv": false, + "metadata": { + "description": null, + "host_tools": null, + "std": null, + "tier": null + }, + "panic-strategy": "abort", + "simd-types-indirect": false, + "target-pointer-width": "32" } diff --git a/crates/rustc_codegen_spirv-target-specs/target-specs/spirv-unknown-spv1.3.json b/crates/rustc_codegen_spirv-target-specs/target-specs/spirv-unknown-spv1.3.json index aead4bacc2..3903cdba51 100644 --- a/crates/rustc_codegen_spirv-target-specs/target-specs/spirv-unknown-spv1.3.json +++ b/crates/rustc_codegen_spirv-target-specs/target-specs/spirv-unknown-spv1.3.json @@ -1,26 +1,26 @@ { - "allows-weak-linkage": false, - "arch": "spirv", - "crt-objects-fallback": "false", - "crt-static-allows-dylibs": true, - "crt-static-respected": true, - "data-layout": "e-m:e-p:32:32:32-i64:64-n8:16:32:64", - "dll-prefix": "", - "dll-suffix": ".spv.json", - "dynamic-linking": true, - "emit-debug-gdb-scripts": false, - "env": "spv1.3", - "linker-flavor": "unix", - "linker-is-gnu": false, - "llvm-target": "spirv-unknown-spv1.3", - "main-needs-argc-argv": false, - "metadata": { - "description": null, - "host_tools": null, - "std": null, - "tier": null - }, - "panic-strategy": "abort", - "simd-types-indirect": false, - "target-pointer-width": 32 + "allows-weak-linkage": false, + "arch": "spirv", + "crt-objects-fallback": "false", + "crt-static-allows-dylibs": true, + "crt-static-respected": true, + "data-layout": "e-m:e-p:32:32:32-i64:64-n8:16:32:64", + "dll-prefix": "", + "dll-suffix": ".spv.json", + "dynamic-linking": true, + "emit-debug-gdb-scripts": false, + "env": "spv1.3", + "linker-flavor": "unix", + "linker-is-gnu": false, + "llvm-target": "spirv-unknown-spv1.3", + "main-needs-argc-argv": false, + "metadata": { + "description": null, + "host_tools": null, + "std": null, + "tier": null + }, + "panic-strategy": "abort", + "simd-types-indirect": false, + "target-pointer-width": "32" } diff --git a/crates/rustc_codegen_spirv-target-specs/target-specs/spirv-unknown-spv1.4.json b/crates/rustc_codegen_spirv-target-specs/target-specs/spirv-unknown-spv1.4.json index afcefb39d3..a645839c76 100644 --- a/crates/rustc_codegen_spirv-target-specs/target-specs/spirv-unknown-spv1.4.json +++ b/crates/rustc_codegen_spirv-target-specs/target-specs/spirv-unknown-spv1.4.json @@ -1,26 +1,26 @@ { - "allows-weak-linkage": false, - "arch": "spirv", - "crt-objects-fallback": "false", - "crt-static-allows-dylibs": true, - "crt-static-respected": true, - "data-layout": "e-m:e-p:32:32:32-i64:64-n8:16:32:64", - "dll-prefix": "", - "dll-suffix": ".spv.json", - "dynamic-linking": true, - "emit-debug-gdb-scripts": false, - "env": "spv1.4", - "linker-flavor": "unix", - "linker-is-gnu": false, - "llvm-target": "spirv-unknown-spv1.4", - "main-needs-argc-argv": false, - "metadata": { - "description": null, - "host_tools": null, - "std": null, - "tier": null - }, - "panic-strategy": "abort", - "simd-types-indirect": false, - "target-pointer-width": 32 + "allows-weak-linkage": false, + "arch": "spirv", + "crt-objects-fallback": "false", + "crt-static-allows-dylibs": true, + "crt-static-respected": true, + "data-layout": "e-m:e-p:32:32:32-i64:64-n8:16:32:64", + "dll-prefix": "", + "dll-suffix": ".spv.json", + "dynamic-linking": true, + "emit-debug-gdb-scripts": false, + "env": "spv1.4", + "linker-flavor": "unix", + "linker-is-gnu": false, + "llvm-target": "spirv-unknown-spv1.4", + "main-needs-argc-argv": false, + "metadata": { + "description": null, + "host_tools": null, + "std": null, + "tier": null + }, + "panic-strategy": "abort", + "simd-types-indirect": false, + "target-pointer-width": "32" } diff --git a/crates/rustc_codegen_spirv-target-specs/target-specs/spirv-unknown-spv1.5.json b/crates/rustc_codegen_spirv-target-specs/target-specs/spirv-unknown-spv1.5.json index 5b310ca756..67a2fb375f 100644 --- a/crates/rustc_codegen_spirv-target-specs/target-specs/spirv-unknown-spv1.5.json +++ b/crates/rustc_codegen_spirv-target-specs/target-specs/spirv-unknown-spv1.5.json @@ -1,26 +1,26 @@ { - "allows-weak-linkage": false, - "arch": "spirv", - "crt-objects-fallback": "false", - "crt-static-allows-dylibs": true, - "crt-static-respected": true, - "data-layout": "e-m:e-p:32:32:32-i64:64-n8:16:32:64", - "dll-prefix": "", - "dll-suffix": ".spv.json", - "dynamic-linking": true, - "emit-debug-gdb-scripts": false, - "env": "spv1.5", - "linker-flavor": "unix", - "linker-is-gnu": false, - "llvm-target": "spirv-unknown-spv1.5", - "main-needs-argc-argv": false, - "metadata": { - "description": null, - "host_tools": null, - "std": null, - "tier": null - }, - "panic-strategy": "abort", - "simd-types-indirect": false, - "target-pointer-width": 32 + "allows-weak-linkage": false, + "arch": "spirv", + "crt-objects-fallback": "false", + "crt-static-allows-dylibs": true, + "crt-static-respected": true, + "data-layout": "e-m:e-p:32:32:32-i64:64-n8:16:32:64", + "dll-prefix": "", + "dll-suffix": ".spv.json", + "dynamic-linking": true, + "emit-debug-gdb-scripts": false, + "env": "spv1.5", + "linker-flavor": "unix", + "linker-is-gnu": false, + "llvm-target": "spirv-unknown-spv1.5", + "main-needs-argc-argv": false, + "metadata": { + "description": null, + "host_tools": null, + "std": null, + "tier": null + }, + "panic-strategy": "abort", + "simd-types-indirect": false, + "target-pointer-width": "32" } diff --git a/crates/rustc_codegen_spirv-target-specs/target-specs/spirv-unknown-spv1.6.json b/crates/rustc_codegen_spirv-target-specs/target-specs/spirv-unknown-spv1.6.json index 5747ac398e..0208756e96 100644 --- a/crates/rustc_codegen_spirv-target-specs/target-specs/spirv-unknown-spv1.6.json +++ b/crates/rustc_codegen_spirv-target-specs/target-specs/spirv-unknown-spv1.6.json @@ -1,26 +1,26 @@ { - "allows-weak-linkage": false, - "arch": "spirv", - "crt-objects-fallback": "false", - "crt-static-allows-dylibs": true, - "crt-static-respected": true, - "data-layout": "e-m:e-p:32:32:32-i64:64-n8:16:32:64", - "dll-prefix": "", - "dll-suffix": ".spv.json", - "dynamic-linking": true, - "emit-debug-gdb-scripts": false, - "env": "spv1.6", - "linker-flavor": "unix", - "linker-is-gnu": false, - "llvm-target": "spirv-unknown-spv1.6", - "main-needs-argc-argv": false, - "metadata": { - "description": null, - "host_tools": null, - "std": null, - "tier": null - }, - "panic-strategy": "abort", - "simd-types-indirect": false, - "target-pointer-width": 32 + "allows-weak-linkage": false, + "arch": "spirv", + "crt-objects-fallback": "false", + "crt-static-allows-dylibs": true, + "crt-static-respected": true, + "data-layout": "e-m:e-p:32:32:32-i64:64-n8:16:32:64", + "dll-prefix": "", + "dll-suffix": ".spv.json", + "dynamic-linking": true, + "emit-debug-gdb-scripts": false, + "env": "spv1.6", + "linker-flavor": "unix", + "linker-is-gnu": false, + "llvm-target": "spirv-unknown-spv1.6", + "main-needs-argc-argv": false, + "metadata": { + "description": null, + "host_tools": null, + "std": null, + "tier": null + }, + "panic-strategy": "abort", + "simd-types-indirect": false, + "target-pointer-width": "32" } diff --git a/crates/rustc_codegen_spirv-target-specs/target-specs/spirv-unknown-vulkan1.0.json b/crates/rustc_codegen_spirv-target-specs/target-specs/spirv-unknown-vulkan1.0.json index e448766123..468d7e6049 100644 --- a/crates/rustc_codegen_spirv-target-specs/target-specs/spirv-unknown-vulkan1.0.json +++ b/crates/rustc_codegen_spirv-target-specs/target-specs/spirv-unknown-vulkan1.0.json @@ -1,26 +1,26 @@ { - "allows-weak-linkage": false, - "arch": "spirv", - "crt-objects-fallback": "false", - "crt-static-allows-dylibs": true, - "crt-static-respected": true, - "data-layout": "e-m:e-p:32:32:32-i64:64-n8:16:32:64", - "dll-prefix": "", - "dll-suffix": ".spv.json", - "dynamic-linking": true, - "emit-debug-gdb-scripts": false, - "env": "vulkan1.0", - "linker-flavor": "unix", - "linker-is-gnu": false, - "llvm-target": "spirv-unknown-vulkan1.0", - "main-needs-argc-argv": false, - "metadata": { - "description": null, - "host_tools": null, - "std": null, - "tier": null - }, - "panic-strategy": "abort", - "simd-types-indirect": false, - "target-pointer-width": 32 + "allows-weak-linkage": false, + "arch": "spirv", + "crt-objects-fallback": "false", + "crt-static-allows-dylibs": true, + "crt-static-respected": true, + "data-layout": "e-m:e-p:32:32:32-i64:64-n8:16:32:64", + "dll-prefix": "", + "dll-suffix": ".spv.json", + "dynamic-linking": true, + "emit-debug-gdb-scripts": false, + "env": "vulkan1.0", + "linker-flavor": "unix", + "linker-is-gnu": false, + "llvm-target": "spirv-unknown-vulkan1.0", + "main-needs-argc-argv": false, + "metadata": { + "description": null, + "host_tools": null, + "std": null, + "tier": null + }, + "panic-strategy": "abort", + "simd-types-indirect": false, + "target-pointer-width": "32" } diff --git a/crates/rustc_codegen_spirv-target-specs/target-specs/spirv-unknown-vulkan1.1.json b/crates/rustc_codegen_spirv-target-specs/target-specs/spirv-unknown-vulkan1.1.json index ffff84fa6d..b75eaa7dd9 100644 --- a/crates/rustc_codegen_spirv-target-specs/target-specs/spirv-unknown-vulkan1.1.json +++ b/crates/rustc_codegen_spirv-target-specs/target-specs/spirv-unknown-vulkan1.1.json @@ -1,26 +1,26 @@ { - "allows-weak-linkage": false, - "arch": "spirv", - "crt-objects-fallback": "false", - "crt-static-allows-dylibs": true, - "crt-static-respected": true, - "data-layout": "e-m:e-p:32:32:32-i64:64-n8:16:32:64", - "dll-prefix": "", - "dll-suffix": ".spv.json", - "dynamic-linking": true, - "emit-debug-gdb-scripts": false, - "env": "vulkan1.1", - "linker-flavor": "unix", - "linker-is-gnu": false, - "llvm-target": "spirv-unknown-vulkan1.1", - "main-needs-argc-argv": false, - "metadata": { - "description": null, - "host_tools": null, - "std": null, - "tier": null - }, - "panic-strategy": "abort", - "simd-types-indirect": false, - "target-pointer-width": 32 + "allows-weak-linkage": false, + "arch": "spirv", + "crt-objects-fallback": "false", + "crt-static-allows-dylibs": true, + "crt-static-respected": true, + "data-layout": "e-m:e-p:32:32:32-i64:64-n8:16:32:64", + "dll-prefix": "", + "dll-suffix": ".spv.json", + "dynamic-linking": true, + "emit-debug-gdb-scripts": false, + "env": "vulkan1.1", + "linker-flavor": "unix", + "linker-is-gnu": false, + "llvm-target": "spirv-unknown-vulkan1.1", + "main-needs-argc-argv": false, + "metadata": { + "description": null, + "host_tools": null, + "std": null, + "tier": null + }, + "panic-strategy": "abort", + "simd-types-indirect": false, + "target-pointer-width": "32" } diff --git a/crates/rustc_codegen_spirv-target-specs/target-specs/spirv-unknown-vulkan1.1spv1.4.json b/crates/rustc_codegen_spirv-target-specs/target-specs/spirv-unknown-vulkan1.1spv1.4.json index c804bbd55a..66eaba431b 100644 --- a/crates/rustc_codegen_spirv-target-specs/target-specs/spirv-unknown-vulkan1.1spv1.4.json +++ b/crates/rustc_codegen_spirv-target-specs/target-specs/spirv-unknown-vulkan1.1spv1.4.json @@ -1,26 +1,26 @@ { - "allows-weak-linkage": false, - "arch": "spirv", - "crt-objects-fallback": "false", - "crt-static-allows-dylibs": true, - "crt-static-respected": true, - "data-layout": "e-m:e-p:32:32:32-i64:64-n8:16:32:64", - "dll-prefix": "", - "dll-suffix": ".spv.json", - "dynamic-linking": true, - "emit-debug-gdb-scripts": false, - "env": "vulkan1.1spv1.4", - "linker-flavor": "unix", - "linker-is-gnu": false, - "llvm-target": "spirv-unknown-vulkan1.1spv1.4", - "main-needs-argc-argv": false, - "metadata": { - "description": null, - "host_tools": null, - "std": null, - "tier": null - }, - "panic-strategy": "abort", - "simd-types-indirect": false, - "target-pointer-width": 32 + "allows-weak-linkage": false, + "arch": "spirv", + "crt-objects-fallback": "false", + "crt-static-allows-dylibs": true, + "crt-static-respected": true, + "data-layout": "e-m:e-p:32:32:32-i64:64-n8:16:32:64", + "dll-prefix": "", + "dll-suffix": ".spv.json", + "dynamic-linking": true, + "emit-debug-gdb-scripts": false, + "env": "vulkan1.1spv1.4", + "linker-flavor": "unix", + "linker-is-gnu": false, + "llvm-target": "spirv-unknown-vulkan1.1spv1.4", + "main-needs-argc-argv": false, + "metadata": { + "description": null, + "host_tools": null, + "std": null, + "tier": null + }, + "panic-strategy": "abort", + "simd-types-indirect": false, + "target-pointer-width": "32" } diff --git a/crates/rustc_codegen_spirv-target-specs/target-specs/spirv-unknown-vulkan1.2.json b/crates/rustc_codegen_spirv-target-specs/target-specs/spirv-unknown-vulkan1.2.json index de77e0e531..34032c502a 100644 --- a/crates/rustc_codegen_spirv-target-specs/target-specs/spirv-unknown-vulkan1.2.json +++ b/crates/rustc_codegen_spirv-target-specs/target-specs/spirv-unknown-vulkan1.2.json @@ -1,26 +1,26 @@ { - "allows-weak-linkage": false, - "arch": "spirv", - "crt-objects-fallback": "false", - "crt-static-allows-dylibs": true, - "crt-static-respected": true, - "data-layout": "e-m:e-p:32:32:32-i64:64-n8:16:32:64", - "dll-prefix": "", - "dll-suffix": ".spv.json", - "dynamic-linking": true, - "emit-debug-gdb-scripts": false, - "env": "vulkan1.2", - "linker-flavor": "unix", - "linker-is-gnu": false, - "llvm-target": "spirv-unknown-vulkan1.2", - "main-needs-argc-argv": false, - "metadata": { - "description": null, - "host_tools": null, - "std": null, - "tier": null - }, - "panic-strategy": "abort", - "simd-types-indirect": false, - "target-pointer-width": 32 + "allows-weak-linkage": false, + "arch": "spirv", + "crt-objects-fallback": "false", + "crt-static-allows-dylibs": true, + "crt-static-respected": true, + "data-layout": "e-m:e-p:32:32:32-i64:64-n8:16:32:64", + "dll-prefix": "", + "dll-suffix": ".spv.json", + "dynamic-linking": true, + "emit-debug-gdb-scripts": false, + "env": "vulkan1.2", + "linker-flavor": "unix", + "linker-is-gnu": false, + "llvm-target": "spirv-unknown-vulkan1.2", + "main-needs-argc-argv": false, + "metadata": { + "description": null, + "host_tools": null, + "std": null, + "tier": null + }, + "panic-strategy": "abort", + "simd-types-indirect": false, + "target-pointer-width": "32" } diff --git a/crates/rustc_codegen_spirv-target-specs/target-specs/spirv-unknown-vulkan1.3.json b/crates/rustc_codegen_spirv-target-specs/target-specs/spirv-unknown-vulkan1.3.json index 5d3853afd2..ef4d7c2726 100644 --- a/crates/rustc_codegen_spirv-target-specs/target-specs/spirv-unknown-vulkan1.3.json +++ b/crates/rustc_codegen_spirv-target-specs/target-specs/spirv-unknown-vulkan1.3.json @@ -1,26 +1,26 @@ { - "allows-weak-linkage": false, - "arch": "spirv", - "crt-objects-fallback": "false", - "crt-static-allows-dylibs": true, - "crt-static-respected": true, - "data-layout": "e-m:e-p:32:32:32-i64:64-n8:16:32:64", - "dll-prefix": "", - "dll-suffix": ".spv.json", - "dynamic-linking": true, - "emit-debug-gdb-scripts": false, - "env": "vulkan1.3", - "linker-flavor": "unix", - "linker-is-gnu": false, - "llvm-target": "spirv-unknown-vulkan1.3", - "main-needs-argc-argv": false, - "metadata": { - "description": null, - "host_tools": null, - "std": null, - "tier": null - }, - "panic-strategy": "abort", - "simd-types-indirect": false, - "target-pointer-width": 32 + "allows-weak-linkage": false, + "arch": "spirv", + "crt-objects-fallback": "false", + "crt-static-allows-dylibs": true, + "crt-static-respected": true, + "data-layout": "e-m:e-p:32:32:32-i64:64-n8:16:32:64", + "dll-prefix": "", + "dll-suffix": ".spv.json", + "dynamic-linking": true, + "emit-debug-gdb-scripts": false, + "env": "vulkan1.3", + "linker-flavor": "unix", + "linker-is-gnu": false, + "llvm-target": "spirv-unknown-vulkan1.3", + "main-needs-argc-argv": false, + "metadata": { + "description": null, + "host_tools": null, + "std": null, + "tier": null + }, + "panic-strategy": "abort", + "simd-types-indirect": false, + "target-pointer-width": "32" } diff --git a/crates/rustc_codegen_spirv-target-specs/target-specs/spirv-unknown-vulkan1.4.json b/crates/rustc_codegen_spirv-target-specs/target-specs/spirv-unknown-vulkan1.4.json index 08f3dfff7f..f2b4d8ad37 100644 --- a/crates/rustc_codegen_spirv-target-specs/target-specs/spirv-unknown-vulkan1.4.json +++ b/crates/rustc_codegen_spirv-target-specs/target-specs/spirv-unknown-vulkan1.4.json @@ -1,26 +1,26 @@ { - "allows-weak-linkage": false, - "arch": "spirv", - "crt-objects-fallback": "false", - "crt-static-allows-dylibs": true, - "crt-static-respected": true, - "data-layout": "e-m:e-p:32:32:32-i64:64-n8:16:32:64", - "dll-prefix": "", - "dll-suffix": ".spv.json", - "dynamic-linking": true, - "emit-debug-gdb-scripts": false, - "env": "vulkan1.4", - "linker-flavor": "unix", - "linker-is-gnu": false, - "llvm-target": "spirv-unknown-vulkan1.4", - "main-needs-argc-argv": false, - "metadata": { - "description": null, - "host_tools": null, - "std": null, - "tier": null - }, - "panic-strategy": "abort", - "simd-types-indirect": false, - "target-pointer-width": 32 + "allows-weak-linkage": false, + "arch": "spirv", + "crt-objects-fallback": "false", + "crt-static-allows-dylibs": true, + "crt-static-respected": true, + "data-layout": "e-m:e-p:32:32:32-i64:64-n8:16:32:64", + "dll-prefix": "", + "dll-suffix": ".spv.json", + "dynamic-linking": true, + "emit-debug-gdb-scripts": false, + "env": "vulkan1.4", + "linker-flavor": "unix", + "linker-is-gnu": false, + "llvm-target": "spirv-unknown-vulkan1.4", + "main-needs-argc-argv": false, + "metadata": { + "description": null, + "host_tools": null, + "std": null, + "tier": null + }, + "panic-strategy": "abort", + "simd-types-indirect": false, + "target-pointer-width": "32" } From 280f4fd36efe9248828fccc467f80cefc1597780 Mon Sep 17 00:00:00 2001 From: David Palm Date: Thu, 6 Nov 2025 11:21:52 +0100 Subject: [PATCH 13/16] Update target specs to new format --- .../target-specs/spirv-unknown-opengl4.0.json | 2 +- .../target-specs/spirv-unknown-opengl4.1.json | 2 +- .../target-specs/spirv-unknown-opengl4.2.json | 2 +- .../target-specs/spirv-unknown-opengl4.3.json | 2 +- .../target-specs/spirv-unknown-opengl4.5.json | 2 +- .../target-specs/spirv-unknown-spv1.0.json | 2 +- .../target-specs/spirv-unknown-spv1.1.json | 2 +- .../target-specs/spirv-unknown-spv1.2.json | 2 +- .../target-specs/spirv-unknown-spv1.3.json | 2 +- .../target-specs/spirv-unknown-spv1.4.json | 2 +- .../target-specs/spirv-unknown-spv1.5.json | 2 +- .../target-specs/spirv-unknown-spv1.6.json | 2 +- .../target-specs/spirv-unknown-vulkan1.0.json | 2 +- .../target-specs/spirv-unknown-vulkan1.1.json | 2 +- .../target-specs/spirv-unknown-vulkan1.1spv1.4.json | 2 +- .../target-specs/spirv-unknown-vulkan1.2.json | 2 +- .../target-specs/spirv-unknown-vulkan1.3.json | 2 +- .../target-specs/spirv-unknown-vulkan1.4.json | 2 +- 18 files changed, 18 insertions(+), 18 deletions(-) diff --git a/crates/rustc_codegen_spirv-target-specs/target-specs/spirv-unknown-opengl4.0.json b/crates/rustc_codegen_spirv-target-specs/target-specs/spirv-unknown-opengl4.0.json index d76e303e2a..bd8b2dc060 100644 --- a/crates/rustc_codegen_spirv-target-specs/target-specs/spirv-unknown-opengl4.0.json +++ b/crates/rustc_codegen_spirv-target-specs/target-specs/spirv-unknown-opengl4.0.json @@ -22,5 +22,5 @@ }, "panic-strategy": "abort", "simd-types-indirect": false, - "target-pointer-width": "32" + "target-pointer-width": 32 } diff --git a/crates/rustc_codegen_spirv-target-specs/target-specs/spirv-unknown-opengl4.1.json b/crates/rustc_codegen_spirv-target-specs/target-specs/spirv-unknown-opengl4.1.json index 10eaa2f6ed..1d6001c63b 100644 --- a/crates/rustc_codegen_spirv-target-specs/target-specs/spirv-unknown-opengl4.1.json +++ b/crates/rustc_codegen_spirv-target-specs/target-specs/spirv-unknown-opengl4.1.json @@ -22,5 +22,5 @@ }, "panic-strategy": "abort", "simd-types-indirect": false, - "target-pointer-width": "32" + "target-pointer-width": 32 } diff --git a/crates/rustc_codegen_spirv-target-specs/target-specs/spirv-unknown-opengl4.2.json b/crates/rustc_codegen_spirv-target-specs/target-specs/spirv-unknown-opengl4.2.json index 9a8e14bced..c740a16dcc 100644 --- a/crates/rustc_codegen_spirv-target-specs/target-specs/spirv-unknown-opengl4.2.json +++ b/crates/rustc_codegen_spirv-target-specs/target-specs/spirv-unknown-opengl4.2.json @@ -22,5 +22,5 @@ }, "panic-strategy": "abort", "simd-types-indirect": false, - "target-pointer-width": "32" + "target-pointer-width": 32 } diff --git a/crates/rustc_codegen_spirv-target-specs/target-specs/spirv-unknown-opengl4.3.json b/crates/rustc_codegen_spirv-target-specs/target-specs/spirv-unknown-opengl4.3.json index a164073671..e2075fc542 100644 --- a/crates/rustc_codegen_spirv-target-specs/target-specs/spirv-unknown-opengl4.3.json +++ b/crates/rustc_codegen_spirv-target-specs/target-specs/spirv-unknown-opengl4.3.json @@ -22,5 +22,5 @@ }, "panic-strategy": "abort", "simd-types-indirect": false, - "target-pointer-width": "32" + "target-pointer-width": 32 } diff --git a/crates/rustc_codegen_spirv-target-specs/target-specs/spirv-unknown-opengl4.5.json b/crates/rustc_codegen_spirv-target-specs/target-specs/spirv-unknown-opengl4.5.json index 00d23b035d..0a7a491a23 100644 --- a/crates/rustc_codegen_spirv-target-specs/target-specs/spirv-unknown-opengl4.5.json +++ b/crates/rustc_codegen_spirv-target-specs/target-specs/spirv-unknown-opengl4.5.json @@ -22,5 +22,5 @@ }, "panic-strategy": "abort", "simd-types-indirect": false, - "target-pointer-width": "32" + "target-pointer-width": 32 } diff --git a/crates/rustc_codegen_spirv-target-specs/target-specs/spirv-unknown-spv1.0.json b/crates/rustc_codegen_spirv-target-specs/target-specs/spirv-unknown-spv1.0.json index b1f7f910c3..7a71f1d436 100644 --- a/crates/rustc_codegen_spirv-target-specs/target-specs/spirv-unknown-spv1.0.json +++ b/crates/rustc_codegen_spirv-target-specs/target-specs/spirv-unknown-spv1.0.json @@ -22,5 +22,5 @@ }, "panic-strategy": "abort", "simd-types-indirect": false, - "target-pointer-width": "32" + "target-pointer-width": 32 } diff --git a/crates/rustc_codegen_spirv-target-specs/target-specs/spirv-unknown-spv1.1.json b/crates/rustc_codegen_spirv-target-specs/target-specs/spirv-unknown-spv1.1.json index 4319c16514..792359e156 100644 --- a/crates/rustc_codegen_spirv-target-specs/target-specs/spirv-unknown-spv1.1.json +++ b/crates/rustc_codegen_spirv-target-specs/target-specs/spirv-unknown-spv1.1.json @@ -22,5 +22,5 @@ }, "panic-strategy": "abort", "simd-types-indirect": false, - "target-pointer-width": "32" + "target-pointer-width": 32 } diff --git a/crates/rustc_codegen_spirv-target-specs/target-specs/spirv-unknown-spv1.2.json b/crates/rustc_codegen_spirv-target-specs/target-specs/spirv-unknown-spv1.2.json index 43a4ec9bd8..270de9f895 100644 --- a/crates/rustc_codegen_spirv-target-specs/target-specs/spirv-unknown-spv1.2.json +++ b/crates/rustc_codegen_spirv-target-specs/target-specs/spirv-unknown-spv1.2.json @@ -22,5 +22,5 @@ }, "panic-strategy": "abort", "simd-types-indirect": false, - "target-pointer-width": "32" + "target-pointer-width": 32 } diff --git a/crates/rustc_codegen_spirv-target-specs/target-specs/spirv-unknown-spv1.3.json b/crates/rustc_codegen_spirv-target-specs/target-specs/spirv-unknown-spv1.3.json index 3903cdba51..b3920a95e0 100644 --- a/crates/rustc_codegen_spirv-target-specs/target-specs/spirv-unknown-spv1.3.json +++ b/crates/rustc_codegen_spirv-target-specs/target-specs/spirv-unknown-spv1.3.json @@ -22,5 +22,5 @@ }, "panic-strategy": "abort", "simd-types-indirect": false, - "target-pointer-width": "32" + "target-pointer-width": 32 } diff --git a/crates/rustc_codegen_spirv-target-specs/target-specs/spirv-unknown-spv1.4.json b/crates/rustc_codegen_spirv-target-specs/target-specs/spirv-unknown-spv1.4.json index a645839c76..194f11f98c 100644 --- a/crates/rustc_codegen_spirv-target-specs/target-specs/spirv-unknown-spv1.4.json +++ b/crates/rustc_codegen_spirv-target-specs/target-specs/spirv-unknown-spv1.4.json @@ -22,5 +22,5 @@ }, "panic-strategy": "abort", "simd-types-indirect": false, - "target-pointer-width": "32" + "target-pointer-width": 32 } diff --git a/crates/rustc_codegen_spirv-target-specs/target-specs/spirv-unknown-spv1.5.json b/crates/rustc_codegen_spirv-target-specs/target-specs/spirv-unknown-spv1.5.json index 67a2fb375f..3b30eded11 100644 --- a/crates/rustc_codegen_spirv-target-specs/target-specs/spirv-unknown-spv1.5.json +++ b/crates/rustc_codegen_spirv-target-specs/target-specs/spirv-unknown-spv1.5.json @@ -22,5 +22,5 @@ }, "panic-strategy": "abort", "simd-types-indirect": false, - "target-pointer-width": "32" + "target-pointer-width": 32 } diff --git a/crates/rustc_codegen_spirv-target-specs/target-specs/spirv-unknown-spv1.6.json b/crates/rustc_codegen_spirv-target-specs/target-specs/spirv-unknown-spv1.6.json index 0208756e96..48af25ee9d 100644 --- a/crates/rustc_codegen_spirv-target-specs/target-specs/spirv-unknown-spv1.6.json +++ b/crates/rustc_codegen_spirv-target-specs/target-specs/spirv-unknown-spv1.6.json @@ -22,5 +22,5 @@ }, "panic-strategy": "abort", "simd-types-indirect": false, - "target-pointer-width": "32" + "target-pointer-width": 32 } diff --git a/crates/rustc_codegen_spirv-target-specs/target-specs/spirv-unknown-vulkan1.0.json b/crates/rustc_codegen_spirv-target-specs/target-specs/spirv-unknown-vulkan1.0.json index 468d7e6049..d78f173b00 100644 --- a/crates/rustc_codegen_spirv-target-specs/target-specs/spirv-unknown-vulkan1.0.json +++ b/crates/rustc_codegen_spirv-target-specs/target-specs/spirv-unknown-vulkan1.0.json @@ -22,5 +22,5 @@ }, "panic-strategy": "abort", "simd-types-indirect": false, - "target-pointer-width": "32" + "target-pointer-width": 32 } diff --git a/crates/rustc_codegen_spirv-target-specs/target-specs/spirv-unknown-vulkan1.1.json b/crates/rustc_codegen_spirv-target-specs/target-specs/spirv-unknown-vulkan1.1.json index b75eaa7dd9..94a9245283 100644 --- a/crates/rustc_codegen_spirv-target-specs/target-specs/spirv-unknown-vulkan1.1.json +++ b/crates/rustc_codegen_spirv-target-specs/target-specs/spirv-unknown-vulkan1.1.json @@ -22,5 +22,5 @@ }, "panic-strategy": "abort", "simd-types-indirect": false, - "target-pointer-width": "32" + "target-pointer-width": 32 } diff --git a/crates/rustc_codegen_spirv-target-specs/target-specs/spirv-unknown-vulkan1.1spv1.4.json b/crates/rustc_codegen_spirv-target-specs/target-specs/spirv-unknown-vulkan1.1spv1.4.json index 66eaba431b..666d4c228b 100644 --- a/crates/rustc_codegen_spirv-target-specs/target-specs/spirv-unknown-vulkan1.1spv1.4.json +++ b/crates/rustc_codegen_spirv-target-specs/target-specs/spirv-unknown-vulkan1.1spv1.4.json @@ -22,5 +22,5 @@ }, "panic-strategy": "abort", "simd-types-indirect": false, - "target-pointer-width": "32" + "target-pointer-width": 32 } diff --git a/crates/rustc_codegen_spirv-target-specs/target-specs/spirv-unknown-vulkan1.2.json b/crates/rustc_codegen_spirv-target-specs/target-specs/spirv-unknown-vulkan1.2.json index 34032c502a..86ff34ebec 100644 --- a/crates/rustc_codegen_spirv-target-specs/target-specs/spirv-unknown-vulkan1.2.json +++ b/crates/rustc_codegen_spirv-target-specs/target-specs/spirv-unknown-vulkan1.2.json @@ -22,5 +22,5 @@ }, "panic-strategy": "abort", "simd-types-indirect": false, - "target-pointer-width": "32" + "target-pointer-width": 32 } diff --git a/crates/rustc_codegen_spirv-target-specs/target-specs/spirv-unknown-vulkan1.3.json b/crates/rustc_codegen_spirv-target-specs/target-specs/spirv-unknown-vulkan1.3.json index ef4d7c2726..f82b6ba75d 100644 --- a/crates/rustc_codegen_spirv-target-specs/target-specs/spirv-unknown-vulkan1.3.json +++ b/crates/rustc_codegen_spirv-target-specs/target-specs/spirv-unknown-vulkan1.3.json @@ -22,5 +22,5 @@ }, "panic-strategy": "abort", "simd-types-indirect": false, - "target-pointer-width": "32" + "target-pointer-width": 32 } diff --git a/crates/rustc_codegen_spirv-target-specs/target-specs/spirv-unknown-vulkan1.4.json b/crates/rustc_codegen_spirv-target-specs/target-specs/spirv-unknown-vulkan1.4.json index f2b4d8ad37..cd66214874 100644 --- a/crates/rustc_codegen_spirv-target-specs/target-specs/spirv-unknown-vulkan1.4.json +++ b/crates/rustc_codegen_spirv-target-specs/target-specs/spirv-unknown-vulkan1.4.json @@ -22,5 +22,5 @@ }, "panic-strategy": "abort", "simd-types-indirect": false, - "target-pointer-width": "32" + "target-pointer-width": 32 } From 532495771922bf00f0030aac438fbb982f06c25e Mon Sep 17 00:00:00 2001 From: David Palm Date: Thu, 6 Nov 2025 11:26:56 +0100 Subject: [PATCH 14/16] Revert "Merge branch 'main' into update-toolchain-Nov-02-2025" This reverts commit 716e6de5fe52d5922e845e23634e5c5d247018e5, reversing changes made to 27398fd6a956e5b663ac5508930228a549e34543. --- crates/rustc_codegen_spirv/build.rs | 11 +- crates/rustc_codegen_spirv/src/attr.rs | 3 - .../src/builder/builder_methods.rs | 779 ++++- .../src/builder/format_args_decompiler.rs | 811 ----- crates/rustc_codegen_spirv/src/builder/mod.rs | 1 - .../src/codegen_cx/entry.rs | 82 +- .../src/linker/simple_passes.rs | 16 +- crates/rustc_codegen_spirv/src/linker/test.rs | 2 +- crates/spirv-std/macros/src/debug_printf.rs | 249 -- crates/spirv-std/macros/src/lib.rs | 456 ++- .../macros/src/sample_param_permutations.rs | 204 -- crates/spirv-std/src/arch.rs | 8 +- crates/spirv-std/src/arch/atomics.rs | 6 +- crates/spirv-std/src/arch/subgroup.rs | 74 +- crates/spirv-std/src/debug_printf.rs | 13 - crates/spirv-std/src/float.rs | 18 + crates/spirv-std/src/image.rs | 19 +- crates/spirv-std/src/image/params.rs | 56 +- crates/spirv-std/src/integer.rs | 52 + crates/spirv-std/src/lib.rs | 29 +- crates/spirv-std/src/number.rs | 15 + crates/spirv-std/src/scalar.rs | 112 +- crates/spirv-std/src/scalar_or_vector.rs | 22 - crates/spirv-std/src/sealed.rs | 30 + crates/spirv-std/src/vector.rs | 69 +- examples/runners/ash/build.rs | 8 + examples/runners/ash/src/main.rs | 11 + examples/runners/wgpu/build.rs | 14 +- examples/runners/wgpu/builder/src/main.rs | 3 - examples/runners/wgpu/src/lib.rs | 11 + tests/compiletests/src/main.rs | 1 - tests/compiletests/ui/arch/all.rs | 2 + tests/compiletests/ui/arch/any.rs | 2 + .../ui/arch/debug_printf_type_checking.stderr | 195 +- .../ui/arch/subgroup/subgroup_ballot.rs | 1 - .../ui/arch/subgroup/subgroup_ballot.stderr | 2 + .../subgroup/subgroup_ballot_bit_count.rs | 1 - .../subgroup/subgroup_ballot_bit_count.stderr | 1 + .../ui/arch/subgroup/subgroup_broadcast.rs | 25 - .../arch/subgroup/subgroup_broadcast.stderr | 8 - .../arch/subgroup/subgroup_broadcast_const.rs | 18 - .../subgroup/subgroup_broadcast_const.stderr | 7 - .../arch/subgroup/subgroup_broadcast_first.rs | 1 - .../subgroup/subgroup_broadcast_first.stderr | 1 + .../subgroup_cluster_size_0_fail.stderr | 50 +- ..._cluster_size_non_power_of_two_fail.stderr | 50 +- .../ui/arch/subgroup/subgroup_elect.rs | 1 - .../ui/arch/subgroup/subgroup_elect.stderr | 1 + .../arch/subgroup/subgroup_i_add_clustered.rs | 1 - .../subgroup/subgroup_i_add_clustered.stderr | 1 + .../subgroup/subgroup_i_add_exclusive_scan.rs | 1 - .../subgroup_i_add_exclusive_scan.stderr | 1 + .../subgroup/subgroup_i_add_inclusive_scan.rs | 1 - .../subgroup_i_add_inclusive_scan.stderr | 1 + .../ui/arch/subgroup/subgroup_i_add_reduce.rs | 1 - .../subgroup/subgroup_i_add_reduce.stderr | 1 + .../ui/dis/ptr_copy.normal.stderr | 104 +- .../compiletests/ui/dis/scalars.nocaps.stderr | 26 +- .../ui/dis/spec_constant_array.rs | 28 - .../ui/dis/spec_constant_array.stderr | 38 - .../ui/glam/invalid_vector_type.stderr | 14 +- tests/compiletests/ui/image/gather_err.stderr | 60 +- .../ui/image/implicit_not_in_fragment.stderr | 24 +- .../ui/image/query/query_levels_err.stderr | 34 +- .../ui/image/query/query_lod_err.stderr | 32 +- .../ui/image/query/query_size_err.stderr | 44 +- .../ui/image/query/query_size_lod_err.stderr | 32 +- ...mpled_image_rect_query_size_lod_err.stderr | 32 +- .../ui/lang/asm/block_tracking_fail.stderr | 6 +- .../ui/lang/asm/issue-1002.stderr | 18 +- .../consts/nested-ref-in-composite.stderr | 12 +- .../ui/lang/consts/nested-ref.stderr | 4 +- .../ui/lang/consts/u32-from-u64-fail.stderr | 2 +- .../core/ptr/allocate_const_scalar.stderr | 18 +- .../ui/lang/core/ptr/allocate_vec_like.stderr | 14 +- .../core/ref/member_ref_arg-broken.stderr | 14 +- .../ui/lang/core/ref/member_ref_arg.stderr | 4 +- .../core/ref/zst_member_ref_arg-broken.stderr | 54 +- tests/compiletests/ui/lang/issue-452.rs | 18 - tests/compiletests/ui/lang/issue-452.stderr | 47 - .../ui/lang/panic/track_caller.stderr | 2 +- .../bad-deduce-storage-class.stderr | 28 +- .../ui/spirv-attr/bool-inputs-err.stderr | 8 +- .../ui/spirv-attr/int-without-flat.stderr | 16 +- .../invalid-matrix-type-empty.stderr | 8 +- .../ui/spirv-attr/invalid-matrix-type.stderr | 12 +- .../spirv-attr/invalid-storage-class.stderr | 16 +- .../ui/spirv-attr/invalid-target.stderr | 3036 ++++++++--------- .../ui/spirv-attr/invariant-invalid.stderr | 8 +- .../ui/spirv-attr/multiple.stderr | 84 +- .../ui/storage_class/mutability-errors.stderr | 26 +- .../runtime_descriptor_array_error.stderr | 16 +- 92 files changed, 3627 insertions(+), 3871 deletions(-) delete mode 100644 crates/rustc_codegen_spirv/src/builder/format_args_decompiler.rs delete mode 100644 crates/spirv-std/macros/src/debug_printf.rs delete mode 100644 crates/spirv-std/macros/src/sample_param_permutations.rs delete mode 100644 crates/spirv-std/src/debug_printf.rs create mode 100644 crates/spirv-std/src/integer.rs create mode 100644 crates/spirv-std/src/number.rs delete mode 100644 crates/spirv-std/src/scalar_or_vector.rs create mode 100644 crates/spirv-std/src/sealed.rs create mode 100644 examples/runners/ash/build.rs delete mode 100644 tests/compiletests/ui/arch/subgroup/subgroup_broadcast.rs delete mode 100644 tests/compiletests/ui/arch/subgroup/subgroup_broadcast.stderr delete mode 100644 tests/compiletests/ui/arch/subgroup/subgroup_broadcast_const.rs delete mode 100644 tests/compiletests/ui/arch/subgroup/subgroup_broadcast_const.stderr delete mode 100644 tests/compiletests/ui/dis/spec_constant_array.rs delete mode 100644 tests/compiletests/ui/dis/spec_constant_array.stderr delete mode 100644 tests/compiletests/ui/lang/issue-452.rs delete mode 100644 tests/compiletests/ui/lang/issue-452.stderr diff --git a/crates/rustc_codegen_spirv/build.rs b/crates/rustc_codegen_spirv/build.rs index 5b7bb40294..6aff010550 100644 --- a/crates/rustc_codegen_spirv/build.rs +++ b/crates/rustc_codegen_spirv/build.rs @@ -8,7 +8,6 @@ use std::collections::VecDeque; use std::error::Error; use std::path::{Path, PathBuf}; use std::process::{Command, ExitCode}; -use std::string::ToString; use std::{env, fs, mem}; /// Current `rust-toolchain.toml` file @@ -34,7 +33,7 @@ fn get_rustc_commit_hash() -> Result> { rustc_output("-vV")? .lines() .find_map(|l| l.strip_prefix("commit-hash: ")) - .map(ToString::to_string) + .map(|s| s.to_string()) .ok_or_else(|| "`commit-hash` not found in `rustc -vV` output".into()) } @@ -42,7 +41,7 @@ fn get_required_commit_hash() -> Result> { REQUIRED_RUST_TOOLCHAIN .lines() .find_map(|l| l.strip_prefix("# commit_hash = ")) - .map(ToString::to_string) + .map(|s| s.to_string()) .ok_or_else(|| "`commit_hash` not found in `rust-toolchain.toml`".into()) } @@ -73,16 +72,16 @@ fn check_toolchain_version() -> Result<(), Box> { let stripped_toolchain = REQUIRED_RUST_TOOLCHAIN .lines() .filter(|l| !l.trim().is_empty() && !l.starts_with("# ")) - .map(ToString::to_string) + .map(|l| l.to_string()) .reduce(|a, b| a + "\n" + &b) .unwrap_or_default(); return Err(format!( - "error: wrong toolchain detected (found commit hash `{current_hash}`, expected `{required_hash}`). + r#"error: wrong toolchain detected (found commit hash `{current_hash}`, expected `{required_hash}`). Make sure your `rust-toolchain.toml` file contains the following: ------------- {stripped_toolchain} --------------" +-------------"# ).into()); } } diff --git a/crates/rustc_codegen_spirv/src/attr.rs b/crates/rustc_codegen_spirv/src/attr.rs index e56f96c2a5..9be755e687 100644 --- a/crates/rustc_codegen_spirv/src/attr.rs +++ b/crates/rustc_codegen_spirv/src/attr.rs @@ -75,7 +75,6 @@ pub enum IntrinsicType { pub struct SpecConstant { pub id: u32, pub default: Option, - pub array_count: Option, } // NOTE(eddyb) when adding new `#[spirv(...)]` attributes, the tests found inside @@ -662,8 +661,6 @@ fn parse_spec_constant_attr( Ok(SpecConstant { id: id.ok_or_else(|| (arg.span(), "expected `spec_constant(id = ...)`".into()))?, default, - // to be set later - array_count: None, }) } diff --git a/crates/rustc_codegen_spirv/src/builder/builder_methods.rs b/crates/rustc_codegen_spirv/src/builder/builder_methods.rs index 8b86a9a6d4..d17d82b177 100644 --- a/crates/rustc_codegen_spirv/src/builder/builder_methods.rs +++ b/crates/rustc_codegen_spirv/src/builder/builder_methods.rs @@ -7,9 +7,9 @@ use crate::builder_spirv::{ SpirvBlockCursor, SpirvConst, SpirvValue, SpirvValueExt, SpirvValueKind, }; use crate::codegen_cx::CodegenCx; -use crate::custom_insts::CustomInst; +use crate::custom_insts::{CustomInst, CustomOp}; use crate::spirv_type::SpirvType; -use itertools::Itertools; +use itertools::{Either, Itertools}; use rspirv::dr::{InsertPoint, Instruction, Operand}; use rspirv::spirv::{Capability, MemoryModel, MemorySemantics, Op, Scope, StorageClass, Word}; use rustc_abi::{Align, BackendRepr, Scalar, Size, WrappingRange}; @@ -24,16 +24,19 @@ use rustc_codegen_ssa::traits::{ BackendTypes, BaseTypeCodegenMethods, BuilderMethods, ConstCodegenMethods, LayoutTypeCodegenMethods, OverflowOp, }; +use rustc_data_structures::fx::FxHashSet; use rustc_middle::bug; use rustc_middle::middle::codegen_fn_attrs::CodegenFnAttrs; +use rustc_middle::ty::layout::LayoutOf; use rustc_middle::ty::{self, AtomicOrdering, Ty}; use rustc_span::Span; use rustc_target::callconv::FnAbi; use smallvec::SmallVec; +use std::borrow::Cow; +use std::cell::Cell; use std::iter::{self, empty}; use std::ops::{BitAnd, BitOr, BitXor, Not, RangeInclusive}; -use crate::builder::format_args_decompiler::{CodegenPanic, DecodedFormatArgs}; use tracing::{Level, instrument, span}; use tracing::{trace, warn}; @@ -3340,8 +3343,774 @@ impl<'a, 'tcx> BuilderMethods<'a, 'tcx> for Builder<'a, 'tcx> { } if is_panic_entry_point { - return DecodedFormatArgs::try_decode_and_remove_format_args(self, args) - .codegen_panic(self, result_type); + // HACK(eddyb) Rust 2021 `panic!` always uses `format_args!`, even + // in the simple case that used to pass a `&str` constant, which + // would not remain reachable in the SPIR-V - but `format_args!` is + // more complex and neither immediate (`fmt::Arguments` is too big) + // nor simplified in MIR (e.g. promoted to a constant) in any way, + // so we have to try and remove the `fmt::Arguments::new` call here. + #[derive(Default)] + struct DecodedFormatArgs<'tcx> { + /// If fully constant, the `pieces: &'a [&'static str]` input + /// of `fmt::Arguments<'a>` (i.e. the strings between args). + const_pieces: Option>, + + /// Original references for `fmt::Arguments<'a>` dynamic arguments, + /// i.e. the `&'a T` passed to `fmt::rt::Argument::<'a>::new_*`, + /// tracking the type `T` and `char` formatting specifier. + /// + /// E.g. for `format_args!("{a} {b:x}")` they'll be: + /// * `&a` with `typeof a` and ' ', + /// * `&b` with `typeof b` and 'x' + ref_arg_ids_with_ty_and_spec: SmallVec<[(Word, Ty<'tcx>, char); 2]>, + + /// If `fmt::Arguments::new_v1_formatted` was used, this holds + /// the length of the `&[fmt::rt::Placeholder]` slice, which + /// currently cannot be directly supported, and therefore even + /// if all of `ref_arg_ids_with_ty_and_spec` are printable, + /// a much jankier fallback still has to be used, as it it were: + /// + /// `format!("a{{0}}b{{1}}c\n with {{…}} from: {}, {}", x, y)` + /// (w/ `const_pieces = ["a", "b", "c"]` & `ref_args = [&x, &y]`). + has_unknown_fmt_placeholder_to_args_mapping: Option, + } + struct FormatArgsNotRecognized(String); + + // HACK(eddyb) this is basically a `try` block. + let mut try_decode_and_remove_format_args = || { + let mut decoded_format_args = DecodedFormatArgs::default(); + + // HACK(eddyb) work around mutable borrowing conflicts. + let cx = self.cx; + + let const_u32_as_usize = |ct_id| match cx.builder.lookup_const_by_id(ct_id)? { + SpirvConst::Scalar(x) => Some(u32::try_from(x).ok()? as usize), + _ => None, + }; + let const_slice_as_elem_ids = |ptr_id: Word, len: usize| { + if let SpirvConst::PtrTo { pointee } = cx.builder.lookup_const_by_id(ptr_id)? + && let SpirvConst::Composite(elems) = + cx.builder.lookup_const_by_id(pointee)? + && elems.len() == len + { + return Some(elems); + } + None + }; + let const_str_as_utf8 = |&[str_ptr_id, str_len_id]: &[Word; 2]| { + let str_len = const_u32_as_usize(str_len_id)?; + let piece_str_bytes = const_slice_as_elem_ids(str_ptr_id, str_len)? + .iter() + .map(|&id| u8::try_from(const_u32_as_usize(id)?).ok()) + .collect::>>()?; + String::from_utf8(piece_str_bytes).ok() + }; + + // HACK(eddyb) `panic_explicit` doesn't take any regular arguments, + // only an (implicit) `&'static panic::Location<'static>`. + if args.len() == 1 { + decoded_format_args.const_pieces = + Some(["explicit panic".into()].into_iter().collect()); + return Ok(decoded_format_args); + } + + // HACK(eddyb) some entry-points only take a `&str`, not `fmt::Arguments`. + if let [ + SpirvValue { + kind: SpirvValueKind::Def(a_id), + .. + }, + SpirvValue { + kind: SpirvValueKind::Def(b_id), + .. + }, + ref other_args @ .., + ] = args[..] + { + // Optional `&'static panic::Location<'static>`. + if other_args.len() <= 1 + && let Some(const_msg) = const_str_as_utf8(&[a_id, b_id]) + { + decoded_format_args.const_pieces = Some([const_msg].into_iter().collect()); + return Ok(decoded_format_args); + } + } + + let format_args_id = match *args { + // HACK(eddyb) `panic_nounwind_fmt` takes an extra argument. + [ + SpirvValue { + kind: SpirvValueKind::Def(format_args_id), + .. + }, + _, // `&'static panic::Location<'static>` + ] + | [ + SpirvValue { + kind: SpirvValueKind::Def(format_args_id), + .. + }, + _, // `force_no_backtrace: bool` + _, // `&'static panic::Location<'static>` + ] => format_args_id, + + _ => { + return Err(FormatArgsNotRecognized( + "panic entry-point call args".into(), + )); + } + }; + + let custom_ext_inst_set_import = self.ext_inst.borrow_mut().import_custom(self); + + // HACK(eddyb) we can remove SSA instructions even when they have + // side-effects, *as long as* they are "local" enough and cannot + // be observed from outside this current invocation - because the + // the abort, any SSA definitions or local variable writes can't + // be actually used anywhere else (other than *before* the abort). + let mut builder = self.emit(); + let func_idx = builder.selected_function().unwrap(); + let block_idx = builder.selected_block().unwrap(); + let func = &mut builder.module_mut().functions[func_idx]; + + // HACK(eddyb) this is used to check that all `Op{Store,Load}`s + // that may get removed, operate on local `OpVariable`s, + // i.e. are not externally observable. + let local_var_ids: FxHashSet<_> = func.blocks[0] + .instructions + .iter() + .take_while(|inst| inst.class.opcode == Op::Variable) + .map(|inst| inst.result_id.unwrap()) + .collect(); + let require_local_var = |ptr_id, var| { + Some(()) + .filter(|()| local_var_ids.contains(&ptr_id)) + .ok_or_else(|| FormatArgsNotRecognized(format!("{var} storage not local"))) + }; + + let mut non_debug_insts = func.blocks[block_idx] + .instructions + .iter() + .enumerate() + .filter(|(_, inst)| { + let is_standard_debug = [Op::Line, Op::NoLine].contains(&inst.class.opcode); + let is_custom_debug = inst.class.opcode == Op::ExtInst + && inst.operands[0].unwrap_id_ref() == custom_ext_inst_set_import + && CustomOp::decode_from_ext_inst(inst).is_debuginfo(); + !(is_standard_debug || is_custom_debug) + }); + + // HACK(eddyb) to aid in pattern-matching, relevant instructions + // are decoded to values of this `enum`. For instructions that + // produce results, the result ID is the first `ID` value. + #[derive(Debug)] + enum Inst { + Bitcast(ID, ID), + CompositeExtract(ID, ID, u32), + InBoundsAccessChain(ID, ID, u32), + InBoundsAccessChain2(ID, ID, u32, u32), + Store(ID, ID), + Load(ID, ID), + CopyMemory(ID, ID), + Call(ID, ID, SmallVec<[ID; 4]>), + + // HACK(eddyb) this only exists for better error reporting, + // as `Result, Op>` would only report one `Op`. + Unsupported( + // HACK(eddyb) only exists for `fmt::Debug` in case of error. + #[allow(dead_code)] Op, + ), + } + + let taken_inst_idx_range = Cell::new(func.blocks[block_idx].instructions.len())..; + + // Take `count` instructions, advancing backwards, but returning + // instructions in their original order (and decoded to `Inst`s). + let mut try_rev_take = |count: isize| { + // HACK(eddyb) this is extremely silly but it's easier to do + // this than to rely on `Iterator::peekable` or anything else, + // lower down this file, without messing up the state here. + let is_peek = count < 0; + let count = count.unsigned_abs(); + + let mut non_debug_insts_for_peek = is_peek.then(|| non_debug_insts.clone()); + let non_debug_insts = non_debug_insts_for_peek + .as_mut() + .unwrap_or(&mut non_debug_insts); + + // FIXME(eddyb) there might be an easier way to do this, + // e.g. maybe `map_while` + post-`collect` length check? + let maybe_rev_insts = (0..count).map(|_| { + let (i, inst) = non_debug_insts.next_back()?; + if !is_peek { + taken_inst_idx_range.start.set(i); + } + + // HACK(eddyb) avoid the logic below that assumes only ID operands + if inst.class.opcode == Op::CompositeExtract + && let (Some(r), &[Operand::IdRef(x), Operand::LiteralBit32(i)]) = + (inst.result_id, &inst.operands[..]) + { + return Some(Inst::CompositeExtract(r, x, i)); + } + + // HACK(eddyb) all instructions accepted below + // are expected to take no more than 4 operands, + // and this is easier to use than an iterator. + let id_operands = inst + .operands + .iter() + .map(|operand| operand.id_ref_any()) + .collect::>>()?; + + let const_as_u32 = |id| match self.builder.lookup_const_by_id(id)? { + SpirvConst::Scalar(x) => u32::try_from(x).ok(), + _ => None, + }; + + // Decode the instruction into one of our `Inst`s. + Some( + match (inst.class.opcode, inst.result_id, &id_operands[..]) { + (Op::Bitcast, Some(r), &[x]) => Inst::Bitcast(r, x), + (Op::InBoundsAccessChain, Some(r), &[p, i]) => { + if let Some(i) = const_as_u32(i) { + Inst::InBoundsAccessChain(r, p, i) + } else { + Inst::Unsupported(inst.class.opcode) + } + } + (Op::InBoundsAccessChain, Some(r), &[p, i, j]) => { + if let [Some(i), Some(j)] = [i, j].map(const_as_u32) { + Inst::InBoundsAccessChain2(r, p, i, j) + } else { + Inst::Unsupported(inst.class.opcode) + } + } + (Op::Store, None, &[p, v]) => Inst::Store(p, v), + (Op::Load, Some(r), &[p]) => Inst::Load(r, p), + (Op::CopyMemory, None, &[a, b]) => Inst::CopyMemory(a, b), + (Op::FunctionCall, Some(r), [f, args @ ..]) => { + Inst::Call(r, *f, args.iter().copied().collect()) + } + _ => Inst::Unsupported(inst.class.opcode), + }, + ) + }); + let mut insts = maybe_rev_insts.collect::>>()?; + insts.reverse(); + Some(insts) + }; + let fmt_args_new_call_insts = try_rev_take(3).ok_or_else(|| { + FormatArgsNotRecognized( + "fmt::Arguments::new call: ran out of instructions".into(), + ) + })?; + let ((pieces_slice_ptr_id, pieces_len), (rt_args_slice_ptr_id, rt_args_count)) = + match fmt_args_new_call_insts[..] { + [ + Inst::Call(call_ret_id, callee_id, ref call_args), + Inst::Store(st_dst_id, st_val_id), + Inst::Load(ld_val_id, ld_src_id), + ] if call_ret_id == st_val_id + && st_dst_id == ld_src_id + && ld_val_id == format_args_id => + { + require_local_var(st_dst_id, "fmt::Arguments::new destination")?; + + let Some(&(pieces_len, rt_args_count)) = + self.fmt_args_new_fn_ids.borrow().get(&callee_id) + else { + return Err(FormatArgsNotRecognized( + "fmt::Arguments::new callee not registered".into(), + )); + }; + + match call_args[..] { + // `::new_v1_formatted` + // + // HACK(eddyb) this isn't fully supported, + // as that would require digging into unstable + // internals of `core::fmt::rt::Placeholder`s, + // but the whole call still needs to be removed, + // and both const str pieces and runtime args + // can still be printed (even if in jankier way). + [ + pieces_slice_ptr_id, + pieces_len_id, + rt_args_slice_ptr_id, + rt_args_len_id, + fmt_placeholders_slice_ptr_id, + fmt_placeholders_len_id, + ] if (pieces_len, rt_args_count) == (!0, !0) => { + let [pieces_len, rt_args_len, fmt_placeholders_len] = match [ + pieces_len_id, + rt_args_len_id, + fmt_placeholders_len_id, + ] + .map(const_u32_as_usize) + { + [Some(a), Some(b), Some(c)] => [a, b, c], + _ => { + return Err(FormatArgsNotRecognized( + "fmt::Arguments::new_v1_formatted \ + with dynamic lengths" + .into(), + )); + } + }; + + let prepare_args_insts = try_rev_take(2).ok_or_else(|| { + FormatArgsNotRecognized( + "fmt::Arguments::new_v1_formatted call: ran out of instructions".into(), + ) + })?; + let (rt_args_slice_ptr_id, _fmt_placeholders_slice_ptr_id) = + match prepare_args_insts[..] { + [ + Inst::Bitcast( + rt_args_cast_out_id, + rt_args_cast_in_id, + ), + Inst::Bitcast( + placeholders_cast_out_id, + placeholders_cast_in_id, + ), + ] if rt_args_cast_out_id == rt_args_slice_ptr_id + && placeholders_cast_out_id + == fmt_placeholders_slice_ptr_id => + { + (rt_args_cast_in_id, placeholders_cast_in_id) + } + _ => { + let mut insts = prepare_args_insts; + insts.extend(fmt_args_new_call_insts); + return Err(FormatArgsNotRecognized(format!( + "fmt::Arguments::new_v1_formatted call sequence ({insts:?})", + ))); + } + }; + + decoded_format_args + .has_unknown_fmt_placeholder_to_args_mapping = + Some(fmt_placeholders_len); + + ( + (pieces_slice_ptr_id, pieces_len), + (Some(rt_args_slice_ptr_id), rt_args_len), + ) + } + + // `::new_v1` + [pieces_slice_ptr_id, rt_args_slice_ptr_id] => ( + (pieces_slice_ptr_id, pieces_len), + (Some(rt_args_slice_ptr_id), rt_args_count), + ), + + // `::new_const` + [pieces_slice_ptr_id] if rt_args_count == 0 => { + ((pieces_slice_ptr_id, pieces_len), (None, rt_args_count)) + } + + _ => { + return Err(FormatArgsNotRecognized( + "fmt::Arguments::new call args".into(), + )); + } + } + } + _ => { + // HACK(eddyb) this gathers more context before reporting. + let mut insts = fmt_args_new_call_insts; + insts.reverse(); + while let Some(extra_inst) = try_rev_take(1) { + insts.extend(extra_inst); + if insts.len() >= 32 { + break; + } + } + insts.reverse(); + + return Err(FormatArgsNotRecognized(format!( + "fmt::Arguments::new call sequence ({insts:?})", + ))); + } + }; + + // HACK(eddyb) this is the worst part: if we do have runtime + // arguments (from e.g. new `assert!`s being added to `core`), + // we have to confirm their many instructions for removal. + if rt_args_count > 0 { + let rt_args_array_ptr_id = rt_args_slice_ptr_id.unwrap(); + + // Each runtime argument has A instructions to call one of + // the `fmt::rt::Argument::new_*` functions (and temporarily + // store its result), and B instructions to copy it into + // the appropriate slot in the array. The groups of A and B + // instructions, for all runtime args, are each separate, + // so the B×N later instructions are all processed first, + // before moving (backwards) to the A×N earlier instructions. + + let rev_copies_to_rt_args_array_src_ptrs: SmallVec<[_; 4]> = + (0..rt_args_count).rev().map(|rt_arg_idx| { + let mut copy_to_rt_args_array_insts = try_rev_take(3).ok_or_else(|| { + FormatArgsNotRecognized( + "[fmt::rt::Argument; N] copy: ran out of instructions".into(), + ) + })?; + + // HACK(eddyb) account for both the split and combined + // access chain cases that `inbounds_gep` can now cause. + if let Inst::InBoundsAccessChain(dst_field_ptr, dst_base_ptr, 0) = + copy_to_rt_args_array_insts[0] + && let Some(mut prev_insts) = try_rev_take(1) { + assert_eq!(prev_insts.len(), 1); + let prev_inst = prev_insts.pop().unwrap(); + + match prev_inst { + Inst::InBoundsAccessChain( + array_elem_ptr, + array_ptr, + idx, + ) if dst_base_ptr == array_elem_ptr => { + copy_to_rt_args_array_insts[0] = + Inst::InBoundsAccessChain2(dst_field_ptr, array_ptr, idx, 0); + } + _ => { + // HACK(eddyb) don't lose the taken `prev_inst`. + copy_to_rt_args_array_insts.insert(0, prev_inst); + } + } + } + + match copy_to_rt_args_array_insts[..] { + [ + Inst::InBoundsAccessChain2(dst_field_ptr, dst_array_base_ptr, array_idx, 0), + Inst::InBoundsAccessChain(src_field_ptr, src_base_ptr, 0), + Inst::CopyMemory(copy_dst, copy_src), + ] if dst_array_base_ptr == rt_args_array_ptr_id + && array_idx as usize == rt_arg_idx + && (copy_dst, copy_src) == (dst_field_ptr, src_field_ptr) => + { + Ok(src_base_ptr) + } + _ => { + Err(FormatArgsNotRecognized(format!( + "[fmt::rt::Argument; N] copy sequence ({copy_to_rt_args_array_insts:?})" + ))) + } + } + }).collect::>()?; + + // HACK(eddyb) sometimes there is an extra tuple of refs, + // nowadays, but MIR opts mean it's not always guaranteed, + // hopefully it's always uniform across all the arguments. + let mut maybe_ref_args_tmp_slot_ptr = None; + + let rev_maybe_ref_arg_ids_with_ty_and_spec = ((0..rt_args_count) + .rev() + .zip_eq(rev_copies_to_rt_args_array_src_ptrs)) + .map(|(rt_arg_idx, copy_to_rt_args_array_src_ptr)| { + let rt_arg_new_call_insts = try_rev_take(4).ok_or_else(|| { + FormatArgsNotRecognized( + "fmt::rt::Argument::new call: ran out of instructions".into(), + ) + })?; + let (ref_arg_id, ty, spec) = match rt_arg_new_call_insts[..] { + [ + Inst::Call(call_ret_id, callee_id, ref call_args), + Inst::InBoundsAccessChain(tmp_slot_field_ptr, tmp_slot_ptr, 0), + Inst::CompositeExtract(field, wrapper_newtype, 0), + Inst::Store(st_dst_ptr, st_val), + ] if wrapper_newtype == call_ret_id + && tmp_slot_ptr == copy_to_rt_args_array_src_ptr + && (st_dst_ptr, st_val) == (tmp_slot_field_ptr, field) => + { + self.fmt_rt_arg_new_fn_ids_to_ty_and_spec + .borrow() + .get(&callee_id) + .and_then(|&(ty, spec)| match call_args[..] { + [x] => Some((x, ty, spec)), + _ => None, + }) + } + _ => None, + } + .ok_or_else(|| { + FormatArgsNotRecognized(format!( + "fmt::rt::Argument::new call sequence ({rt_arg_new_call_insts:?})" + )) + })?; + + // HACK(eddyb) `0` (an invalid ID) is later used as a + // placeholder (see also `maybe_ref_args_tmp_slot_ptr`). + assert_ne!(ref_arg_id, 0); + + // HACK(eddyb) `try_rev_take(-2)` is "peeking", not taking. + let maybe_ref_args_tuple_load_insts = try_rev_take(-2); + let maybe_ref_arg_id = match maybe_ref_args_tuple_load_insts.as_deref() { + Some( + &[ + Inst::InBoundsAccessChain(field_ptr, base_ptr, field_idx), + Inst::Load(ld_val, ld_src_ptr), + ], + ) if maybe_ref_args_tmp_slot_ptr + .is_none_or(|expected| base_ptr == expected) + && field_idx as usize == rt_arg_idx + && (ld_val, ld_src_ptr) == (ref_arg_id, field_ptr) => + { + // HACK(eddyb) consume the peeked instructions. + try_rev_take(2).unwrap(); + + maybe_ref_args_tmp_slot_ptr = Some(base_ptr); + + // HACK(eddyb) using `0` (an invalid ID) as a + // placeholder to require further processing. + 0 + } + _ => ref_arg_id, + }; + + Ok((maybe_ref_arg_id, ty, spec)) + }) + .collect::>()?; + + decoded_format_args.ref_arg_ids_with_ty_and_spec = + rev_maybe_ref_arg_ids_with_ty_and_spec; + decoded_format_args.ref_arg_ids_with_ty_and_spec.reverse(); + + // HACK(eddyb) see above for context regarding the use of + // `0` as placeholders and `maybe_ref_args_tmp_slot_ptr`. + if let Some(ref_args_tmp_slot_ptr) = maybe_ref_args_tmp_slot_ptr { + for (rt_arg_idx, (maybe_ref_arg_id, ..)) in decoded_format_args + .ref_arg_ids_with_ty_and_spec + .iter_mut() + .enumerate() + .rev() + { + if *maybe_ref_arg_id == 0 { + let ref_arg_store_insts = try_rev_take(2).ok_or_else(|| { + FormatArgsNotRecognized( + "fmt::rt::Argument::new argument store: ran out of instructions".into(), + ) + })?; + + *maybe_ref_arg_id = match ref_arg_store_insts[..] { + [ + Inst::InBoundsAccessChain(field_ptr, base_ptr, field_idx), + Inst::Store(st_dst_ptr, st_val), + ] if base_ptr == ref_args_tmp_slot_ptr + && field_idx as usize == rt_arg_idx + && st_dst_ptr == field_ptr => + { + Some(st_val) + } + _ => None, + } + .ok_or_else(|| { + FormatArgsNotRecognized(format!( + "fmt::rt::Argument::new argument store sequence ({ref_arg_store_insts:?})" + )) + })?; + } + } + } + } + + // If the `pieces: &[&str]` slice needs a bitcast, it'll be here. + // HACK(eddyb) `try_rev_take(-1)` is "peeking", not taking. + let pieces_slice_ptr_id = match try_rev_take(-1).as_deref() { + Some(&[Inst::Bitcast(out_id, in_id)]) if out_id == pieces_slice_ptr_id => { + // HACK(eddyb) consume the peeked instructions. + try_rev_take(1).unwrap(); + + in_id + } + _ => pieces_slice_ptr_id, + }; + decoded_format_args.const_pieces = + match const_slice_as_elem_ids(pieces_slice_ptr_id, pieces_len) { + Some(piece_ids) => piece_ids + .iter() + .map( + |&piece_id| match self.builder.lookup_const_by_id(piece_id)? { + SpirvConst::Composite(piece) => { + const_str_as_utf8(piece.try_into().ok()?) + } + _ => None, + }, + ) + .collect::>(), + // HACK(eddyb) minor upstream blunder results in at + // least one instance of a runtime `[&str; 1]` array, + // see also this comment left on the responsible PR: + // https://github.com/rust-lang/rust/pull/129658#discussion_r2181834781 + // HACK(eddyb) `try_rev_take(-4)` is "peeking", not taking. + None if pieces_len == 1 => match try_rev_take(-4).as_deref() { + Some( + &[ + Inst::InBoundsAccessChain2(field0_ptr, array_ptr_0, 0, 0), + Inst::Store(st0_dst_ptr, st0_val), + Inst::InBoundsAccessChain2(field1_ptr, array_ptr_1, 0, 1), + Inst::Store(st1_dst_ptr, st1_val), + ], + ) if [array_ptr_0, array_ptr_1] == [pieces_slice_ptr_id; 2] + && st0_dst_ptr == field0_ptr + && st1_dst_ptr == field1_ptr => + { + // HACK(eddyb) consume the peeked instructions. + try_rev_take(4).unwrap(); + + const_str_as_utf8(&[st0_val, st1_val]) + .map(|s| [s].into_iter().collect()) + } + _ => None, + }, + None => None, + }; + + // Keep all instructions up to (but not including) the last one + // confirmed above to be the first instruction of `format_args!`. + func.blocks[block_idx] + .instructions + .truncate(taken_inst_idx_range.start.get()); + + Ok(decoded_format_args) + }; + + let mut debug_printf_args = SmallVec::<[_; 2]>::new(); + let message = match try_decode_and_remove_format_args() { + Ok(DecodedFormatArgs { + const_pieces: None, .. + }) => "".into(), + + Ok(DecodedFormatArgs { + const_pieces: Some(const_pieces), + ref_arg_ids_with_ty_and_spec, + has_unknown_fmt_placeholder_to_args_mapping, + }) => { + let args = ref_arg_ids_with_ty_and_spec + .iter() + .map(|&(ref_id, ty, spec)| { + use rustc_abi::{Float::*, Integer::*, Primitive::*}; + + let layout = self.layout_of(ty); + + let scalar = match layout.backend_repr { + BackendRepr::Scalar(scalar) => Some(scalar.primitive()), + _ => None, + }; + let debug_printf_fmt = match (spec, scalar) { + // FIXME(eddyb) support more of these, + // potentially recursing to print ADTs. + (' ' | '?', Some(Int(I32, false))) => "%u", + ('x', Some(Int(I32, false))) => "%x", + (' ' | '?', Some(Int(I32, true))) => "%i", + (' ' | '?', Some(Float(F32))) => "%f", + + _ => "", + }; + + if debug_printf_fmt.is_empty() { + return Cow::Owned( + format!("{{/* unprintable {ty} */:{spec}}}").replace('%', "%%"), + ); + } + + let spirv_type = layout.spirv_type(self.span(), self); + debug_printf_args.push( + self.emit() + .load(spirv_type, None, ref_id, None, []) + .unwrap() + .with_type(spirv_type), + ); + Cow::Borrowed(debug_printf_fmt) + }); + + // HACK(eddyb) due to `fmt::Arguments::new_v1_formatted`, + // we can't always assume that all the formatting arguments + // are used 1:1 as placeholders (i.e. between `const_pieces`). + let (placeholder_count, placeholders_are_args) = + match has_unknown_fmt_placeholder_to_args_mapping { + Some(count) => (count, false), + None => (args.len(), true), + }; + + // HACK(eddyb) extra sanity check to avoid visual mishaps. + let valid_placeholder_count = placeholder_count + .clamp(const_pieces.len().saturating_sub(1), const_pieces.len()); + let placeholders_are_args = + placeholders_are_args && placeholder_count == valid_placeholder_count; + + // FIXME(eddyb) stop using `itertools`'s `intersperse`, + // when it gets stabilized on `Iterator` instead. + #[allow(unstable_name_collisions)] + let (placeholders, suffix) = if placeholders_are_args { + (Either::Left(args), None) + } else { + // See also `has_unknown_fmt_placeholder_to_args_mapping` + // comment (which has an example for 3 pieces and 2 args). + // + // FIXME(eddyb) this could definitely be improved, but + // so far this only really gets hit in esoteric `core` + // internals (UB checks and `char::encode_utf{8,16}`). + ( + Either::Right( + (0..valid_placeholder_count).map(|i| format!("{{{i}}}").into()), + ), + Some( + ["\n with {…} from: ".into()] + .into_iter() + .chain(args.intersperse(", ".into())), + ), + ) + }; + + const_pieces + .into_iter() + .map(|s| Cow::Owned(s.replace('%', "%%"))) + .interleave(placeholders) + .chain(suffix.into_iter().flatten()) + .collect::() + } + + Err(FormatArgsNotRecognized(step)) => { + if let Some(current_span) = self.current_span { + // HACK(eddyb) Cargo silences warnings in dependencies. + let force_warn = |span, msg| -> rustc_errors::Diag<'_, ()> { + rustc_errors::Diag::new( + self.tcx.dcx(), + rustc_errors::Level::ForceWarning, + msg, + ) + .with_span(span) + }; + let mut warn = force_warn( + current_span, + "failed to find and remove `format_args!` construction for this `panic!`", + ); + + warn.note( + "compilation may later fail due to leftover `format_args!` internals", + ); + + if self.tcx.sess.opts.unstable_opts.inline_mir != Some(false) { + warn.note("missing `-Zinline-mir=off` flag (should've been set by `spirv-builder`)") + .help("check `.cargo` and environment variables for potential overrides") + .help("(or, if not using `spirv-builder` at all, add the flag manually)"); + } else { + warn.note(format!("[RUST-GPU BUG] bailed from {step}")); + } + + warn.emit(); + } + " (failed to find/decode `format_args!` expansion)".into() + } + }; + + // HACK(eddyb) redirect any possible panic call to an abort, to avoid + // needing to materialize `&core::panic::Location` or `format_args!`. + self.abort_with_kind_and_message_debug_printf("panic", message, debug_printf_args); + return self.undef(result_type); } if buffer_load_intrinsic { return self.codegen_buffer_load_intrinsic(fn_abi, result_type, args); diff --git a/crates/rustc_codegen_spirv/src/builder/format_args_decompiler.rs b/crates/rustc_codegen_spirv/src/builder/format_args_decompiler.rs deleted file mode 100644 index f04cf79f12..0000000000 --- a/crates/rustc_codegen_spirv/src/builder/format_args_decompiler.rs +++ /dev/null @@ -1,811 +0,0 @@ -use crate::abi::ConvSpirvType; -use crate::builder::Builder; -use crate::builder_spirv::{SpirvConst, SpirvValue, SpirvValueExt, SpirvValueKind}; -use crate::custom_insts::CustomOp; -use either::Either; -use itertools::Itertools; -use rspirv::dr::Operand; -use rspirv::spirv::{Op, Word}; -use rustc_abi::BackendRepr; -use rustc_data_structures::fx::FxHashSet; -use rustc_middle::ty::Ty; -use rustc_middle::ty::layout::LayoutOf; -use smallvec::SmallVec; -use std::borrow::Cow; -use std::cell::Cell; - -// HACK(eddyb) Rust 2021 `panic!` always uses `format_args!`, even -// in the simple case that used to pass a `&str` constant, which -// would not remain reachable in the SPIR-V - but `format_args!` is -// more complex and neither immediate (`fmt::Arguments` is too big) -// nor simplified in MIR (e.g. promoted to a constant) in any way, -// so we have to try and remove the `fmt::Arguments::new` call here. -#[derive(Default)] -pub struct DecodedFormatArgs<'tcx> { - /// If fully constant, the `pieces: &'a [&'static str]` input - /// of `fmt::Arguments<'a>` (i.e. the strings between args). - const_pieces: Option>, - - /// Original references for `fmt::Arguments<'a>` dynamic arguments, - /// i.e. the `&'a T` passed to `fmt::rt::Argument::<'a>::new_*`, - /// tracking the type `T` and `char` formatting specifier. - /// - /// E.g. for `format_args!("{a} {b:x}")` they'll be: - /// * `&a` with `typeof a` and ' ', - /// * `&b` with `typeof b` and 'x' - ref_arg_ids_with_ty_and_spec: SmallVec<[(Word, Ty<'tcx>, char); 2]>, - - /// If `fmt::Arguments::new_v1_formatted` was used, this holds - /// the length of the `&[fmt::rt::Placeholder]` slice, which - /// currently cannot be directly supported, and therefore even - /// if all of `ref_arg_ids_with_ty_and_spec` are printable, - /// a much jankier fallback still has to be used, as it were: - /// - /// `format!("a{{0}}b{{1}}c\n with {{…}} from: {}, {}", x, y)` - /// (w/ `const_pieces = ["a", "b", "c"]` & `ref_args = [&x, &y]`). - has_unknown_fmt_placeholder_to_args_mapping: Option, -} - -pub struct FormatArgsNotRecognized(pub String); - -pub type FormatArgsResult<'tcx> = Result, FormatArgsNotRecognized>; - -impl<'tcx> DecodedFormatArgs<'tcx> { - pub fn try_decode_and_remove_format_args<'a>( - builder: &mut Builder<'a, 'tcx>, - args: &[SpirvValue], - ) -> FormatArgsResult<'tcx> { - let mut decoded_format_args = DecodedFormatArgs::default(); - - // HACK(eddyb) work around mutable borrowing conflicts. - let cx = builder.cx; - - let const_u32_as_usize = |ct_id| match cx.builder.lookup_const_by_id(ct_id)? { - SpirvConst::Scalar(x) => Some(u32::try_from(x).ok()? as usize), - _ => None, - }; - let const_slice_as_elem_ids = |ptr_id: Word, len: usize| { - if let SpirvConst::PtrTo { pointee } = cx.builder.lookup_const_by_id(ptr_id)? - && let SpirvConst::Composite(elems) = cx.builder.lookup_const_by_id(pointee)? - && elems.len() == len - { - return Some(elems); - } - None - }; - let const_str_as_utf8 = |&[str_ptr_id, str_len_id]: &[Word; 2]| { - let str_len = const_u32_as_usize(str_len_id)?; - let piece_str_bytes = const_slice_as_elem_ids(str_ptr_id, str_len)? - .iter() - .map(|&id| u8::try_from(const_u32_as_usize(id)?).ok()) - .collect::>>()?; - String::from_utf8(piece_str_bytes).ok() - }; - - // HACK(eddyb) `panic_explicit` doesn't take any regular arguments, - // only an (implicit) `&'static panic::Location<'static>`. - if args.len() == 1 { - decoded_format_args.const_pieces = - Some(["explicit panic".into()].into_iter().collect()); - return Ok(decoded_format_args); - } - - // HACK(eddyb) some entry-points only take a `&str`, not `fmt::Arguments`. - if let [ - SpirvValue { - kind: SpirvValueKind::Def(a_id), - .. - }, - SpirvValue { - kind: SpirvValueKind::Def(b_id), - .. - }, - ref other_args @ .., - ] = args[..] - { - // Optional `&'static panic::Location<'static>`. - if other_args.len() <= 1 - && let Some(const_msg) = const_str_as_utf8(&[a_id, b_id]) - { - decoded_format_args.const_pieces = Some([const_msg].into_iter().collect()); - return Ok(decoded_format_args); - } - } - - let format_args_id = match *args { - // HACK(eddyb) `panic_nounwind_fmt` takes an extra argument. - [ - SpirvValue { - kind: SpirvValueKind::Def(format_args_id), - .. - }, - _, // `&'static panic::Location<'static>` - ] - | [ - SpirvValue { - kind: SpirvValueKind::Def(format_args_id), - .. - }, - _, // `force_no_backtrace: bool` - _, // `&'static panic::Location<'static>` - ] => format_args_id, - - _ => { - return Err(FormatArgsNotRecognized( - "panic entry-point call args".into(), - )); - } - }; - - let custom_ext_inst_set_import = builder.ext_inst.borrow_mut().import_custom(builder); - - // HACK(eddyb) we can remove SSA instructions even when they have - // side-effects, *as long as* they are "local" enough and cannot - // be observed from outside this current invocation - because the - // the abort, any SSA definitions or local variable writes can't - // be actually used anywhere else (other than *before* the abort). - let mut builder = builder.emit(); - let func_idx = builder.selected_function().unwrap(); - let block_idx = builder.selected_block().unwrap(); - let func = &mut builder.module_mut().functions[func_idx]; - - // HACK(eddyb) this is used to check that all `Op{Store,Load}`s - // that may get removed, operate on local `OpVariable`s, - // i.e. are not externally observable. - let local_var_ids: FxHashSet<_> = func.blocks[0] - .instructions - .iter() - .take_while(|inst| inst.class.opcode == Op::Variable) - .map(|inst| inst.result_id.unwrap()) - .collect(); - let require_local_var = |ptr_id, var| { - Some(()) - .filter(|()| local_var_ids.contains(&ptr_id)) - .ok_or_else(|| FormatArgsNotRecognized(format!("{var} storage not local"))) - }; - - let mut non_debug_insts = func.blocks[block_idx] - .instructions - .iter() - .enumerate() - .filter(|(_, inst)| { - let is_standard_debug = [Op::Line, Op::NoLine].contains(&inst.class.opcode); - let is_custom_debug = inst.class.opcode == Op::ExtInst - && inst.operands[0].unwrap_id_ref() == custom_ext_inst_set_import - && CustomOp::decode_from_ext_inst(inst).is_debuginfo(); - !(is_standard_debug || is_custom_debug) - }); - - // HACK(eddyb) to aid in pattern-matching, relevant instructions - // are decoded to values of this `enum`. For instructions that - // produce results, the result ID is the first `ID` value. - #[derive(Debug)] - enum Inst { - Bitcast(ID, ID), - CompositeExtract(ID, ID, u32), - InBoundsAccessChain(ID, ID, u32), - InBoundsAccessChain2(ID, ID, u32, u32), - Store(ID, ID), - Load(ID, ID), - CopyMemory(ID, ID), - Call(ID, ID, SmallVec<[ID; 4]>), - - // HACK(eddyb) this only exists for better error reporting, - // as `Result, Op>` would only report one `Op`. - Unsupported( - // HACK(eddyb) only exists for `fmt::Debug` in case of error. - #[allow(dead_code)] Op, - ), - } - - let taken_inst_idx_range = Cell::new(func.blocks[block_idx].instructions.len())..; - - // Take `count` instructions, advancing backwards, but returning - // instructions in their original order (and decoded to `Inst`s). - let mut try_rev_take = |count: isize| { - // HACK(eddyb) this is extremely silly but it's easier to do - // this than to rely on `Iterator::peekable` or anything else, - // lower down this file, without messing up the state here. - let is_peek = count < 0; - let count = count.unsigned_abs(); - - let mut non_debug_insts_for_peek = is_peek.then(|| non_debug_insts.clone()); - let non_debug_insts = non_debug_insts_for_peek - .as_mut() - .unwrap_or(&mut non_debug_insts); - - // FIXME(eddyb) there might be an easier way to do this, - // e.g. maybe `map_while` + post-`collect` length check? - let maybe_rev_insts = (0..count).map(|_| { - let (i, inst) = non_debug_insts.next_back()?; - if !is_peek { - taken_inst_idx_range.start.set(i); - } - - // HACK(eddyb) avoid the logic below that assumes only ID operands - if inst.class.opcode == Op::CompositeExtract - && let (Some(r), &[Operand::IdRef(x), Operand::LiteralBit32(i)]) = - (inst.result_id, &inst.operands[..]) - { - return Some(Inst::CompositeExtract(r, x, i)); - } - - // HACK(eddyb) all instructions accepted below - // are expected to take no more than 4 operands, - // and this is easier to use than an iterator. - let id_operands = inst - .operands - .iter() - .map(|operand| operand.id_ref_any()) - .collect::>>()?; - - let const_as_u32 = |id| match cx.builder.lookup_const_by_id(id)? { - SpirvConst::Scalar(x) => u32::try_from(x).ok(), - _ => None, - }; - - // Decode the instruction into one of our `Inst`s. - Some( - match (inst.class.opcode, inst.result_id, &id_operands[..]) { - (Op::Bitcast, Some(r), &[x]) => Inst::Bitcast(r, x), - (Op::InBoundsAccessChain, Some(r), &[p, i]) => { - if let Some(i) = const_as_u32(i) { - Inst::InBoundsAccessChain(r, p, i) - } else { - Inst::Unsupported(inst.class.opcode) - } - } - (Op::InBoundsAccessChain, Some(r), &[p, i, j]) => { - if let [Some(i), Some(j)] = [i, j].map(const_as_u32) { - Inst::InBoundsAccessChain2(r, p, i, j) - } else { - Inst::Unsupported(inst.class.opcode) - } - } - (Op::Store, None, &[p, v]) => Inst::Store(p, v), - (Op::Load, Some(r), &[p]) => Inst::Load(r, p), - (Op::CopyMemory, None, &[a, b]) => Inst::CopyMemory(a, b), - (Op::FunctionCall, Some(r), [f, args @ ..]) => { - Inst::Call(r, *f, args.iter().copied().collect()) - } - _ => Inst::Unsupported(inst.class.opcode), - }, - ) - }); - let mut insts = maybe_rev_insts.collect::>>()?; - insts.reverse(); - Some(insts) - }; - let fmt_args_new_call_insts = try_rev_take(3).ok_or_else(|| { - FormatArgsNotRecognized("fmt::Arguments::new call: ran out of instructions".into()) - })?; - let ((pieces_slice_ptr_id, pieces_len), (rt_args_slice_ptr_id, rt_args_count)) = - match fmt_args_new_call_insts[..] { - [ - Inst::Call(call_ret_id, callee_id, ref call_args), - Inst::Store(st_dst_id, st_val_id), - Inst::Load(ld_val_id, ld_src_id), - ] if call_ret_id == st_val_id - && st_dst_id == ld_src_id - && ld_val_id == format_args_id => - { - require_local_var(st_dst_id, "fmt::Arguments::new destination")?; - - let Some(&(pieces_len, rt_args_count)) = - cx.fmt_args_new_fn_ids.borrow().get(&callee_id) - else { - return Err(FormatArgsNotRecognized( - "fmt::Arguments::new callee not registered".into(), - )); - }; - - match call_args[..] { - // `::new_v1_formatted` - // - // HACK(eddyb) this isn't fully supported, - // as that would require digging into unstable - // internals of `core::fmt::rt::Placeholder`s, - // but the whole call still needs to be removed, - // and both const str pieces and runtime args - // can still be printed (even if in jankier way). - [ - pieces_slice_ptr_id, - pieces_len_id, - rt_args_slice_ptr_id, - rt_args_len_id, - fmt_placeholders_slice_ptr_id, - fmt_placeholders_len_id, - ] if (pieces_len, rt_args_count) == (!0, !0) => { - let [pieces_len, rt_args_len, fmt_placeholders_len] = - match [pieces_len_id, rt_args_len_id, fmt_placeholders_len_id] - .map(const_u32_as_usize) - { - [Some(a), Some(b), Some(c)] => [a, b, c], - _ => { - return Err(FormatArgsNotRecognized( - "fmt::Arguments::new_v1_formatted \ - with dynamic lengths" - .into(), - )); - } - }; - - let prepare_args_insts = try_rev_take(2).ok_or_else(|| { - FormatArgsNotRecognized( - "fmt::Arguments::new_v1_formatted call: ran out of instructions".into(), - ) - })?; - let (rt_args_slice_ptr_id, _fmt_placeholders_slice_ptr_id) = - match prepare_args_insts[..] { - [ - Inst::Bitcast(rt_args_cast_out_id, rt_args_cast_in_id), - Inst::Bitcast( - placeholders_cast_out_id, - placeholders_cast_in_id, - ), - ] if rt_args_cast_out_id == rt_args_slice_ptr_id - && placeholders_cast_out_id - == fmt_placeholders_slice_ptr_id => - { - (rt_args_cast_in_id, placeholders_cast_in_id) - } - _ => { - let mut insts = prepare_args_insts; - insts.extend(fmt_args_new_call_insts); - return Err(FormatArgsNotRecognized(format!( - "fmt::Arguments::new_v1_formatted call sequence ({insts:?})", - ))); - } - }; - - decoded_format_args.has_unknown_fmt_placeholder_to_args_mapping = - Some(fmt_placeholders_len); - - ( - (pieces_slice_ptr_id, pieces_len), - (Some(rt_args_slice_ptr_id), rt_args_len), - ) - } - - // `::new_v1` - [pieces_slice_ptr_id, rt_args_slice_ptr_id] => ( - (pieces_slice_ptr_id, pieces_len), - (Some(rt_args_slice_ptr_id), rt_args_count), - ), - - // `::new_const` - [pieces_slice_ptr_id] if rt_args_count == 0 => { - ((pieces_slice_ptr_id, pieces_len), (None, rt_args_count)) - } - - _ => { - return Err(FormatArgsNotRecognized( - "fmt::Arguments::new call args".into(), - )); - } - } - } - _ => { - // HACK(eddyb) this gathers more context before reporting. - let mut insts = fmt_args_new_call_insts; - insts.reverse(); - while let Some(extra_inst) = try_rev_take(1) { - insts.extend(extra_inst); - if insts.len() >= 32 { - break; - } - } - insts.reverse(); - - return Err(FormatArgsNotRecognized(format!( - "fmt::Arguments::new call sequence ({insts:?})", - ))); - } - }; - - // HACK(eddyb) this is the worst part: if we do have runtime - // arguments (from e.g. new `assert!`s being added to `core`), - // we have to confirm their many instructions for removal. - if rt_args_count > 0 { - let rt_args_array_ptr_id = rt_args_slice_ptr_id.unwrap(); - - // Each runtime argument has A instructions to call one of - // the `fmt::rt::Argument::new_*` functions (and temporarily - // store its result), and B instructions to copy it into - // the appropriate slot in the array. The groups of A and B - // instructions, for all runtime args, are each separate, - // so the B×N later instructions are all processed first, - // before moving (backwards) to the A×N earlier instructions. - - let rev_copies_to_rt_args_array_src_ptrs: SmallVec<[_; 4]> = (0..rt_args_count) - .rev() - .map(|rt_arg_idx| { - let mut copy_to_rt_args_array_insts = try_rev_take(3).ok_or_else(|| { - FormatArgsNotRecognized( - "[fmt::rt::Argument; N] copy: ran out of instructions".into(), - ) - })?; - - // HACK(eddyb) account for both the split and combined - // access chain cases that `inbounds_gep` can now cause. - if let Inst::InBoundsAccessChain(dst_field_ptr, dst_base_ptr, 0) = - copy_to_rt_args_array_insts[0] - && let Some(mut prev_insts) = try_rev_take(1) - { - assert_eq!(prev_insts.len(), 1); - let prev_inst = prev_insts.pop().unwrap(); - - match prev_inst { - Inst::InBoundsAccessChain(array_elem_ptr, array_ptr, idx) - if dst_base_ptr == array_elem_ptr => - { - copy_to_rt_args_array_insts[0] = - Inst::InBoundsAccessChain2(dst_field_ptr, array_ptr, idx, 0); - } - _ => { - // HACK(eddyb) don't lose the taken `prev_inst`. - copy_to_rt_args_array_insts.insert(0, prev_inst); - } - } - } - - match copy_to_rt_args_array_insts[..] { - [ - Inst::InBoundsAccessChain2( - dst_field_ptr, - dst_array_base_ptr, - array_idx, - 0, - ), - Inst::InBoundsAccessChain(src_field_ptr, src_base_ptr, 0), - Inst::CopyMemory(copy_dst, copy_src), - ] if dst_array_base_ptr == rt_args_array_ptr_id - && array_idx as usize == rt_arg_idx - && (copy_dst, copy_src) == (dst_field_ptr, src_field_ptr) => - { - Ok(src_base_ptr) - } - _ => Err(FormatArgsNotRecognized(format!( - "[fmt::rt::Argument; N] copy sequence ({copy_to_rt_args_array_insts:?})" - ))), - } - }) - .collect::>()?; - - // HACK(eddyb) sometimes there is an extra tuple of refs, - // nowadays, but MIR opts mean it's not always guaranteed, - // hopefully it's always uniform across all the arguments. - let mut maybe_ref_args_tmp_slot_ptr = None; - - let rev_maybe_ref_arg_ids_with_ty_and_spec = ((0..rt_args_count) - .rev() - .zip_eq(rev_copies_to_rt_args_array_src_ptrs)) - .map(|(rt_arg_idx, copy_to_rt_args_array_src_ptr)| { - let rt_arg_new_call_insts = try_rev_take(4).ok_or_else(|| { - FormatArgsNotRecognized( - "fmt::rt::Argument::new call: ran out of instructions".into(), - ) - })?; - let (ref_arg_id, ty, spec) = match rt_arg_new_call_insts[..] { - [ - Inst::Call(call_ret_id, callee_id, ref call_args), - Inst::InBoundsAccessChain(tmp_slot_field_ptr, tmp_slot_ptr, 0), - Inst::CompositeExtract(field, wrapper_newtype, 0), - Inst::Store(st_dst_ptr, st_val), - ] if wrapper_newtype == call_ret_id - && tmp_slot_ptr == copy_to_rt_args_array_src_ptr - && (st_dst_ptr, st_val) == (tmp_slot_field_ptr, field) => - { - cx.fmt_rt_arg_new_fn_ids_to_ty_and_spec - .borrow() - .get(&callee_id) - .and_then(|&(ty, spec)| match call_args[..] { - [x] => Some((x, ty, spec)), - _ => None, - }) - } - _ => None, - } - .ok_or_else(|| { - FormatArgsNotRecognized(format!( - "fmt::rt::Argument::new call sequence ({rt_arg_new_call_insts:?})" - )) - })?; - - // HACK(eddyb) `0` (an invalid ID) is later used as a - // placeholder (see also `maybe_ref_args_tmp_slot_ptr`). - assert_ne!(ref_arg_id, 0); - - // HACK(eddyb) `try_rev_take(-2)` is "peeking", not taking. - let maybe_ref_args_tuple_load_insts = try_rev_take(-2); - let maybe_ref_arg_id = match maybe_ref_args_tuple_load_insts.as_deref() { - Some( - &[ - Inst::InBoundsAccessChain(field_ptr, base_ptr, field_idx), - Inst::Load(ld_val, ld_src_ptr), - ], - ) if maybe_ref_args_tmp_slot_ptr - .is_none_or(|expected| base_ptr == expected) - && field_idx as usize == rt_arg_idx - && (ld_val, ld_src_ptr) == (ref_arg_id, field_ptr) => - { - // HACK(eddyb) consume the peeked instructions. - try_rev_take(2).unwrap(); - - maybe_ref_args_tmp_slot_ptr = Some(base_ptr); - - // HACK(eddyb) using `0` (an invalid ID) as a - // placeholder to require further processing. - 0 - } - _ => ref_arg_id, - }; - - Ok((maybe_ref_arg_id, ty, spec)) - }) - .collect::>()?; - - decoded_format_args.ref_arg_ids_with_ty_and_spec = - rev_maybe_ref_arg_ids_with_ty_and_spec; - decoded_format_args.ref_arg_ids_with_ty_and_spec.reverse(); - - // HACK(eddyb) see above for context regarding the use of - // `0` as placeholders and `maybe_ref_args_tmp_slot_ptr`. - if let Some(ref_args_tmp_slot_ptr) = maybe_ref_args_tmp_slot_ptr { - for (rt_arg_idx, (maybe_ref_arg_id, ..)) in decoded_format_args - .ref_arg_ids_with_ty_and_spec - .iter_mut() - .enumerate() - .rev() - { - if *maybe_ref_arg_id == 0 { - let ref_arg_store_insts = try_rev_take(2).ok_or_else(|| { - FormatArgsNotRecognized( - "fmt::rt::Argument::new argument store: ran out of instructions" - .into(), - ) - })?; - - *maybe_ref_arg_id = match ref_arg_store_insts[..] { - [ - Inst::InBoundsAccessChain(field_ptr, base_ptr, field_idx), - Inst::Store(st_dst_ptr, st_val), - ] if base_ptr == ref_args_tmp_slot_ptr - && field_idx as usize == rt_arg_idx - && st_dst_ptr == field_ptr => - { - Some(st_val) - } - _ => None, - } - .ok_or_else(|| { - FormatArgsNotRecognized(format!( - "fmt::rt::Argument::new argument store sequence ({ref_arg_store_insts:?})" - )) - })?; - } - } - } - } - - // If the `pieces: &[&str]` slice needs a bitcast, it'll be here. - // HACK(eddyb) `try_rev_take(-1)` is "peeking", not taking. - let pieces_slice_ptr_id = match try_rev_take(-1).as_deref() { - Some(&[Inst::Bitcast(out_id, in_id)]) if out_id == pieces_slice_ptr_id => { - // HACK(eddyb) consume the peeked instructions. - try_rev_take(1).unwrap(); - - in_id - } - _ => pieces_slice_ptr_id, - }; - decoded_format_args.const_pieces = - match const_slice_as_elem_ids(pieces_slice_ptr_id, pieces_len) { - Some(piece_ids) => piece_ids - .iter() - .map(|&piece_id| match cx.builder.lookup_const_by_id(piece_id)? { - SpirvConst::Composite(piece) => const_str_as_utf8(piece.try_into().ok()?), - _ => None, - }) - .collect::>(), - // HACK(eddyb) minor upstream blunder results in at - // least one instance of a runtime `[&str; 1]` array, - // see also this comment left on the responsible PR: - // https://github.com/rust-lang/rust/pull/129658#discussion_r2181834781 - // HACK(eddyb) `try_rev_take(-4)` is "peeking", not taking. - None if pieces_len == 1 => match try_rev_take(-4).as_deref() { - Some( - &[ - Inst::InBoundsAccessChain2(field0_ptr, array_ptr_0, 0, 0), - Inst::Store(st0_dst_ptr, st0_val), - Inst::InBoundsAccessChain2(field1_ptr, array_ptr_1, 0, 1), - Inst::Store(st1_dst_ptr, st1_val), - ], - ) if [array_ptr_0, array_ptr_1] == [pieces_slice_ptr_id; 2] - && st0_dst_ptr == field0_ptr - && st1_dst_ptr == field1_ptr => - { - // HACK(eddyb) consume the peeked instructions. - try_rev_take(4).unwrap(); - - const_str_as_utf8(&[st0_val, st1_val]).map(|s| [s].into_iter().collect()) - } - _ => None, - }, - None => None, - }; - - // Keep all instructions up to (but not including) the last one - // confirmed above to be the first instruction of `format_args!`. - func.blocks[block_idx] - .instructions - .truncate(taken_inst_idx_range.start.get()); - - Ok(decoded_format_args) - } -} - -pub trait CodegenPanic<'a, 'tcx> { - fn codegen_panic(&self, builder: &mut Builder<'a, 'tcx>, result_type: Word) -> SpirvValue; -} - -impl<'a, 'tcx> CodegenPanic<'a, 'tcx> for DecodedFormatArgs<'tcx> { - fn codegen_panic(&self, builder: &mut Builder<'a, 'tcx>, result_type: Word) -> SpirvValue { - match self { - DecodedFormatArgs { - const_pieces: None, .. - } => { - builder.abort_with_kind_and_message_debug_printf( - "panic", - "", - std::iter::empty(), - ); - builder.undef(result_type) - } - - DecodedFormatArgs { - const_pieces: Some(const_pieces), - ref_arg_ids_with_ty_and_spec, - has_unknown_fmt_placeholder_to_args_mapping, - } => { - let mut debug_printf_args = SmallVec::<[_; 2]>::new(); - let args = ref_arg_ids_with_ty_and_spec - .iter() - .map(|&(ref_id, ty, spec)| { - use rustc_abi::{Float::*, Integer::*, Primitive::*}; - - let layout = builder.layout_of(ty); - - let scalar = match layout.backend_repr { - BackendRepr::Scalar(scalar) => Some(scalar.primitive()), - _ => None, - }; - let debug_printf_fmt = match (spec, scalar) { - // FIXME(eddyb) support more of these, - // potentially recursing to print ADTs. - (' ' | '?', Some(Int(I32, false))) => "%u", - ('x', Some(Int(I32, false))) => "%x", - (' ' | '?', Some(Int(I32, true))) => "%i", - (' ' | '?', Some(Float(F32))) => "%f", - - _ => "", - }; - - if debug_printf_fmt.is_empty() { - return Cow::Owned( - format!("{{/* unprintable {ty} */:{spec}}}").replace('%', "%%"), - ); - } - - let spirv_type = layout.spirv_type(builder.span(), builder); - debug_printf_args.push( - builder - .emit() - .load(spirv_type, None, ref_id, None, []) - .unwrap() - .with_type(spirv_type), - ); - Cow::Borrowed(debug_printf_fmt) - }); - - // HACK(eddyb) due to `fmt::Arguments::new_v1_formatted`, - // we can't always assume that all the formatting arguments - // are used 1:1 as placeholders (i.e. between `const_pieces`). - let (placeholder_count, placeholders_are_args) = - match has_unknown_fmt_placeholder_to_args_mapping { - Some(count) => (*count, false), - None => (args.len(), true), - }; - - // HACK(eddyb) extra sanity check to avoid visual mishaps. - let valid_placeholder_count = placeholder_count - .clamp(const_pieces.len().saturating_sub(1), const_pieces.len()); - let placeholders_are_args = - placeholders_are_args && placeholder_count == valid_placeholder_count; - - // FIXME(eddyb) stop using `itertools`'s `intersperse`, - // when it gets stabilized on `Iterator` instead. - #[allow(unstable_name_collisions)] - let (placeholders, suffix) = if placeholders_are_args { - (Either::Left(args), None) - } else { - // See also `has_unknown_fmt_placeholder_to_args_mapping` - // comment (which has an example for 3 pieces and 2 args). - // - // FIXME(eddyb) this could definitely be improved, but - // so far this only really gets hit in esoteric `core` - // internals (UB checks and `char::encode_utf{8,16}`). - ( - Either::Right( - (0..valid_placeholder_count).map(|i| format!("{{{i}}}").into()), - ), - Some( - ["\n with {…} from: ".into()] - .into_iter() - .chain(args.intersperse(", ".into())), - ), - ) - }; - - let message = const_pieces - .into_iter() - .map(|s| Cow::Owned(s.replace('%', "%%"))) - .interleave(placeholders) - .chain(suffix.into_iter().flatten()) - .collect::(); - - // HACK(eddyb) redirect any possible panic call to an abort, to avoid - // needing to materialize `&core::panic::Location` or `format_args!`. - builder.abort_with_kind_and_message_debug_printf( - "panic", - message, - debug_printf_args, - ); - builder.undef(result_type) - } - } - } -} - -impl<'a, 'tcx> CodegenPanic<'a, 'tcx> for FormatArgsResult<'tcx> { - fn codegen_panic(&self, builder: &mut Builder<'a, 'tcx>, result_type: Word) -> SpirvValue { - match self { - Ok(e) => e.codegen_panic(builder, result_type), - Err(FormatArgsNotRecognized(step)) => { - if let Some(current_span) = builder.current_span { - // HACK(eddyb) Cargo silences warnings in dependencies. - let force_warn = |span, msg| -> rustc_errors::Diag<'_, ()> { - rustc_errors::Diag::new( - builder.tcx.dcx(), - rustc_errors::Level::ForceWarning, - msg, - ) - .with_span(span) - }; - let mut warn = force_warn( - current_span, - "failed to find and remove `format_args!` construction for this `panic!`", - ); - - warn.note( - "compilation may later fail due to leftover `format_args!` internals", - ); - - if builder.tcx.sess.opts.unstable_opts.inline_mir != Some(false) { - warn.note("missing `-Zinline-mir=off` flag (should've been set by `spirv-builder`)") - .help("check `.cargo` and environment variables for potential overrides") - .help("(or, if not using `spirv-builder` at all, add the flag manually)"); - } else { - warn.note(format!("[RUST-GPU BUG] bailed from {step}")); - } - - warn.emit(); - } - - let msg = " (failed to find/decode `format_args!` expansion)"; - builder.abort_with_kind_and_message_debug_printf("panic", msg, std::iter::empty()); - builder.undef(result_type) - } - } - } -} diff --git a/crates/rustc_codegen_spirv/src/builder/mod.rs b/crates/rustc_codegen_spirv/src/builder/mod.rs index 7135e144c8..eeaffc8ac8 100644 --- a/crates/rustc_codegen_spirv/src/builder/mod.rs +++ b/crates/rustc_codegen_spirv/src/builder/mod.rs @@ -1,7 +1,6 @@ mod builder_methods; mod byte_addressable_buffer; mod ext_inst; -mod format_args_decompiler; mod intrinsics; pub mod libm_intrinsics; mod spirv_asm; diff --git a/crates/rustc_codegen_spirv/src/codegen_cx/entry.rs b/crates/rustc_codegen_spirv/src/codegen_cx/entry.rs index 0c16adfd6c..5de823d261 100644 --- a/crates/rustc_codegen_spirv/src/codegen_cx/entry.rs +++ b/crates/rustc_codegen_spirv/src/codegen_cx/entry.rs @@ -11,7 +11,6 @@ use rspirv::dr::Operand; use rspirv::spirv::{ Capability, Decoration, Dim, ExecutionModel, FunctionControl, StorageClass, Word, }; -use rustc_abi::FieldsShape; use rustc_codegen_ssa::traits::{BaseTypeCodegenMethods, BuilderMethods, MiscCodegenMethods as _}; use rustc_data_structures::fx::FxHashMap; use rustc_errors::MultiSpan; @@ -19,7 +18,7 @@ use rustc_hir as hir; use rustc_middle::span_bug; use rustc_middle::ty::layout::{LayoutOf, TyAndLayout}; use rustc_middle::ty::{self, Instance, Ty}; -use rustc_span::{DUMMY_SP, Span}; +use rustc_span::Span; use rustc_target::callconv::{ArgAbi, FnAbi, PassMode}; use std::assert_matches::assert_matches; @@ -396,38 +395,23 @@ impl<'tcx> CodegenCx<'tcx> { // would've assumed it was actually an implicitly-`Input`. let mut storage_class = Ok(storage_class); if let Some(spec_constant) = attrs.spec_constant { - let ty = ref_or_value_layout; - let valid_array_count = match ty.fields { - FieldsShape::Array { count, .. } => { - let element = ty.field(self, 0); - (element.ty == self.tcx.types.u32).then_some(u32::try_from(count).ok()) - } - FieldsShape::Primitive => (ty.ty == self.tcx.types.u32).then_some(None), - _ => None, - }; - - if let Some(array_count) = valid_array_count { - if let Some(storage_class) = attrs.storage_class { - self.tcx.dcx().span_err( - storage_class.span, - "`#[spirv(spec_constant)]` cannot have a storage class", - ); - } else { - assert_eq!(storage_class, Ok(StorageClass::Input)); - assert!(!is_ref); - storage_class = Err(SpecConstant { - array_count, - ..spec_constant.value - }); - } - } else { + if ref_or_value_layout.ty != self.tcx.types.u32 { self.tcx.dcx().span_err( hir_param.ty_span, format!( - "unsupported `#[spirv(spec_constant)]` type `{}` (expected `u32` or `[u32; N]`)", - ref_or_value_layout.ty + "unsupported `#[spirv(spec_constant)]` type `{}` (expected `{}`)", + ref_or_value_layout.ty, self.tcx.types.u32 ), ); + } else if let Some(storage_class) = attrs.storage_class { + self.tcx.dcx().span_err( + storage_class.span, + "`#[spirv(spec_constant)]` cannot have a storage class", + ); + } else { + assert_eq!(storage_class, Ok(StorageClass::Input)); + assert!(!is_ref); + storage_class = Err(spec_constant.value); } } @@ -464,38 +448,18 @@ impl<'tcx> CodegenCx<'tcx> { Ok(self.emit_global().id()), Err("entry-point interface variable is not a `#[spirv(spec_constant)]`"), ), - Err(SpecConstant { - id, - default, - array_count, - }) => { - let u32_ty = SpirvType::Integer(32, false).def(DUMMY_SP, self); - let single = |id: u32| { - let mut emit = self.emit_global(); - let spec_const_id = emit.spec_constant_bit32(u32_ty, default.unwrap_or(0)); - emit.decorate( - spec_const_id, - Decoration::SpecId, - [Operand::LiteralBit32(id)], - ); - spec_const_id - }; - let param_word = if let Some(array_count) = array_count { - let array = (0..array_count).map(|i| single(id + i)).collect::>(); - let array_ty = SpirvType::Array { - element: u32_ty, - count: self.constant_u32(DUMMY_SP, array_count), - } - .def(DUMMY_SP, self); - bx.emit() - .composite_construct(array_ty, None, array) - .unwrap() - } else { - single(id) - }; + Err(SpecConstant { id, default }) => { + let mut emit = self.emit_global(); + let spec_const_id = + emit.spec_constant_bit32(value_spirv_type, default.unwrap_or(0)); + emit.decorate( + spec_const_id, + Decoration::SpecId, + [Operand::LiteralBit32(id)], + ); ( Err("`#[spirv(spec_constant)]` is not an entry-point interface variable"), - Ok(param_word), + Ok(spec_const_id), ) } }; diff --git a/crates/rustc_codegen_spirv/src/linker/simple_passes.rs b/crates/rustc_codegen_spirv/src/linker/simple_passes.rs index ebd37a9ad7..bd8f614569 100644 --- a/crates/rustc_codegen_spirv/src/linker/simple_passes.rs +++ b/crates/rustc_codegen_spirv/src/linker/simple_passes.rs @@ -237,18 +237,10 @@ pub fn check_fragment_insts(sess: &Session, module: &Module) -> super::Result<() let mut any_err = None; for inst in module.functions[index].all_inst_iter() { if inst.class.opcode == Op::FunctionCall { - let callee_id = inst.operands[0].unwrap_id_ref(); - if let Some(&callee) = func_id_to_idx.get(&callee_id) { - if let Err(e) = - visit(sess, module, visited, stack, names, callee, func_id_to_idx) - { - any_err = any_err.or(Some(e)); - } - } else { - // Indirect or external callee: nothing to traverse. - // Keep scanning this function for forbidden fragment ops. - continue; - } + let callee = func_id_to_idx[&inst.operands[0].unwrap_id_ref()]; + let callee_had_err = + visit(sess, module, visited, stack, names, callee, func_id_to_idx).err(); + any_err = any_err.or(callee_had_err); } if matches!( inst.class.opcode, diff --git a/crates/rustc_codegen_spirv/src/linker/test.rs b/crates/rustc_codegen_spirv/src/linker/test.rs index 4aa903c472..5dbfc9937a 100644 --- a/crates/rustc_codegen_spirv/src/linker/test.rs +++ b/crates/rustc_codegen_spirv/src/linker/test.rs @@ -164,7 +164,7 @@ fn link_with_linker_opts( let source_map = sess.psess.clone_source_map(); let emitter = rustc_errors::emitter::HumanEmitter::new( - rustc_errors::AutoStream::new(Box::new(buf), rustc_errors::ColorChoice::Never), + Box::new(buf), rustc_driver_impl::default_translator(), ) .sm(Some(source_map.clone())); diff --git a/crates/spirv-std/macros/src/debug_printf.rs b/crates/spirv-std/macros/src/debug_printf.rs deleted file mode 100644 index f014cf2973..0000000000 --- a/crates/spirv-std/macros/src/debug_printf.rs +++ /dev/null @@ -1,249 +0,0 @@ -use proc_macro::TokenStream; -use proc_macro2::Span; -use std::fmt::Write; - -pub struct DebugPrintfInput { - pub span: Span, - pub format_string: String, - pub variables: Vec, -} - -impl syn::parse::Parse for DebugPrintfInput { - fn parse(input: syn::parse::ParseStream<'_>) -> syn::parse::Result { - let span = input.span(); - - if input.is_empty() { - return Ok(Self { - span, - format_string: Default::default(), - variables: Default::default(), - }); - } - - let format_string = input.parse::()?; - if !input.is_empty() { - input.parse::()?; - } - let variables = - syn::punctuated::Punctuated::::parse_terminated(input)?; - - Ok(Self { - span, - format_string: format_string.value(), - variables: variables.into_iter().collect(), - }) - } -} - -fn parse_error(message: &str, span: Span) -> TokenStream { - syn::Error::new(span, message).to_compile_error().into() -} - -enum FormatType { - Scalar { - ty: proc_macro2::TokenStream, - }, - Vector { - ty: proc_macro2::TokenStream, - width: usize, - }, -} - -pub fn debug_printf_inner(input: DebugPrintfInput) -> TokenStream { - let DebugPrintfInput { - format_string, - variables, - span, - } = input; - - fn map_specifier_to_type( - specifier: char, - chars: &mut std::str::Chars<'_>, - ) -> Option { - let mut peekable = chars.peekable(); - - Some(match specifier { - 'd' | 'i' => quote::quote! { i32 }, - 'o' | 'x' | 'X' => quote::quote! { u32 }, - 'a' | 'A' | 'e' | 'E' | 'f' | 'F' | 'g' | 'G' => quote::quote! { f32 }, - 'u' => { - if matches!(peekable.peek(), Some('l')) { - chars.next(); - quote::quote! { u64 } - } else { - quote::quote! { u32 } - } - } - 'l' => { - if matches!(peekable.peek(), Some('u' | 'x')) { - chars.next(); - quote::quote! { u64 } - } else { - return None; - } - } - _ => return None, - }) - } - - let mut chars = format_string.chars(); - let mut format_arguments = Vec::new(); - - while let Some(mut ch) = chars.next() { - if ch == '%' { - ch = match chars.next() { - Some('%') => continue, - None => return parse_error("Unterminated format specifier", span), - Some(ch) => ch, - }; - - let mut has_precision = false; - - while ch.is_ascii_digit() { - ch = match chars.next() { - Some(ch) => ch, - None => { - return parse_error( - "Unterminated format specifier: missing type after precision", - span, - ); - } - }; - - has_precision = true; - } - - if has_precision && ch == '.' { - ch = match chars.next() { - Some(ch) => ch, - None => { - return parse_error( - "Unterminated format specifier: missing type after decimal point", - span, - ); - } - }; - - while ch.is_ascii_digit() { - ch = match chars.next() { - Some(ch) => ch, - None => { - return parse_error( - "Unterminated format specifier: missing type after fraction precision", - span, - ); - } - }; - } - } - - if ch == 'v' { - let width = match chars.next() { - Some('2') => 2, - Some('3') => 3, - Some('4') => 4, - Some(ch) => { - return parse_error(&format!("Invalid width for vector: {ch}"), span); - } - None => return parse_error("Missing vector dimensions specifier", span), - }; - - ch = match chars.next() { - Some(ch) => ch, - None => return parse_error("Missing vector type specifier", span), - }; - - let ty = match map_specifier_to_type(ch, &mut chars) { - Some(ty) => ty, - _ => { - return parse_error( - &format!("Unrecognised vector type specifier: '{ch}'"), - span, - ); - } - }; - - format_arguments.push(FormatType::Vector { ty, width }); - } else { - let ty = match map_specifier_to_type(ch, &mut chars) { - Some(ty) => ty, - _ => { - return parse_error( - &format!("Unrecognised format specifier: '{ch}'"), - span, - ); - } - }; - - format_arguments.push(FormatType::Scalar { ty }); - } - } - } - - if format_arguments.len() != variables.len() { - return syn::Error::new( - span, - format!( - "{} % arguments were found, but {} variables were given", - format_arguments.len(), - variables.len() - ), - ) - .to_compile_error() - .into(); - } - - let mut variable_idents = String::new(); - let mut input_registers = Vec::new(); - let mut op_loads = Vec::new(); - - for (i, (variable, format_argument)) in variables.into_iter().zip(format_arguments).enumerate() - { - let ident = quote::format_ident!("_{}", i); - - let _ = write!(variable_idents, "%{ident} "); - - let assert_fn = match format_argument { - FormatType::Scalar { ty } => { - quote::quote! { spirv_std::debug_printf::assert_is_type::<#ty> } - } - FormatType::Vector { ty, width } => { - quote::quote! { spirv_std::debug_printf::assert_is_vector::<#ty, _, #width> } - } - }; - - input_registers.push(quote::quote! { - #ident = in(reg) &#assert_fn(#variable), - }); - - let op_load = format!("%{ident} = OpLoad _ {{{ident}}}"); - - op_loads.push(quote::quote! { - #op_load, - }); - } - - let input_registers = input_registers - .into_iter() - .collect::(); - let op_loads = op_loads.into_iter().collect::(); - // Escapes the '{' and '}' characters in the format string. - // Since the `asm!` macro expects '{' '}' to surround its arguments, we have to use '{{' and '}}' instead. - // The `asm!` macro will then later turn them back into '{' and '}'. - let format_string = format_string.replace('{', "{{").replace('}', "}}"); - - let op_string = format!("%string = OpString {format_string:?}"); - - let output = quote::quote! { - ::core::arch::asm!( - "%void = OpTypeVoid", - #op_string, - "%debug_printf = OpExtInstImport \"NonSemantic.DebugPrintf\"", - #op_loads - concat!("%result = OpExtInst %void %debug_printf 1 %string ", #variable_idents), - #input_registers - ) - }; - - output.into() -} diff --git a/crates/spirv-std/macros/src/lib.rs b/crates/spirv-std/macros/src/lib.rs index d8ecf7b0cf..504478b5ae 100644 --- a/crates/spirv-std/macros/src/lib.rs +++ b/crates/spirv-std/macros/src/lib.rs @@ -71,15 +71,16 @@ // #![allow()] #![doc = include_str!("../README.md")] -mod debug_printf; mod image; -mod sample_param_permutations; -use crate::debug_printf::{DebugPrintfInput, debug_printf_inner}; use proc_macro::TokenStream; -use proc_macro2::{Delimiter, Group, Ident, TokenTree}; +use proc_macro2::{Delimiter, Group, Ident, Span, TokenTree}; + +use syn::{ImplItemFn, visit_mut::VisitMut}; + use quote::{ToTokens, TokenStreamExt, format_ident, quote}; use spirv_std_types::spirv_attr_version::spirv_attr_with_version; +use std::fmt::Write; /// A macro for creating SPIR-V `OpTypeImage` types. Always produces a /// `spirv_std::image::Image<...>` type. @@ -264,9 +265,7 @@ pub fn gpu_only(_attr: TokenStream, item: TokenStream) -> TokenStream { #[cfg(not(target_arch="spirv"))] #[allow(unused_variables)] #(#attrs)* #vis #sig_cpu { - unimplemented!( - concat!("`", stringify!(#fn_name), "` is only available on SPIR-V platforms.") - ) + unimplemented!(concat!("`", stringify!(#fn_name), "` is only available on SPIR-V platforms.")) } #[cfg(target_arch="spirv")] @@ -301,6 +300,438 @@ pub fn debug_printfln(input: TokenStream) -> TokenStream { debug_printf_inner(input) } +struct DebugPrintfInput { + span: Span, + format_string: String, + variables: Vec, +} + +impl syn::parse::Parse for DebugPrintfInput { + fn parse(input: syn::parse::ParseStream<'_>) -> syn::parse::Result { + let span = input.span(); + + if input.is_empty() { + return Ok(Self { + span, + format_string: Default::default(), + variables: Default::default(), + }); + } + + let format_string = input.parse::()?; + if !input.is_empty() { + input.parse::()?; + } + let variables = + syn::punctuated::Punctuated::::parse_terminated(input)?; + + Ok(Self { + span, + format_string: format_string.value(), + variables: variables.into_iter().collect(), + }) + } +} + +fn parsing_error(message: &str, span: Span) -> TokenStream { + syn::Error::new(span, message).to_compile_error().into() +} + +enum FormatType { + Scalar { + ty: proc_macro2::TokenStream, + }, + Vector { + ty: proc_macro2::TokenStream, + width: usize, + }, +} + +fn debug_printf_inner(input: DebugPrintfInput) -> TokenStream { + let DebugPrintfInput { + format_string, + variables, + span, + } = input; + + fn map_specifier_to_type( + specifier: char, + chars: &mut std::str::Chars<'_>, + ) -> Option { + let mut peekable = chars.peekable(); + + Some(match specifier { + 'd' | 'i' => quote::quote! { i32 }, + 'o' | 'x' | 'X' => quote::quote! { u32 }, + 'a' | 'A' | 'e' | 'E' | 'f' | 'F' | 'g' | 'G' => quote::quote! { f32 }, + 'u' => { + if matches!(peekable.peek(), Some('l')) { + chars.next(); + quote::quote! { u64 } + } else { + quote::quote! { u32 } + } + } + 'l' => { + if matches!(peekable.peek(), Some('u' | 'x')) { + chars.next(); + quote::quote! { u64 } + } else { + return None; + } + } + _ => return None, + }) + } + + let mut chars = format_string.chars(); + let mut format_arguments = Vec::new(); + + while let Some(mut ch) = chars.next() { + if ch == '%' { + ch = match chars.next() { + Some('%') => continue, + None => return parsing_error("Unterminated format specifier", span), + Some(ch) => ch, + }; + + let mut has_precision = false; + + while ch.is_ascii_digit() { + ch = match chars.next() { + Some(ch) => ch, + None => { + return parsing_error( + "Unterminated format specifier: missing type after precision", + span, + ); + } + }; + + has_precision = true; + } + + if has_precision && ch == '.' { + ch = match chars.next() { + Some(ch) => ch, + None => { + return parsing_error( + "Unterminated format specifier: missing type after decimal point", + span, + ); + } + }; + + while ch.is_ascii_digit() { + ch = match chars.next() { + Some(ch) => ch, + None => { + return parsing_error( + "Unterminated format specifier: missing type after fraction precision", + span, + ); + } + }; + } + } + + if ch == 'v' { + let width = match chars.next() { + Some('2') => 2, + Some('3') => 3, + Some('4') => 4, + Some(ch) => { + return parsing_error(&format!("Invalid width for vector: {ch}"), span); + } + None => return parsing_error("Missing vector dimensions specifier", span), + }; + + ch = match chars.next() { + Some(ch) => ch, + None => return parsing_error("Missing vector type specifier", span), + }; + + let ty = match map_specifier_to_type(ch, &mut chars) { + Some(ty) => ty, + _ => { + return parsing_error( + &format!("Unrecognised vector type specifier: '{ch}'"), + span, + ); + } + }; + + format_arguments.push(FormatType::Vector { ty, width }); + } else { + let ty = match map_specifier_to_type(ch, &mut chars) { + Some(ty) => ty, + _ => { + return parsing_error( + &format!("Unrecognised format specifier: '{ch}'"), + span, + ); + } + }; + + format_arguments.push(FormatType::Scalar { ty }); + } + } + } + + if format_arguments.len() != variables.len() { + return syn::Error::new( + span, + format!( + "{} % arguments were found, but {} variables were given", + format_arguments.len(), + variables.len() + ), + ) + .to_compile_error() + .into(); + } + + let mut variable_idents = String::new(); + let mut input_registers = Vec::new(); + let mut op_loads = Vec::new(); + + for (i, (variable, format_argument)) in variables.into_iter().zip(format_arguments).enumerate() + { + let ident = quote::format_ident!("_{}", i); + + let _ = write!(variable_idents, "%{ident} "); + + let assert_fn = match format_argument { + FormatType::Scalar { ty } => { + quote::quote! { spirv_std::debug_printf_assert_is_type::<#ty> } + } + FormatType::Vector { ty, width } => { + quote::quote! { spirv_std::debug_printf_assert_is_vector::<#ty, _, #width> } + } + }; + + input_registers.push(quote::quote! { + #ident = in(reg) &#assert_fn(#variable), + }); + + let op_load = format!("%{ident} = OpLoad _ {{{ident}}}"); + + op_loads.push(quote::quote! { + #op_load, + }); + } + + let input_registers = input_registers + .into_iter() + .collect::(); + let op_loads = op_loads.into_iter().collect::(); + // Escapes the '{' and '}' characters in the format string. + // Since the `asm!` macro expects '{' '}' to surround its arguments, we have to use '{{' and '}}' instead. + // The `asm!` macro will then later turn them back into '{' and '}'. + let format_string = format_string.replace('{', "{{").replace('}', "}}"); + + let op_string = format!("%string = OpString {format_string:?}"); + + let output = quote::quote! { + ::core::arch::asm!( + "%void = OpTypeVoid", + #op_string, + "%debug_printf = OpExtInstImport \"NonSemantic.DebugPrintf\"", + #op_loads + concat!("%result = OpExtInst %void %debug_printf 1 %string ", #variable_idents), + #input_registers + ) + }; + + output.into() +} + +const SAMPLE_PARAM_COUNT: usize = 4; +const SAMPLE_PARAM_GENERICS: [&str; SAMPLE_PARAM_COUNT] = ["B", "L", "G", "S"]; +const SAMPLE_PARAM_TYPES: [&str; SAMPLE_PARAM_COUNT] = ["B", "L", "(G,G)", "S"]; +const SAMPLE_PARAM_OPERANDS: [&str; SAMPLE_PARAM_COUNT] = ["Bias", "Lod", "Grad", "Sample"]; +const SAMPLE_PARAM_NAMES: [&str; SAMPLE_PARAM_COUNT] = ["bias", "lod", "grad", "sample_index"]; +const SAMPLE_PARAM_GRAD_INDEX: usize = 2; // Grad requires some special handling because it uses 2 arguments +const SAMPLE_PARAM_EXPLICIT_LOD_MASK: usize = 0b0110; // which params require the use of ExplicitLod rather than ImplicitLod + +fn is_grad(i: usize) -> bool { + i == SAMPLE_PARAM_GRAD_INDEX +} + +struct SampleImplRewriter(usize, syn::Type); + +impl SampleImplRewriter { + pub fn rewrite(mask: usize, f: &syn::ItemImpl) -> syn::ItemImpl { + let mut new_impl = f.clone(); + let mut ty_str = String::from("SampleParams<"); + + // based on the mask, form a `SampleParams` type string and add the generic parameters to the `impl<>` generics + // example type string: `"SampleParams, NoneTy, NoneTy>"` + for i in 0..SAMPLE_PARAM_COUNT { + if mask & (1 << i) != 0 { + new_impl.generics.params.push(syn::GenericParam::Type( + syn::Ident::new(SAMPLE_PARAM_GENERICS[i], Span::call_site()).into(), + )); + ty_str.push_str("SomeTy<"); + ty_str.push_str(SAMPLE_PARAM_TYPES[i]); + ty_str.push('>'); + } else { + ty_str.push_str("NoneTy"); + } + ty_str.push(','); + } + ty_str.push('>'); + let ty: syn::Type = syn::parse(ty_str.parse().unwrap()).unwrap(); + + // use the type to insert it into the generic argument of the trait we're implementing + // e.g., `ImageWithMethods` becomes `ImageWithMethods, NoneTy, NoneTy>>` + if let Some(t) = &mut new_impl.trait_ + && let syn::PathArguments::AngleBracketed(a) = + &mut t.1.segments.last_mut().unwrap().arguments + && let Some(syn::GenericArgument::Type(t)) = a.args.last_mut() + { + *t = ty.clone(); + } + + // rewrite the implemented functions + SampleImplRewriter(mask, ty).visit_item_impl_mut(&mut new_impl); + new_impl + } + + // generates an operands string for use in the assembly, e.g. "Bias %bias Lod %lod", based on the mask + #[allow(clippy::needless_range_loop)] + fn get_operands(&self) -> String { + let mut op = String::new(); + for i in 0..SAMPLE_PARAM_COUNT { + if self.0 & (1 << i) != 0 { + if is_grad(i) { + op.push_str("Grad %grad_x %grad_y "); + } else { + op.push_str(SAMPLE_PARAM_OPERANDS[i]); + op.push_str(" %"); + op.push_str(SAMPLE_PARAM_NAMES[i]); + op.push(' '); + } + } + } + op + } + + // generates list of assembly loads for the data, e.g. "%bias = OpLoad _ {bias}", etc. + #[allow(clippy::needless_range_loop)] + fn add_loads(&self, t: &mut Vec) { + for i in 0..SAMPLE_PARAM_COUNT { + if self.0 & (1 << i) != 0 { + if is_grad(i) { + t.push(TokenTree::Literal(proc_macro2::Literal::string( + "%grad_x = OpLoad _ {grad_x}", + ))); + t.push(TokenTree::Punct(proc_macro2::Punct::new( + ',', + proc_macro2::Spacing::Alone, + ))); + t.push(TokenTree::Literal(proc_macro2::Literal::string( + "%grad_y = OpLoad _ {grad_y}", + ))); + t.push(TokenTree::Punct(proc_macro2::Punct::new( + ',', + proc_macro2::Spacing::Alone, + ))); + } else { + let s = format!("%{0} = OpLoad _ {{{0}}}", SAMPLE_PARAM_NAMES[i]); + t.push(TokenTree::Literal(proc_macro2::Literal::string(s.as_str()))); + t.push(TokenTree::Punct(proc_macro2::Punct::new( + ',', + proc_macro2::Spacing::Alone, + ))); + } + } + } + } + + // generates list of register specifications, e.g. `bias = in(reg) ¶ms.bias.0, ...` as separate tokens + #[allow(clippy::needless_range_loop)] + fn add_regs(&self, t: &mut Vec) { + for i in 0..SAMPLE_PARAM_COUNT { + if self.0 & (1 << i) != 0 { + // HACK(eddyb) the extra `{...}` force the pointers to be to + // fresh variables holding value copies, instead of the originals, + // allowing `OpLoad _` inference to pick the appropriate type. + let s = if is_grad(i) { + "grad_x=in(reg) &{params.grad.0.0},grad_y=in(reg) &{params.grad.0.1}," + .to_string() + } else { + format!("{0} = in(reg) &{{params.{0}.0}},", SAMPLE_PARAM_NAMES[i]) + }; + let ts: proc_macro2::TokenStream = s.parse().unwrap(); + t.extend(ts); + } + } + } +} + +impl VisitMut for SampleImplRewriter { + fn visit_impl_item_fn_mut(&mut self, item: &mut ImplItemFn) { + // rewrite the last parameter of this method to be of type `SampleParams<...>` we generated earlier + if let Some(syn::FnArg::Typed(p)) = item.sig.inputs.last_mut() { + *p.ty.as_mut() = self.1.clone(); + } + syn::visit_mut::visit_impl_item_fn_mut(self, item); + } + + fn visit_macro_mut(&mut self, m: &mut syn::Macro) { + if m.path.is_ident("asm") { + // this is where the asm! block is manipulated + let t = m.tokens.clone(); + let mut new_t = Vec::new(); + let mut altered = false; + + for tt in t { + match tt { + TokenTree::Literal(l) => { + if let Ok(l) = syn::parse::(l.to_token_stream().into()) { + // found a string literal + let s = l.value(); + if s.contains("$PARAMS") { + altered = true; + // add load instructions before the sampling instruction + self.add_loads(&mut new_t); + // and insert image operands + let s = s.replace("$PARAMS", &self.get_operands()); + let lod_type = if self.0 & SAMPLE_PARAM_EXPLICIT_LOD_MASK != 0 { + "ExplicitLod" + } else { + "ImplicitLod " + }; + let s = s.replace("$LOD", lod_type); + + new_t.push(TokenTree::Literal(proc_macro2::Literal::string( + s.as_str(), + ))); + } else { + new_t.push(TokenTree::Literal(l.token())); + } + } else { + new_t.push(TokenTree::Literal(l)); + } + } + _ => { + new_t.push(tt); + } + } + } + + if altered { + // finally, add register specs + self.add_regs(&mut new_t); + } + + // replace all tokens within the asm! block with our new list + m.tokens = new_t.into_iter().collect(); + } + } +} + /// Generates permutations of an `ImageWithMethods` implementation containing sampling functions /// that have asm instruction ending with a placeholder `$PARAMS` operand. The last parameter /// of each function must be named `params`, its type will be rewritten. Relevant generic @@ -309,5 +740,14 @@ pub fn debug_printfln(input: TokenStream) -> TokenStream { #[proc_macro_attribute] #[doc(hidden)] pub fn gen_sample_param_permutations(_attr: TokenStream, item: TokenStream) -> TokenStream { - sample_param_permutations::gen_sample_param_permutations(item) + let item_impl = syn::parse_macro_input!(item as syn::ItemImpl); + let mut fns = Vec::new(); + + for m in 1..(1 << SAMPLE_PARAM_COUNT) { + fns.push(SampleImplRewriter::rewrite(m, &item_impl)); + } + + // uncomment to output generated tokenstream to stdout + //println!("{}", quote! { #(#fns)* }.to_string()); + quote! { #(#fns)* }.into() } diff --git a/crates/spirv-std/macros/src/sample_param_permutations.rs b/crates/spirv-std/macros/src/sample_param_permutations.rs deleted file mode 100644 index f8205e30f3..0000000000 --- a/crates/spirv-std/macros/src/sample_param_permutations.rs +++ /dev/null @@ -1,204 +0,0 @@ -use proc_macro::TokenStream; -use proc_macro2::{Span, TokenTree}; -use quote::{ToTokens, quote}; -use syn::ImplItemFn; -use syn::visit_mut::VisitMut; - -const SAMPLE_PARAM_COUNT: usize = 4; -const SAMPLE_PARAM_GENERICS: [&str; SAMPLE_PARAM_COUNT] = ["B", "L", "G", "S"]; -const SAMPLE_PARAM_TYPES: [&str; SAMPLE_PARAM_COUNT] = ["B", "L", "(G,G)", "S"]; -const SAMPLE_PARAM_OPERANDS: [&str; SAMPLE_PARAM_COUNT] = ["Bias", "Lod", "Grad", "Sample"]; -const SAMPLE_PARAM_NAMES: [&str; SAMPLE_PARAM_COUNT] = ["bias", "lod", "grad", "sample_index"]; -const SAMPLE_PARAM_GRAD_INDEX: usize = 2; // Grad requires some special handling because it uses 2 arguments -const SAMPLE_PARAM_EXPLICIT_LOD_MASK: usize = 0b0110; // which params require the use of ExplicitLod rather than ImplicitLod - -fn is_grad(i: usize) -> bool { - i == SAMPLE_PARAM_GRAD_INDEX -} - -struct SampleImplRewriter(usize, syn::Type); - -impl SampleImplRewriter { - pub fn rewrite(mask: usize, f: &syn::ItemImpl) -> syn::ItemImpl { - let mut new_impl = f.clone(); - let mut ty_str = String::from("SampleParams<"); - - // based on the mask, form a `SampleParams` type string and add the generic parameters to the `impl<>` generics - // example type string: `"SampleParams, NoneTy, NoneTy>"` - for i in 0..SAMPLE_PARAM_COUNT { - if mask & (1 << i) != 0 { - new_impl.generics.params.push(syn::GenericParam::Type( - syn::Ident::new(SAMPLE_PARAM_GENERICS[i], Span::call_site()).into(), - )); - ty_str.push_str("SomeTy<"); - ty_str.push_str(SAMPLE_PARAM_TYPES[i]); - ty_str.push('>'); - } else { - ty_str.push_str("NoneTy"); - } - ty_str.push(','); - } - ty_str.push('>'); - let ty: syn::Type = syn::parse(ty_str.parse().unwrap()).unwrap(); - - // use the type to insert it into the generic argument of the trait we're implementing - // e.g., `ImageWithMethods` becomes `ImageWithMethods, NoneTy, NoneTy>>` - if let Some(t) = &mut new_impl.trait_ - && let syn::PathArguments::AngleBracketed(a) = - &mut t.1.segments.last_mut().unwrap().arguments - && let Some(syn::GenericArgument::Type(t)) = a.args.last_mut() - { - *t = ty.clone(); - } - - // rewrite the implemented functions - SampleImplRewriter(mask, ty).visit_item_impl_mut(&mut new_impl); - new_impl - } - - // generates an operands string for use in the assembly, e.g. "Bias %bias Lod %lod", based on the mask - #[allow(clippy::needless_range_loop)] - fn get_operands(&self) -> String { - let mut op = String::new(); - for i in 0..SAMPLE_PARAM_COUNT { - if self.0 & (1 << i) != 0 { - if is_grad(i) { - op.push_str("Grad %grad_x %grad_y "); - } else { - op.push_str(SAMPLE_PARAM_OPERANDS[i]); - op.push_str(" %"); - op.push_str(SAMPLE_PARAM_NAMES[i]); - op.push(' '); - } - } - } - op - } - - // generates list of assembly loads for the data, e.g. "%bias = OpLoad _ {bias}", etc. - #[allow(clippy::needless_range_loop)] - fn add_loads(&self, t: &mut Vec) { - for i in 0..SAMPLE_PARAM_COUNT { - if self.0 & (1 << i) != 0 { - if is_grad(i) { - t.push(TokenTree::Literal(proc_macro2::Literal::string( - "%grad_x = OpLoad _ {grad_x}", - ))); - t.push(TokenTree::Punct(proc_macro2::Punct::new( - ',', - proc_macro2::Spacing::Alone, - ))); - t.push(TokenTree::Literal(proc_macro2::Literal::string( - "%grad_y = OpLoad _ {grad_y}", - ))); - t.push(TokenTree::Punct(proc_macro2::Punct::new( - ',', - proc_macro2::Spacing::Alone, - ))); - } else { - let s = format!("%{0} = OpLoad _ {{{0}}}", SAMPLE_PARAM_NAMES[i]); - t.push(TokenTree::Literal(proc_macro2::Literal::string(s.as_str()))); - t.push(TokenTree::Punct(proc_macro2::Punct::new( - ',', - proc_macro2::Spacing::Alone, - ))); - } - } - } - } - - // generates list of register specifications, e.g. `bias = in(reg) ¶ms.bias.0, ...` as separate tokens - #[allow(clippy::needless_range_loop)] - fn add_regs(&self, t: &mut Vec) { - for i in 0..SAMPLE_PARAM_COUNT { - if self.0 & (1 << i) != 0 { - // HACK(eddyb) the extra `{...}` force the pointers to be to - // fresh variables holding value copies, instead of the originals, - // allowing `OpLoad _` inference to pick the appropriate type. - let s = if is_grad(i) { - "grad_x=in(reg) &{params.grad.0.0},grad_y=in(reg) &{params.grad.0.1}," - .to_string() - } else { - format!("{0} = in(reg) &{{params.{0}.0}},", SAMPLE_PARAM_NAMES[i]) - }; - let ts: proc_macro2::TokenStream = s.parse().unwrap(); - t.extend(ts); - } - } - } -} - -impl VisitMut for SampleImplRewriter { - fn visit_impl_item_fn_mut(&mut self, item: &mut ImplItemFn) { - // rewrite the last parameter of this method to be of type `SampleParams<...>` we generated earlier - if let Some(syn::FnArg::Typed(p)) = item.sig.inputs.last_mut() { - *p.ty.as_mut() = self.1.clone(); - } - syn::visit_mut::visit_impl_item_fn_mut(self, item); - } - - fn visit_macro_mut(&mut self, m: &mut syn::Macro) { - if m.path.is_ident("asm") { - // this is where the asm! block is manipulated - let t = m.tokens.clone(); - let mut new_t = Vec::new(); - let mut altered = false; - - for tt in t { - match tt { - TokenTree::Literal(l) => { - if let Ok(l) = syn::parse::(l.to_token_stream().into()) { - // found a string literal - let s = l.value(); - if s.contains("$PARAMS") { - altered = true; - // add load instructions before the sampling instruction - self.add_loads(&mut new_t); - // and insert image operands - let s = s.replace("$PARAMS", &self.get_operands()); - let lod_type = if self.0 & SAMPLE_PARAM_EXPLICIT_LOD_MASK != 0 { - "ExplicitLod" - } else { - "ImplicitLod" - }; - let s = s.replace("$LOD", lod_type); - - new_t.push(TokenTree::Literal(proc_macro2::Literal::string( - s.as_str(), - ))); - } else { - new_t.push(TokenTree::Literal(l.token())); - } - } else { - new_t.push(TokenTree::Literal(l)); - } - } - _ => { - new_t.push(tt); - } - } - } - - if altered { - // finally, add register specs - self.add_regs(&mut new_t); - } - - // replace all tokens within the asm! block with our new list - m.tokens = new_t.into_iter().collect(); - } - } -} - -pub fn gen_sample_param_permutations(item: TokenStream) -> TokenStream { - let item_impl = syn::parse_macro_input!(item as syn::ItemImpl); - let mut fns = Vec::new(); - - for m in 1..(1 << SAMPLE_PARAM_COUNT) { - fns.push(SampleImplRewriter::rewrite(m, &item_impl)); - } - - // uncomment to output generated tokenstream to stdout - //println!("{}", quote! { #(#fns)* }.to_string()); - quote! { #(#fns)* }.into() -} diff --git a/crates/spirv-std/src/arch.rs b/crates/spirv-std/src/arch.rs index fe12b8ef56..d5c6c6a533 100644 --- a/crates/spirv-std/src/arch.rs +++ b/crates/spirv-std/src/arch.rs @@ -4,8 +4,12 @@ //! These functions will typically map to a single instruction, and will perform //! no additional safety checks beyond type-checking. #[cfg(target_arch = "spirv")] -use crate::Integer; -use crate::{Scalar, SignedInteger, UnsignedInteger, Vector}; +use crate::integer::Integer; +use crate::{ + integer::{SignedInteger, UnsignedInteger}, + scalar::Scalar, + vector::Vector, +}; #[cfg(target_arch = "spirv")] use core::arch::asm; use glam::UVec2; diff --git a/crates/spirv-std/src/arch/atomics.rs b/crates/spirv-std/src/arch/atomics.rs index 38ff3d077c..d818a0e0fd 100644 --- a/crates/spirv-std/src/arch/atomics.rs +++ b/crates/spirv-std/src/arch/atomics.rs @@ -1,7 +1,11 @@ #[cfg(target_arch = "spirv")] use core::arch::asm; -use crate::{Float, Integer, Number, SignedInteger, UnsignedInteger}; +use crate::{ + float::Float, + integer::{Integer, SignedInteger, UnsignedInteger}, + number::Number, +}; /// Atomically load through `ptr` using the given `SEMANTICS`. All subparts of /// the value that is loaded are read atomically with respect to all other diff --git a/crates/spirv-std/src/arch/subgroup.rs b/crates/spirv-std/src/arch/subgroup.rs index a9690d4190..05798a6f1d 100644 --- a/crates/spirv-std/src/arch/subgroup.rs +++ b/crates/spirv-std/src/arch/subgroup.rs @@ -1,9 +1,10 @@ -use crate::ScalarOrVector; #[cfg(target_arch = "spirv")] use crate::arch::barrier; +use crate::float::Float; +use crate::integer::{Integer, SignedInteger, UnsignedInteger}; #[cfg(target_arch = "spirv")] use crate::memory::{Scope, Semantics}; -use crate::{Float, Integer, SignedInteger, UnsignedInteger}; +use crate::vector::VectorOrScalar; #[cfg(target_arch = "spirv")] use core::arch::asm; @@ -243,7 +244,7 @@ pub fn subgroup_any(predicate: bool) -> bool { #[spirv_std_macros::gpu_only] #[doc(alias = "OpGroupNonUniformAllEqual")] #[inline] -pub fn subgroup_all_equal(value: T) -> bool { +pub fn subgroup_all_equal(value: T) -> bool { let mut result = false; unsafe { @@ -280,14 +281,13 @@ pub fn subgroup_all_equal(value: T) -> bool { /// Requires Capability `GroupNonUniformBallot`. /// /// # Safety -/// * `id` must be dynamically uniform +/// * `id` must not be dynamically uniform +/// * before 1.5: `id` must be constant /// * Result is undefined if `id` is an inactive invocation or out of bounds -/// * This variant with a dynamic `id` requires at least `spv1.5` or `vulkan1.2`. Alternatively, you can use -/// [`subgroup_broadcast_const`] with a constant `id`. #[spirv_std_macros::gpu_only] #[doc(alias = "OpGroupNonUniformBroadcast")] #[inline] -pub unsafe fn subgroup_broadcast(value: T, id: u32) -> T { +pub unsafe fn subgroup_broadcast(value: T, id: u32) -> T { let mut result = T::default(); unsafe { @@ -308,48 +308,6 @@ pub unsafe fn subgroup_broadcast(value: T, id: u32) -> T { result } -/// Result is the `value` of the invocation identified by the id `id` to all active invocations in the group. -/// -/// Result Type must be a scalar or vector of floating-point type, integer type, or Boolean type. -/// -/// Execution is a Scope that identifies the group of invocations affected by this command. It must be Subgroup. -/// -/// The type of `value` must be the same as Result Type. -/// -/// `id` must be a scalar of integer type, whose Signedness operand is 0. -/// -/// Before version 1.5, `id` must come from a constant instruction. Starting with version 1.5, this restriction is lifted. However, behavior is undefined when `id` is not dynamically uniform. -/// -/// The resulting value is undefined if `id` is an inactive invocation, or is greater than or equal to the size of the group. -/// -/// Requires Capability `GroupNonUniformBallot`. -/// -/// # Safety -/// * Result is undefined if `id` is an inactive invocation or out of bounds -#[spirv_std_macros::gpu_only] -#[doc(alias = "OpGroupNonUniformBroadcast")] -#[inline] -pub unsafe fn subgroup_broadcast_const(value: T) -> T { - let mut result = T::default(); - - unsafe { - asm! { - "%u32 = OpTypeInt 32 0", - "%subgroup = OpConstant %u32 {subgroup}", - "%id = OpConstant %u32 {id}", - "%value = OpLoad _ {value}", - "%result = OpGroupNonUniformBroadcast _ %subgroup %value %id", - "OpStore {result} %result", - subgroup = const SUBGROUP, - value = in(reg) &value, - id = const ID, - result = in(reg) &mut result, - } - } - - result -} - /// Result is the `value` of the invocation from the active invocation with the lowest id in the group to all active invocations in the group. /// /// Result Type must be a scalar or vector of floating-point type, integer type, or Boolean type. @@ -362,7 +320,7 @@ pub unsafe fn subgroup_broadcast_const(value: #[spirv_std_macros::gpu_only] #[doc(alias = "OpGroupNonUniformBroadcastFirst")] #[inline] -pub fn subgroup_broadcast_first(value: T) -> T { +pub fn subgroup_broadcast_first(value: T) -> T { let mut result = T::default(); unsafe { @@ -637,7 +595,7 @@ pub fn subgroup_ballot_find_msb(value: SubgroupMask) -> u32 { #[spirv_std_macros::gpu_only] #[doc(alias = "OpGroupNonUniformShuffle")] #[inline] -pub fn subgroup_shuffle(value: T, id: u32) -> T { +pub fn subgroup_shuffle(value: T, id: u32) -> T { let mut result = T::default(); unsafe { @@ -678,7 +636,7 @@ pub fn subgroup_shuffle(value: T, id: u32) -> T { #[spirv_std_macros::gpu_only] #[doc(alias = "OpGroupNonUniformShuffleXor")] #[inline] -pub fn subgroup_shuffle_xor(value: T, mask: u32) -> T { +pub fn subgroup_shuffle_xor(value: T, mask: u32) -> T { let mut result = T::default(); unsafe { @@ -719,7 +677,7 @@ pub fn subgroup_shuffle_xor(value: T, mask: u32) -> T { #[spirv_std_macros::gpu_only] #[doc(alias = "OpGroupNonUniformShuffleUp")] #[inline] -pub fn subgroup_shuffle_up(value: T, delta: u32) -> T { +pub fn subgroup_shuffle_up(value: T, delta: u32) -> T { let mut result = T::default(); unsafe { @@ -760,7 +718,7 @@ pub fn subgroup_shuffle_up(value: T, delta: u32) -> T { #[spirv_std_macros::gpu_only] #[doc(alias = "OpGroupNonUniformShuffleDown")] #[inline] -pub fn subgroup_shuffle_down(value: T, delta: u32) -> T { +pub fn subgroup_shuffle_down(value: T, delta: u32) -> T { let mut result = T::default(); unsafe { @@ -787,7 +745,7 @@ macro_rules! macro_subgroup_op { #[spirv_std_macros::gpu_only] #[doc(alias = $asm_op)] #[inline] - pub fn $name>( + pub fn $name>( value: I, ) -> I { let mut result = I::default(); @@ -815,7 +773,7 @@ macro_rules! macro_subgroup_op_clustered { #[spirv_std_macros::gpu_only] #[doc(alias = $asm_op)] #[inline] - pub unsafe fn $name>( + pub unsafe fn $name>( value: I, ) -> I { const { @@ -1387,7 +1345,7 @@ Requires Capability `GroupNonUniformArithmetic` and `GroupNonUniformClustered`. #[spirv_std_macros::gpu_only] #[doc(alias = "OpGroupNonUniformQuadBroadcast")] #[inline] -pub fn subgroup_quad_broadcast(value: T, index: u32) -> T { +pub fn subgroup_quad_broadcast(value: T, index: u32) -> T { let mut result = T::default(); unsafe { @@ -1470,7 +1428,7 @@ pub enum QuadDirection { #[spirv_std_macros::gpu_only] #[doc(alias = "OpGroupNonUniformQuadSwap")] #[inline] -pub fn subgroup_quad_swap(value: T) -> T { +pub fn subgroup_quad_swap(value: T) -> T { let mut result = T::default(); unsafe { diff --git a/crates/spirv-std/src/debug_printf.rs b/crates/spirv-std/src/debug_printf.rs deleted file mode 100644 index f58563a918..0000000000 --- a/crates/spirv-std/src/debug_printf.rs +++ /dev/null @@ -1,13 +0,0 @@ -//! support functions for debug printf - -use crate::{Scalar, Vector}; - -#[doc(hidden)] -pub fn assert_is_type(ty: T) -> T { - ty -} - -#[doc(hidden)] -pub fn assert_is_vector, const SIZE: usize>(vec: V) -> V { - vec -} diff --git a/crates/spirv-std/src/float.rs b/crates/spirv-std/src/float.rs index d9e8939376..89d6a0745a 100644 --- a/crates/spirv-std/src/float.rs +++ b/crates/spirv-std/src/float.rs @@ -4,6 +4,24 @@ use core::arch::asm; use glam::{Vec2, Vec4}; +/// Abstract trait representing a SPIR-V floating point type. +/// +/// # Safety +/// Implementing this trait on non-primitive-float types breaks assumptions of other unsafe code, +/// and should not be done. +pub unsafe trait Float: num_traits::Float + crate::scalar::Scalar + Default { + /// Width of the float, in bits. + const WIDTH: usize; +} + +unsafe impl Float for f32 { + const WIDTH: usize = 32; +} + +unsafe impl Float for f64 { + const WIDTH: usize = 64; +} + /// Converts two f32 values (floats) into two f16 values (halfs). The result is a u32, with the low /// 16 bits being the first f16, and the high 16 bits being the second f16. #[spirv_std_macros::gpu_only] diff --git a/crates/spirv-std/src/image.rs b/crates/spirv-std/src/image.rs index 9fa844d087..8d4eef8b63 100644 --- a/crates/spirv-std/src/image.rs +++ b/crates/spirv-std/src/image.rs @@ -1,22 +1,25 @@ //! Image types -pub use self::params::{ImageCoordinate, ImageCoordinateSubpassData, ImageSizeQuery, SampleType}; #[cfg(target_arch = "spirv")] -use crate::VectorTruncateInto; -pub use crate::macros::Image; -use crate::{Float, Integer, Sampler, Vector}; +use crate::vector::VectorTruncateInto; #[cfg(target_arch = "spirv")] use core::arch::asm; -use sample_with::{NoneTy, SampleParams, SomeTy}; -pub use spirv_std_types::image_params::{ - AccessQualifier, Arrayed, Dimensionality, ImageDepth, ImageFormat, Multisampled, Sampled, -}; mod params; /// Contains extra image operands pub mod sample_with; +pub use self::params::{ImageCoordinate, ImageCoordinateSubpassData, ImageSizeQuery, SampleType}; +pub use crate::macros::Image; +pub use spirv_std_types::image_params::{ + AccessQualifier, Arrayed, Dimensionality, ImageDepth, ImageFormat, Multisampled, Sampled, +}; + +use sample_with::{NoneTy, SampleParams, SomeTy}; + +use crate::{Sampler, float::Float, integer::Integer, vector::Vector}; + /// Re-export of primitive types to ensure the `Image` proc macro always points /// to the right type. #[doc(hidden)] diff --git a/crates/spirv-std/src/image/params.rs b/crates/spirv-std/src/image/params.rs index 190fa1bdfb..b4da908e55 100644 --- a/crates/spirv-std/src/image/params.rs +++ b/crates/spirv-std/src/image/params.rs @@ -1,5 +1,5 @@ use super::{Arrayed, Dimensionality, ImageFormat}; -use crate::{Integer, Scalar, Vector, VectorTruncateInto}; +use crate::{integer::Integer, scalar::Scalar, vector::Vector, vector::VectorTruncateInto}; /// Marker trait for arguments that accept single scalar values or vectors /// of scalars. Defines 2-, 3- and 4-component vector types based on the sample type. @@ -20,39 +20,27 @@ pub trait SampleType: Scalar { /// Helper macro to implement `SampleType` of various formats for various scalar types. macro_rules! sample_type_impls { ($($fmt:ident : $n:tt*$s:ty => ($v1:ty, $v2:ty, $v3:ty, $v4:ty)),+ $(,)?) => { - $(sample_type_impls! { @single_rule, $fmt : $n*$s => ($v1,$v2,$v3,$v4) })+ + $(sample_type_impls!{@single_rule, $fmt : $n*$s => ($v1,$v2,$v3,$v4)})+ }; (@single_rule, $fmt:ident : n*$s:ty => ($v1:ty, $v2:ty, $v3:ty, $v4:ty)) => { - sample_type_impls! { @single_rule, $fmt: 1*$s => ($v1, $v2, $v3, $v4) } - sample_type_impls! { @single_rule, $fmt: 2*$s => ($v1, $v2, $v3, $v4) } - sample_type_impls! { @single_rule, $fmt: 3*$s => ($v1, $v2, $v3, $v4) } - sample_type_impls! { @single_rule, $fmt: 4*$s => ($v1, $v2, $v3, $v4) } - }; - (@single_rule, $fmt:ident : 1*$s:ty => ($v1:ty, $v2:ty, $v3:ty, $v4:ty)) => { impl SampleType<{ ImageFormat::$fmt as u32 }, 1> for $s { type SampleResult = $v1; type Vec2 = $v2; type Vec3 = $v3; type Vec4 = $v4; } - }; - (@single_rule, $fmt:ident : 2*$s:ty => ($v1:ty, $v2:ty, $v3:ty, $v4:ty)) => { impl SampleType<{ ImageFormat::$fmt as u32 }, 2> for $s { type SampleResult = $v2; type Vec2 = $v2; type Vec3 = $v3; type Vec4 = $v4; } - }; - (@single_rule, $fmt:ident : 3*$s:ty => ($v1:ty, $v2:ty, $v3:ty, $v4:ty)) => { impl SampleType<{ ImageFormat::$fmt as u32 }, 3> for $s { type SampleResult = $v3; type Vec2 = $v2; type Vec3 = $v3; type Vec4 = $v4; } - }; - (@single_rule, $fmt:ident : 4*$s:ty => ($v1:ty, $v2:ty, $v3:ty, $v4:ty)) => { impl SampleType<{ ImageFormat::$fmt as u32 }, 4> for $s { type SampleResult = $v4; type Vec2 = $v2; @@ -60,6 +48,46 @@ macro_rules! sample_type_impls { type Vec4 = $v4; } }; + (@single_rule, $($fmt:ident : 1*$s:ty => ($v1:ty, $v2:ty, $v3:ty, $v4:ty)),+ $(,)?) => { + $( + impl SampleType<{ ImageFormat::$fmt as u32 }, 1> for $s { + type SampleResult = $v1; + type Vec2 = $v2; + type Vec3 = $v3; + type Vec4 = $v4; + } + )+ + }; + (@single_rule, $($fmt:ident : 2*$s:ty => ($v1:ty, $v2:ty, $v3:ty, $v4:ty)),+ $(,)?) => { + $( + impl SampleType<{ ImageFormat::$fmt as u32 }, 2> for $s { + type SampleResult = $v2; + type Vec2 = $v2; + type Vec3 = $v3; + type Vec4 = $v4; + } + )+ + }; + (@single_rule, $($fmt:ident : 3*$s:ty => ($v1:ty, $v2:ty, $v3:ty, $v4:ty)),+ $(,)?) => { + $( + impl SampleType<{ ImageFormat::$fmt as u32 }, 3> for $s { + type SampleResult = $v3; + type Vec2 = $v2; + type Vec3 = $v3; + type Vec4 = $v4; + } + )+ + }; + (@single_rule, $($fmt:ident : 4*$s:ty => ($v1:ty, $v2:ty, $v3:ty, $v4:ty)),+ $(,)?) => { + $( + impl SampleType<{ ImageFormat::$fmt as u32 }, 4> for $s { + type SampleResult = $v4; + type Vec2 = $v2; + type Vec3 = $v3; + type Vec4 = $v4; + } + )+ + }; } sample_type_impls! { diff --git a/crates/spirv-std/src/integer.rs b/crates/spirv-std/src/integer.rs new file mode 100644 index 0000000000..083bae617a --- /dev/null +++ b/crates/spirv-std/src/integer.rs @@ -0,0 +1,52 @@ +//! Traits related to integers. + +/// Abstract trait representing any SPIR-V integer type. +/// +/// # Safety +/// Implementing this trait on non-primitive-integer types breaks assumptions of other unsafe code, +/// and should not be done. +pub unsafe trait Integer: num_traits::PrimInt + crate::scalar::Scalar { + /// Width of the integer, in bits. + const WIDTH: usize; + /// If the integer is signed: true means signed, false means unsigned. + const SIGNED: bool; +} + +/// A trait for being generic over signed integer types. +pub trait SignedInteger: Integer {} +/// A trait for being generic over unsigned integer types. +pub trait UnsignedInteger: Integer {} + +macro_rules! impl_numbers { + (impl UnsignedInteger for $typ:ty;) => { + unsafe impl Integer for $typ { + const WIDTH: usize = core::mem::size_of::<$typ>() * 8; + const SIGNED: bool = false; + } + + impl UnsignedInteger for $typ {} + }; + (impl SignedInteger for $typ:ty;) => { + unsafe impl Integer for $typ { + const WIDTH: usize = core::mem::size_of::<$typ>() * 8; + const SIGNED: bool = true; + } + + impl SignedInteger for $typ {} + }; + ($(impl $trait:ident for $typ:ty;)+) => { + $(impl_numbers!(impl $trait for $typ;);)+ + }; + +} + +impl_numbers! { + impl UnsignedInteger for u8; + impl UnsignedInteger for u16; + impl UnsignedInteger for u32; + impl UnsignedInteger for u64; + impl SignedInteger for i8; + impl SignedInteger for i16; + impl SignedInteger for i32; + impl SignedInteger for i64; +} diff --git a/crates/spirv-std/src/lib.rs b/crates/spirv-std/src/lib.rs index 2c85dc9af0..14e887b70f 100644 --- a/crates/spirv-std/src/lib.rs +++ b/crates/spirv-std/src/lib.rs @@ -88,33 +88,30 @@ #[macro_use] pub extern crate spirv_std_macros as macros; pub use macros::spirv; -pub use macros::{debug_printf, debug_printfln}; pub mod arch; pub mod byte_addressable_buffer; -pub mod debug_printf; pub mod float; pub mod image; pub mod indirect_command; +pub mod integer; pub mod matrix; pub mod memory; +pub mod number; pub mod ray_tracing; mod runtime_array; mod sampler; -mod scalar; -mod scalar_or_vector; +pub mod scalar; +pub(crate) mod sealed; mod typed_buffer; -mod vector; +pub mod vector; pub use self::sampler::Sampler; pub use crate::macros::Image; pub use byte_addressable_buffer::ByteAddressableBuffer; pub use num_traits; pub use runtime_array::*; -pub use scalar::*; -pub use scalar_or_vector::*; pub use typed_buffer::*; -pub use vector::*; pub use glam; @@ -132,3 +129,19 @@ extern "C" fn rust_eh_personality() {} #[doc(hidden)] /// [spirv_std_types] pub fn workaround_rustdoc_ice_84738() {} + +#[doc(hidden)] +pub fn debug_printf_assert_is_type(ty: T) -> T { + ty +} + +#[doc(hidden)] +pub fn debug_printf_assert_is_vector< + TY: crate::scalar::Scalar, + V: crate::vector::Vector, + const SIZE: usize, +>( + vec: V, +) -> V { + vec +} diff --git a/crates/spirv-std/src/number.rs b/crates/spirv-std/src/number.rs new file mode 100644 index 0000000000..20a195da1e --- /dev/null +++ b/crates/spirv-std/src/number.rs @@ -0,0 +1,15 @@ +//! Traits and helper functions related to numbers. + +/// Abstract trait representing a SPIR-V integer or floating-point type. +pub trait Number: crate::scalar::Scalar {} + +impl Number for u8 {} +impl Number for u16 {} +impl Number for u32 {} +impl Number for u64 {} +impl Number for i8 {} +impl Number for i16 {} +impl Number for i32 {} +impl Number for i64 {} +impl Number for f32 {} +impl Number for f64 {} diff --git a/crates/spirv-std/src/scalar.rs b/crates/spirv-std/src/scalar.rs index b4774ea861..520348be3a 100644 --- a/crates/spirv-std/src/scalar.rs +++ b/crates/spirv-std/src/scalar.rs @@ -1,10 +1,11 @@ //! Traits related to scalars. -use crate::ScalarOrVector; -use crate::sealed::Sealed; +use crate::vector::{VectorOrScalar, create_dim}; use core::num::NonZeroUsize; -/// Abstract trait representing a SPIR-V scalar type, which includes: +/// Abstract trait representing a SPIR-V scalar type. +/// +/// Implemented on types that map to spirv "scalar" types, which includes: /// * Floating-point type: f32, f64 /// * Integer type: u8, u16, u32, u64, i8, i16, i32, i64 /// * Boolean type: bool @@ -12,102 +13,19 @@ use core::num::NonZeroUsize; /// See the SPIRV spec on [Types](https://registry.khronos.org/SPIR-V/specs/unified1/SPIRV.html#_types). /// /// # Safety -/// Implementing this trait on non-scalar types breaks assumptions of other unsafe code, and should not be done. -pub unsafe trait Scalar: ScalarOrVector + crate::sealed::Sealed {} - -/// Abstract trait representing a SPIR-V integer or floating-point type. Unlike [`Scalar`], excludes the boolean type. -/// -/// # Safety -/// Implementing this trait on non-primitive-integer or non-primitive-float types breaks assumptions of other unsafe -/// code, and should not be done. -pub unsafe trait Number: Scalar {} - -/// Abstract trait representing any SPIR-V integer type. -/// -/// # Safety -/// Implementing this trait on non-primitive-integer types breaks assumptions of other unsafe code, -/// and should not be done. -pub unsafe trait Integer: num_traits::PrimInt + Number { - /// Width of the integer, in bits. - const WIDTH: usize; - /// If the integer is signed: true means signed, false means unsigned. - const SIGNED: bool; -} - -/// Abstract trait representing any SPIR-V signed integer type. -/// -/// # Safety -/// Implementing this trait on non-signed-integer types breaks assumptions of other unsafe code, -/// and should not be done. -pub unsafe trait SignedInteger: num_traits::Signed + Integer {} - -/// Abstract trait representing any SPIR-V unsigned integer type. -/// -/// # Safety -/// Implementing this trait on non-unsigned-integer types breaks assumptions of other unsafe code, -/// and should not be done. -pub unsafe trait UnsignedInteger: num_traits::Unsigned + Integer {} - -/// Abstract trait representing a SPIR-V floating point type. -/// -/// # Safety -/// Implementing this trait on non-primitive-float types breaks assumptions of other unsafe code, -/// and should not be done. -pub unsafe trait Float: num_traits::Float + Number { - /// Width of the float, in bits. - const WIDTH: usize; -} +/// Must only be implemented on spirv "scalar" types, as mentioned above. +pub unsafe trait Scalar: VectorOrScalar + crate::sealed::Sealed {} macro_rules! impl_scalar { - (impl Scalar for $ty:ty;) => { - impl Sealed for $ty {} - unsafe impl ScalarOrVector for $ty { - type Scalar = Self; - const N: NonZeroUsize = NonZeroUsize::new(1).unwrap(); - } - unsafe impl Scalar for $ty {} - }; - (impl Number for $ty:ty;) => { - unsafe impl Number for $ty {} - impl_scalar!(impl Scalar for $ty;); - }; - (impl UnsignedInteger for $ty:ty;) => { - unsafe impl Integer for $ty { - const WIDTH: usize = core::mem::size_of::<$ty>() * 8; - const SIGNED: bool = false; - } - unsafe impl UnsignedInteger for $ty {} - impl_scalar!(impl Number for $ty;); - }; - (impl SignedInteger for $ty:ty;) => { - unsafe impl Integer for $ty { - const WIDTH: usize = core::mem::size_of::<$ty>() * 8; - const SIGNED: bool = true; - } - unsafe impl SignedInteger for $ty {} - impl_scalar!(impl Number for $ty;); - }; - (impl Float for $ty:ty;) => { - unsafe impl Float for $ty { - const WIDTH: usize = core::mem::size_of::<$ty>() * 8; - } - impl_scalar!(impl Number for $ty;); - }; - ($(impl $trait:ident for $ty:ty;)+) => { - $(impl_scalar!(impl $trait for $ty;);)+ + ($($ty:ty),+) => { + $( + unsafe impl VectorOrScalar for $ty { + type Scalar = Self; + const DIM: NonZeroUsize = create_dim(1); + } + unsafe impl Scalar for $ty {} + )+ }; } -impl_scalar! { - impl UnsignedInteger for u8; - impl UnsignedInteger for u16; - impl UnsignedInteger for u32; - impl UnsignedInteger for u64; - impl SignedInteger for i8; - impl SignedInteger for i16; - impl SignedInteger for i32; - impl SignedInteger for i64; - impl Float for f32; - impl Float for f64; - impl Scalar for bool; -} +impl_scalar!(bool, f32, f64, u8, u16, u32, u64, i8, i16, i32, i64); diff --git a/crates/spirv-std/src/scalar_or_vector.rs b/crates/spirv-std/src/scalar_or_vector.rs deleted file mode 100644 index 87b0073241..0000000000 --- a/crates/spirv-std/src/scalar_or_vector.rs +++ /dev/null @@ -1,22 +0,0 @@ -use crate::Scalar; -use core::num::NonZeroUsize; - -pub(crate) mod sealed { - /// A marker trait used to prevent other traits from being implemented outside - /// of `spirv-std`. - pub trait Sealed {} -} - -/// Abstract trait representing either a [`Scalar`] or [`Vector`] type. -/// -/// # Safety -/// Your type must also implement [`Scalar`] or [`Vector`], see their safety sections as well. -/// -/// [`Vector`]: crate::Vector -pub unsafe trait ScalarOrVector: Copy + Default + Send + Sync + 'static { - /// Either the scalar component type of the vector or the scalar itself. - type Scalar: Scalar; - - /// The dimension of the vector, or 1 if it is a scalar - const N: NonZeroUsize; -} diff --git a/crates/spirv-std/src/sealed.rs b/crates/spirv-std/src/sealed.rs new file mode 100644 index 0000000000..7c8cdb5789 --- /dev/null +++ b/crates/spirv-std/src/sealed.rs @@ -0,0 +1,30 @@ +/// A marker trait used to prevent other traits from being implemented outside +/// of `spirv-std`. +pub trait Sealed {} + +impl Sealed for bool {} +impl Sealed for f32 {} +impl Sealed for f64 {} +impl Sealed for u8 {} +impl Sealed for u16 {} +impl Sealed for u32 {} +impl Sealed for u64 {} +impl Sealed for i8 {} +impl Sealed for i16 {} +impl Sealed for i32 {} +impl Sealed for i64 {} + +impl Sealed for glam::Vec2 {} +impl Sealed for glam::Vec3 {} +impl Sealed for glam::Vec4 {} +impl Sealed for glam::DVec2 {} +impl Sealed for glam::DVec3 {} +impl Sealed for glam::DVec4 {} +impl Sealed for glam::UVec2 {} +impl Sealed for glam::UVec3 {} +impl Sealed for glam::UVec4 {} +impl Sealed for glam::IVec2 {} +impl Sealed for glam::IVec3 {} +impl Sealed for glam::IVec4 {} + +impl Sealed for glam::Vec3A {} diff --git a/crates/spirv-std/src/vector.rs b/crates/spirv-std/src/vector.rs index 0389424df0..f3ba4a42bb 100644 --- a/crates/spirv-std/src/vector.rs +++ b/crates/spirv-std/src/vector.rs @@ -1,10 +1,29 @@ //! Traits related to vectors. -use crate::sealed::Sealed; -use crate::{Scalar, ScalarOrVector}; +use crate::scalar::Scalar; use core::num::NonZeroUsize; use glam::{Vec3Swizzles, Vec4Swizzles}; +/// Abstract trait representing either a vector or a scalar type. +/// +/// # Safety +/// Your type must also implement [`Vector`] or [`Scalar`], see their safety sections as well. +pub unsafe trait VectorOrScalar: Copy + Default + Send + Sync + 'static { + /// Either the scalar component type of the vector or the scalar itself. + type Scalar: Scalar; + + /// The dimension of the vector, or 1 if it is a scalar + const DIM: NonZeroUsize; +} + +/// replace with `NonZeroUsize::new(n).unwrap()` once `unwrap()` is const stabilized +pub(crate) const fn create_dim(n: usize) -> NonZeroUsize { + match NonZeroUsize::new(n) { + None => panic!("dim must not be 0"), + Some(n) => n, + } +} + /// Abstract trait representing a SPIR-V vector type. /// /// To implement this trait, your struct must be marked with: @@ -43,46 +62,28 @@ use glam::{Vec3Swizzles, Vec4Swizzles}; /// /// /// # Safety -/// * Must only be implemented on types that the spirv codegen emits as valid `OpTypeVector`. This includes all structs -/// marked with `#[rust_gpu::vector::v1]`, like [`glam`]'s non-SIMD "scalar" vector types. -/// * `VectorOrScalar::DIM == N`, since const equality is behind rustc feature `associated_const_equality` -// Note(@firestar99) I would like to have these two generics be associated types instead. Doesn't make much sense for -// a vector type to implement this interface multiple times with different Scalar types or N, after all. -// While it's possible with `T: Scalar`, it's not with `const N: usize`, since some impl blocks in `image::params` need -// to be conditional on a specific N value. And you can only express that with const generics, but not with associated -// constants due to lack of const generics support in rustc. -pub unsafe trait Vector: ScalarOrVector {} +/// Must only be implemented on types that the spirv codegen emits as valid `OpTypeVector`. This includes all structs +/// marked with `#[rust_gpu::vector::v1]`, like [`glam`]'s non-SIMD "scalar" vector types. +pub unsafe trait Vector: VectorOrScalar {} macro_rules! impl_vector { - ($($ty:ty: [$scalar:ty; $n:literal];)+) => { - $( - impl Sealed for $ty {} - unsafe impl ScalarOrVector for $ty { + ($($scalar:ty: $($vec:ty => $dim:literal),+;)+) => { + $($( + unsafe impl VectorOrScalar for $vec { type Scalar = $scalar; - const N: NonZeroUsize = NonZeroUsize::new($n).unwrap(); + const DIM: NonZeroUsize = create_dim($dim); } - unsafe impl Vector<$scalar, $n> for $ty {} - )+ + unsafe impl Vector<$scalar, $dim> for $vec {} + )+)+ }; } impl_vector! { - glam::Vec2: [f32; 2]; - glam::Vec3: [f32; 3]; - glam::Vec3A: [f32; 3]; - glam::Vec4: [f32; 4]; - glam::DVec2: [f64; 2]; - glam::DVec3: [f64; 3]; - glam::DVec4: [f64; 4]; - glam::UVec2: [u32; 2]; - glam::UVec3: [u32; 3]; - glam::UVec4: [u32; 4]; - glam::IVec2: [i32; 2]; - glam::IVec3: [i32; 3]; - glam::IVec4: [i32; 4]; - glam::BVec2: [bool; 2]; - glam::BVec3: [bool; 3]; - glam::BVec4: [bool; 4]; + f32: glam::Vec2 => 2, glam::Vec3 => 3, glam::Vec3A => 3, glam::Vec4 => 4; + f64: glam::DVec2 => 2, glam::DVec3 => 3, glam::DVec4 => 4; + u32: glam::UVec2 => 2, glam::UVec3 => 3, glam::UVec4 => 4; + i32: glam::IVec2 => 2, glam::IVec3 => 3, glam::IVec4 => 4; + bool: glam::BVec2 => 2, glam::BVec3 => 3, glam::BVec4 => 4; } /// Trait that implements slicing of a vector into a scalar or vector of lower dimensions, by diff --git a/examples/runners/ash/build.rs b/examples/runners/ash/build.rs new file mode 100644 index 0000000000..5aa3309e79 --- /dev/null +++ b/examples/runners/ash/build.rs @@ -0,0 +1,8 @@ +use std::env; + +fn main() { + // While OUT_DIR is set for both build.rs and compiling the crate, PROFILE is only set in + // build.rs. So, export it to crate compilation as well. + let profile = env::var("PROFILE").unwrap(); + println!("cargo:rustc-env=PROFILE={profile}"); +} diff --git a/examples/runners/ash/src/main.rs b/examples/runners/ash/src/main.rs index eb04acc277..1551c22901 100644 --- a/examples/runners/ash/src/main.rs +++ b/examples/runners/ash/src/main.rs @@ -124,6 +124,17 @@ pub struct Options { } pub fn main() { + // Hack: spirv_builder builds into a custom directory if running under cargo, to not + // deadlock, and the default target directory if not. However, packages like `proc-macro2` + // have different configurations when being built here vs. when building + // rustc_codegen_spirv normally, so we *want* to build into a separate target directory, to + // not have to rebuild half the crate graph every time we run. So, pretend we're running + // under cargo by setting these environment variables. + unsafe { + std::env::set_var("OUT_DIR", env!("OUT_DIR")); + std::env::set_var("PROFILE", env!("PROFILE")); + } + let options = Options::parse(); let (vert_data, frag_data) = compile_shaders(&options.shader); diff --git a/examples/runners/wgpu/build.rs b/examples/runners/wgpu/build.rs index f01def125e..55f708728d 100644 --- a/examples/runners/wgpu/build.rs +++ b/examples/runners/wgpu/build.rs @@ -3,16 +3,18 @@ use std::error::Error; use std::path::PathBuf; fn main() -> Result<(), Box> { - let target_os = env::var("CARGO_CFG_TARGET_OS")?; - let target_arch = env::var("CARGO_CFG_TARGET_ARCH")?; + let target_os = std::env::var("CARGO_CFG_TARGET_OS")?; + let target_arch = std::env::var("CARGO_CFG_TARGET_ARCH")?; println!("cargo:rerun-if-changed=build.rs"); println!("cargo:rerun-if-env-changed=CARGO_CFG_TARGET_OS"); println!("cargo:rerun-if-env-changed=CARGO_CFG_TARGET_ARCH"); - + // While OUT_DIR is set for both build.rs and compiling the crate, PROFILE is only set in + // build.rs. So, export it to crate compilation as well. + let profile = env::var("PROFILE").unwrap(); + println!("cargo:rustc-env=PROFILE={profile}"); if target_os != "android" && target_arch != "wasm32" { return Ok(()); } - let profile = env::var("PROFILE").unwrap(); let mut dir = PathBuf::from(env::var_os("OUT_DIR").unwrap()); // Strip `$profile/build/*/out`. let ok = dir.ends_with("out") @@ -23,6 +25,10 @@ fn main() -> Result<(), Box> { && dir.ends_with(profile) && dir.pop(); assert!(ok); + // NOTE(eddyb) this needs to be distinct from the `--target-dir` value that + // `spirv-builder` generates in a similar way from `$OUT_DIR` and `$PROFILE`, + // otherwise repeated `cargo build`s will cause build script reruns and the + // rebuilding of `rustc_codegen_spirv` (likely due to common proc macro deps). let dir = dir.join("example-runner-wgpu-builder"); let status = std::process::Command::new("cargo") .args([ diff --git a/examples/runners/wgpu/builder/src/main.rs b/examples/runners/wgpu/builder/src/main.rs index ba94e42f64..7fb9735381 100644 --- a/examples/runners/wgpu/builder/src/main.rs +++ b/examples/runners/wgpu/builder/src/main.rs @@ -9,9 +9,6 @@ fn build_shader(path_to_crate: &str, codegen_names: bool) -> Result<(), Box $DIR/debug_printf_type_checking.rs:11:23 | -LL | debug_printf!("%1"); +11 | debug_printf!("%1"); | ^^^^ error: Unterminated format specifier: missing type after decimal point --> $DIR/debug_printf_type_checking.rs:12:23 | -LL | debug_printf!("%1."); +12 | debug_printf!("%1."); | ^^^^^ error: Unrecognised format specifier: '.' --> $DIR/debug_printf_type_checking.rs:13:23 | -LL | debug_printf!("%."); +13 | debug_printf!("%."); | ^^^^ error: Unrecognised format specifier: '.' --> $DIR/debug_printf_type_checking.rs:14:23 | -LL | debug_printf!("%.1"); +14 | debug_printf!("%.1"); | ^^^^^ error: Unterminated format specifier: missing type after fraction precision --> $DIR/debug_printf_type_checking.rs:15:23 | -LL | debug_printf!("%1.1"); +15 | debug_printf!("%1.1"); | ^^^^^^ error: Missing vector dimensions specifier --> $DIR/debug_printf_type_checking.rs:16:23 | -LL | debug_printf!("%1.1v"); +16 | debug_printf!("%1.1v"); | ^^^^^^^ error: Invalid width for vector: 5 --> $DIR/debug_printf_type_checking.rs:17:23 | -LL | debug_printf!("%1.1v5"); +17 | debug_printf!("%1.1v5"); | ^^^^^^^^ error: Missing vector type specifier --> $DIR/debug_printf_type_checking.rs:18:23 | -LL | debug_printf!("%1.1v2"); +18 | debug_printf!("%1.1v2"); | ^^^^^^^^ error: Unrecognised vector type specifier: 'r' --> $DIR/debug_printf_type_checking.rs:19:23 | -LL | debug_printf!("%1.1v2r"); +19 | debug_printf!("%1.1v2r"); | ^^^^^^^^^ error: Unrecognised format specifier: 'r' --> $DIR/debug_printf_type_checking.rs:20:23 | -LL | debug_printf!("%r", 11_i32); +20 | debug_printf!("%r", 11_i32); | ^^^^ error[E0308]: mismatched types - --> $DIR/debug_printf_type_checking.rs:21:29 - | -LL | debug_printf!("%f", 11_u32); - | --------------------^^^^^^- - | | | - | | expected `f32`, found `u32` - | arguments to this function are incorrect - | + --> $DIR/debug_printf_type_checking.rs:21:29 + | + 21 | debug_printf!("%f", 11_u32); + | --------------------^^^^^^- + | | | + | | expected `f32`, found `u32` + | arguments to this function are incorrect + | help: the return type of this call is `u32` due to the type of the argument passed - --> $DIR/debug_printf_type_checking.rs:21:9 - | -LL | debug_printf!("%f", 11_u32); - | ^^^^^^^^^^^^^^^^^^^^------^ - | | - | this argument influences the return type of `assert_is_type` + --> $DIR/debug_printf_type_checking.rs:21:9 + | + 21 | debug_printf!("%f", 11_u32); + | ^^^^^^^^^^^^^^^^^^^^------^ + | | + | this argument influences the return type of `debug_printf_assert_is_type` note: function defined here - --> $SPIRV_STD_SRC/debug_printf.rs:6:8 - | -LL | pub fn assert_is_type(ty: T) -> T { - | ^^^^^^^^^^^^^^ - = note: this error originates in the macro `debug_printf` (in Nightly builds, run with -Z macro-backtrace for more info) + --> $SPIRV_STD_SRC/lib.rs:134:8 + | +134 | pub fn debug_printf_assert_is_type(ty: T) -> T { + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ + = note: this error originates in the macro `debug_printf` (in Nightly builds, run with -Z macro-backtrace for more info) help: change the type of the numeric literal from `u32` to `f32` - | -LL - debug_printf!("%f", 11_u32); -LL + debug_printf!("%f", 11_f32); - | + | + 21 - debug_printf!("%f", 11_u32); + 21 + debug_printf!("%f", 11_f32); + | error[E0308]: mismatched types - --> $DIR/debug_printf_type_checking.rs:22:29 - | -LL | debug_printf!("%u", 11.0_f32); - | --------------------^^^^^^^^- - | | | - | | expected `u32`, found `f32` - | arguments to this function are incorrect - | + --> $DIR/debug_printf_type_checking.rs:22:29 + | + 22 | debug_printf!("%u", 11.0_f32); + | --------------------^^^^^^^^- + | | | + | | expected `u32`, found `f32` + | arguments to this function are incorrect + | help: the return type of this call is `f32` due to the type of the argument passed - --> $DIR/debug_printf_type_checking.rs:22:9 - | -LL | debug_printf!("%u", 11.0_f32); - | ^^^^^^^^^^^^^^^^^^^^--------^ - | | - | this argument influences the return type of `assert_is_type` + --> $DIR/debug_printf_type_checking.rs:22:9 + | + 22 | debug_printf!("%u", 11.0_f32); + | ^^^^^^^^^^^^^^^^^^^^--------^ + | | + | this argument influences the return type of `debug_printf_assert_is_type` note: function defined here - --> $SPIRV_STD_SRC/debug_printf.rs:6:8 - | -LL | pub fn assert_is_type(ty: T) -> T { - | ^^^^^^^^^^^^^^ - = note: this error originates in the macro `debug_printf` (in Nightly builds, run with -Z macro-backtrace for more info) + --> $SPIRV_STD_SRC/lib.rs:134:8 + | +134 | pub fn debug_printf_assert_is_type(ty: T) -> T { + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ + = note: this error originates in the macro `debug_printf` (in Nightly builds, run with -Z macro-backtrace for more info) help: change the type of the numeric literal from `f32` to `u32` - | -LL - debug_printf!("%u", 11.0_f32); -LL + debug_printf!("%u", 11u32); - | + | + 22 - debug_printf!("%u", 11.0_f32); + 22 + debug_printf!("%u", 11u32); + | error[E0277]: the trait bound `{float}: Vector` is not satisfied - --> $DIR/debug_printf_type_checking.rs:23:9 - | -LL | debug_printf!("%v2f", 11.0); - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `Vector` is not implemented for `{float}` - | - = help: the following other types implement trait `Vector`: - `BVec2` implements `Vector` - `BVec3` implements `Vector` - `BVec4` implements `Vector` - `DVec2` implements `Vector` - `DVec3` implements `Vector` - `DVec4` implements `Vector` - `IVec2` implements `Vector` - `IVec3` implements `Vector` - and 8 others -note: required by a bound in `assert_is_vector` - --> $SPIRV_STD_SRC/debug_printf.rs:11:40 - | -LL | pub fn assert_is_vector, const SIZE: usize>(vec: V) -> V { - | ^^^^^^^^^^^^^^^^ required by this bound in `assert_is_vector` - = note: this error originates in the macro `debug_printf` (in Nightly builds, run with -Z macro-backtrace for more info) + --> $DIR/debug_printf_type_checking.rs:23:9 + | + 23 | debug_printf!("%v2f", 11.0); + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `Vector` is not implemented for `{float}` + | + = help: the following other types implement trait `Vector`: + `BVec2` implements `Vector` + `BVec3` implements `Vector` + `BVec4` implements `Vector` + `DVec2` implements `Vector` + `DVec3` implements `Vector` + `DVec4` implements `Vector` + `IVec2` implements `Vector` + `IVec3` implements `Vector` + and 8 others +note: required by a bound in `debug_printf_assert_is_vector` + --> $SPIRV_STD_SRC/lib.rs:141:8 + | +139 | pub fn debug_printf_assert_is_vector< + | ----------------------------- required by a bound in this function +140 | TY: crate::scalar::Scalar, +141 | V: crate::vector::Vector, + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `debug_printf_assert_is_vector` + = note: this error originates in the macro `debug_printf` (in Nightly builds, run with -Z macro-backtrace for more info) error[E0308]: mismatched types - --> $DIR/debug_printf_type_checking.rs:24:29 - | -LL | debug_printf!("%f", Vec2::splat(33.3)); - | --------------------^^^^^^^^^^^^^^^^^- - | | | - | | expected `f32`, found `Vec2` - | arguments to this function are incorrect - | + --> $DIR/debug_printf_type_checking.rs:24:29 + | + 24 | debug_printf!("%f", Vec2::splat(33.3)); + | --------------------^^^^^^^^^^^^^^^^^- + | | | + | | expected `f32`, found `Vec2` + | arguments to this function are incorrect + | help: the return type of this call is `Vec2` due to the type of the argument passed - --> $DIR/debug_printf_type_checking.rs:24:9 - | -LL | debug_printf!("%f", Vec2::splat(33.3)); - | ^^^^^^^^^^^^^^^^^^^^-----------------^ - | | - | this argument influences the return type of `assert_is_type` + --> $DIR/debug_printf_type_checking.rs:24:9 + | + 24 | debug_printf!("%f", Vec2::splat(33.3)); + | ^^^^^^^^^^^^^^^^^^^^-----------------^ + | | + | this argument influences the return type of `debug_printf_assert_is_type` note: function defined here - --> $SPIRV_STD_SRC/debug_printf.rs:6:8 - | -LL | pub fn assert_is_type(ty: T) -> T { - | ^^^^^^^^^^^^^^ - = note: this error originates in the macro `debug_printf` (in Nightly builds, run with -Z macro-backtrace for more info) + --> $SPIRV_STD_SRC/lib.rs:134:8 + | +134 | pub fn debug_printf_assert_is_type(ty: T) -> T { + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ + = note: this error originates in the macro `debug_printf` (in Nightly builds, run with -Z macro-backtrace for more info) error: aborting due to 14 previous errors diff --git a/tests/compiletests/ui/arch/subgroup/subgroup_ballot.rs b/tests/compiletests/ui/arch/subgroup/subgroup_ballot.rs index ce2acb18bc..aaa0142037 100644 --- a/tests/compiletests/ui/arch/subgroup/subgroup_ballot.rs +++ b/tests/compiletests/ui/arch/subgroup/subgroup_ballot.rs @@ -1,7 +1,6 @@ // build-pass // compile-flags: -C target-feature=+GroupNonUniform,+GroupNonUniformBallot,+ext:SPV_KHR_vulkan_memory_model // compile-flags: -C llvm-args=--disassemble-fn=subgroup_ballot::subgroup_ballot -// normalize-stderr-test "OpLine .*\n" -> "" use spirv_std::spirv; diff --git a/tests/compiletests/ui/arch/subgroup/subgroup_ballot.stderr b/tests/compiletests/ui/arch/subgroup/subgroup_ballot.stderr index f268c5497a..a0994f5353 100644 --- a/tests/compiletests/ui/arch/subgroup/subgroup_ballot.stderr +++ b/tests/compiletests/ui/arch/subgroup/subgroup_ballot.stderr @@ -1,7 +1,9 @@ %1 = OpFunction %2 None %3 %4 = OpFunctionParameter %2 %5 = OpLabel +OpLine %6 364 13 %7 = OpGroupNonUniformBallot %8 %9 %4 +OpLine %6 403 13 %10 = OpGroupNonUniformInverseBallot %2 %9 %7 OpNoLine OpReturnValue %10 diff --git a/tests/compiletests/ui/arch/subgroup/subgroup_ballot_bit_count.rs b/tests/compiletests/ui/arch/subgroup/subgroup_ballot_bit_count.rs index 8d624af138..ff4b492932 100644 --- a/tests/compiletests/ui/arch/subgroup/subgroup_ballot_bit_count.rs +++ b/tests/compiletests/ui/arch/subgroup/subgroup_ballot_bit_count.rs @@ -1,7 +1,6 @@ // build-pass // compile-flags: -C target-feature=+GroupNonUniform,+GroupNonUniformBallot,+ext:SPV_KHR_vulkan_memory_model // compile-flags: -C llvm-args=--disassemble-fn=subgroup_ballot_bit_count::subgroup_ballot_bit_count -// normalize-stderr-test "OpLine .*\n" -> "" use spirv_std::arch::{GroupOperation, SubgroupMask}; use spirv_std::spirv; diff --git a/tests/compiletests/ui/arch/subgroup/subgroup_ballot_bit_count.stderr b/tests/compiletests/ui/arch/subgroup/subgroup_ballot_bit_count.stderr index d4bbbfe372..52b6bcf944 100644 --- a/tests/compiletests/ui/arch/subgroup/subgroup_ballot_bit_count.stderr +++ b/tests/compiletests/ui/arch/subgroup/subgroup_ballot_bit_count.stderr @@ -1,6 +1,7 @@ %1 = OpFunction %2 None %3 %4 = OpFunctionParameter %5 %6 = OpLabel +OpLine %7 498 0 %8 = OpGroupNonUniformBallotBitCount %2 %9 Reduce %4 OpNoLine OpReturnValue %8 diff --git a/tests/compiletests/ui/arch/subgroup/subgroup_broadcast.rs b/tests/compiletests/ui/arch/subgroup/subgroup_broadcast.rs deleted file mode 100644 index 4d65f6b294..0000000000 --- a/tests/compiletests/ui/arch/subgroup/subgroup_broadcast.rs +++ /dev/null @@ -1,25 +0,0 @@ -// build-pass -// compile-flags: -C target-feature=+GroupNonUniform,+GroupNonUniformBallot,+ext:SPV_KHR_vulkan_memory_model -// compile-flags: -C llvm-args=--disassemble-fn=subgroup_broadcast::disassembly -// normalize-stderr-test "OpLine .*\n" -> "" -// ignore-vulkan1.0 -// ignore-vulkan1.1 -// ignore-spv1.0 -// ignore-spv1.1 -// ignore-spv1.2 -// ignore-spv1.3 -// ignore-spv1.4 - -use spirv_std::arch::{GroupOperation, SubgroupMask}; -use spirv_std::spirv; - -unsafe fn disassembly(value: i32, id: u32) -> i32 { - spirv_std::arch::subgroup_broadcast(value, id) -} - -#[spirv(compute(threads(32, 1, 1)))] -pub fn main() { - unsafe { - disassembly(42, 5); - } -} diff --git a/tests/compiletests/ui/arch/subgroup/subgroup_broadcast.stderr b/tests/compiletests/ui/arch/subgroup/subgroup_broadcast.stderr deleted file mode 100644 index 57d7d6e003..0000000000 --- a/tests/compiletests/ui/arch/subgroup/subgroup_broadcast.stderr +++ /dev/null @@ -1,8 +0,0 @@ -%1 = OpFunction %2 None %3 -%4 = OpFunctionParameter %2 -%5 = OpFunctionParameter %6 -%7 = OpLabel -%9 = OpGroupNonUniformBroadcast %2 %10 %4 %5 -OpNoLine -OpReturnValue %9 -OpFunctionEnd diff --git a/tests/compiletests/ui/arch/subgroup/subgroup_broadcast_const.rs b/tests/compiletests/ui/arch/subgroup/subgroup_broadcast_const.rs deleted file mode 100644 index eb9a66dd3d..0000000000 --- a/tests/compiletests/ui/arch/subgroup/subgroup_broadcast_const.rs +++ /dev/null @@ -1,18 +0,0 @@ -// build-pass -// compile-flags: -C target-feature=+GroupNonUniform,+GroupNonUniformBallot,+ext:SPV_KHR_vulkan_memory_model -// compile-flags: -C llvm-args=--disassemble-fn=subgroup_broadcast_const::disassembly -// normalize-stderr-test "OpLine .*\n" -> "" - -use spirv_std::arch::{GroupOperation, SubgroupMask}; -use spirv_std::spirv; - -unsafe fn disassembly(value: i32) -> i32 { - spirv_std::arch::subgroup_broadcast_const::<_, 5>(value) -} - -#[spirv(compute(threads(32, 1, 1)))] -pub fn main() { - unsafe { - disassembly(-42); - } -} diff --git a/tests/compiletests/ui/arch/subgroup/subgroup_broadcast_const.stderr b/tests/compiletests/ui/arch/subgroup/subgroup_broadcast_const.stderr deleted file mode 100644 index db3584310b..0000000000 --- a/tests/compiletests/ui/arch/subgroup/subgroup_broadcast_const.stderr +++ /dev/null @@ -1,7 +0,0 @@ -%1 = OpFunction %2 None %3 -%4 = OpFunctionParameter %2 -%5 = OpLabel -%7 = OpGroupNonUniformBroadcast %2 %8 %4 %9 -OpNoLine -OpReturnValue %7 -OpFunctionEnd diff --git a/tests/compiletests/ui/arch/subgroup/subgroup_broadcast_first.rs b/tests/compiletests/ui/arch/subgroup/subgroup_broadcast_first.rs index 53efc5d0be..c2544101c2 100644 --- a/tests/compiletests/ui/arch/subgroup/subgroup_broadcast_first.rs +++ b/tests/compiletests/ui/arch/subgroup/subgroup_broadcast_first.rs @@ -1,7 +1,6 @@ // build-pass // compile-flags: -C target-feature=+GroupNonUniform,+GroupNonUniformBallot,+ext:SPV_KHR_vulkan_memory_model // compile-flags: -C llvm-args=--disassemble-fn=subgroup_broadcast_first::subgroup_broadcast_first -// normalize-stderr-test "OpLine .*\n" -> "" use glam::Vec3; use spirv_std::spirv; diff --git a/tests/compiletests/ui/arch/subgroup/subgroup_broadcast_first.stderr b/tests/compiletests/ui/arch/subgroup/subgroup_broadcast_first.stderr index e2d1d7b0da..44fa624f0e 100644 --- a/tests/compiletests/ui/arch/subgroup/subgroup_broadcast_first.stderr +++ b/tests/compiletests/ui/arch/subgroup/subgroup_broadcast_first.stderr @@ -1,6 +1,7 @@ %1 = OpFunction %2 None %3 %4 = OpFunctionParameter %2 %5 = OpLabel +OpLine %6 331 13 %7 = OpGroupNonUniformBroadcastFirst %2 %8 %4 OpNoLine OpReturnValue %7 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 c292b79934..fe2f180d78 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 @@ -1,35 +1,35 @@ error[E0080]: evaluation panicked: `ClusterSize` must be at least 1 - --> $SPIRV_STD_SRC/arch/subgroup.rs:868:1 - | -LL | / macro_subgroup_op_clustered!(impl Integer, "OpGroupNonUniformIAdd", subgroup_clustered_i_add; r" -LL | | An integer add group operation of all `value` operands contributed by active invocations in the group. -LL | | -LL | | Result Type must be a scalar or vector of integer type. -... | -LL | | * `ClusterSize` must not be greater than the size of the group -LL | | "); - | |__^ evaluation of `spirv_std::arch::subgroup_clustered_i_add::<0, u32, u32>::{constant#0}` failed here - | - = note: this error originates in the macro `$crate::panic::panic_2021` which comes from the expansion of the macro `macro_subgroup_op_clustered` (in Nightly builds, run with -Z macro-backtrace for more info) + --> $SPIRV_STD_SRC/arch/subgroup.rs:826:1 + | +826 | / macro_subgroup_op_clustered!(impl Integer, "OpGroupNonUniformIAdd", subgroup_clustered_i_add; r" +827 | | An integer add group operation of all `value` operands contributed by active invocations in the group. +828 | | +829 | | Result Type must be a scalar or vector of integer type. +... | +842 | | * `ClusterSize` must not be greater than the size of the group +843 | | "); + | |__^ evaluation of `spirv_std::arch::subgroup_clustered_i_add::<0, u32, u32>::{constant#0}` failed here + | + = note: this error originates in the macro `$crate::panic::panic_2021` which comes from the expansion of the macro `macro_subgroup_op_clustered` (in Nightly builds, run with -Z macro-backtrace for more info) note: erroneous constant encountered - --> $SPIRV_STD_SRC/arch/subgroup.rs:868:1 - | -LL | / macro_subgroup_op_clustered!(impl Integer, "OpGroupNonUniformIAdd", subgroup_clustered_i_add; r" -LL | | An integer add group operation of all `value` operands contributed by active invocations in the group. -LL | | -LL | | Result Type must be a scalar or vector of integer type. -... | -LL | | * `ClusterSize` must not be greater than the size of the group -LL | | "); - | |__^ - | - = note: this note originates in the macro `macro_subgroup_op_clustered` (in Nightly builds, run with -Z macro-backtrace for more info) + --> $SPIRV_STD_SRC/arch/subgroup.rs:826:1 + | +826 | / macro_subgroup_op_clustered!(impl Integer, "OpGroupNonUniformIAdd", subgroup_clustered_i_add; r" +827 | | An integer add group operation of all `value` operands contributed by active invocations in the group. +828 | | +829 | | Result Type must be a scalar or vector of integer type. +... | +842 | | * `ClusterSize` must not be greater than the size of the group +843 | | "); + | |__^ + | + = 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>` --> $DIR/subgroup_cluster_size_0_fail.rs:10:5 | -LL | spirv_std::arch::subgroup_clustered_i_add::<0, _>(value) +10 | spirv_std::arch::subgroup_clustered_i_add::<0, _>(value) | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ error: aborting due to 1 previous error 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 61d066c3fc..40c37e2740 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 @@ -1,35 +1,35 @@ error[E0080]: evaluation panicked: `ClusterSize` must be a power of 2 - --> $SPIRV_STD_SRC/arch/subgroup.rs:868:1 - | -LL | / macro_subgroup_op_clustered!(impl Integer, "OpGroupNonUniformIAdd", subgroup_clustered_i_add; r" -LL | | An integer add group operation of all `value` operands contributed by active invocations in the group. -LL | | -LL | | Result Type must be a scalar or vector of integer type. -... | -LL | | * `ClusterSize` must not be greater than the size of the group -LL | | "); - | |__^ evaluation of `spirv_std::arch::subgroup_clustered_i_add::<5, u32, u32>::{constant#0}` failed here - | - = note: this error originates in the macro `$crate::panic::panic_2021` which comes from the expansion of the macro `macro_subgroup_op_clustered` (in Nightly builds, run with -Z macro-backtrace for more info) + --> $SPIRV_STD_SRC/arch/subgroup.rs:826:1 + | +826 | / macro_subgroup_op_clustered!(impl Integer, "OpGroupNonUniformIAdd", subgroup_clustered_i_add; r" +827 | | An integer add group operation of all `value` operands contributed by active invocations in the group. +828 | | +829 | | Result Type must be a scalar or vector of integer type. +... | +842 | | * `ClusterSize` must not be greater than the size of the group +843 | | "); + | |__^ evaluation of `spirv_std::arch::subgroup_clustered_i_add::<5, u32, u32>::{constant#0}` failed here + | + = note: this error originates in the macro `$crate::panic::panic_2021` which comes from the expansion of the macro `macro_subgroup_op_clustered` (in Nightly builds, run with -Z macro-backtrace for more info) note: erroneous constant encountered - --> $SPIRV_STD_SRC/arch/subgroup.rs:868:1 - | -LL | / macro_subgroup_op_clustered!(impl Integer, "OpGroupNonUniformIAdd", subgroup_clustered_i_add; r" -LL | | An integer add group operation of all `value` operands contributed by active invocations in the group. -LL | | -LL | | Result Type must be a scalar or vector of integer type. -... | -LL | | * `ClusterSize` must not be greater than the size of the group -LL | | "); - | |__^ - | - = note: this note originates in the macro `macro_subgroup_op_clustered` (in Nightly builds, run with -Z macro-backtrace for more info) + --> $SPIRV_STD_SRC/arch/subgroup.rs:826:1 + | +826 | / macro_subgroup_op_clustered!(impl Integer, "OpGroupNonUniformIAdd", subgroup_clustered_i_add; r" +827 | | An integer add group operation of all `value` operands contributed by active invocations in the group. +828 | | +829 | | Result Type must be a scalar or vector of integer type. +... | +842 | | * `ClusterSize` must not be greater than the size of the group +843 | | "); + | |__^ + | + = 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>` --> $DIR/subgroup_cluster_size_non_power_of_two_fail.rs:10:5 | -LL | spirv_std::arch::subgroup_clustered_i_add::<5, _>(value) +10 | spirv_std::arch::subgroup_clustered_i_add::<5, _>(value) | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ error: aborting due to 1 previous error diff --git a/tests/compiletests/ui/arch/subgroup/subgroup_elect.rs b/tests/compiletests/ui/arch/subgroup/subgroup_elect.rs index 6c3337d4f7..4aee376c6b 100644 --- a/tests/compiletests/ui/arch/subgroup/subgroup_elect.rs +++ b/tests/compiletests/ui/arch/subgroup/subgroup_elect.rs @@ -1,7 +1,6 @@ // build-pass // compile-flags: -C target-feature=+GroupNonUniform,+ext:SPV_KHR_vulkan_memory_model // compile-flags: -C llvm-args=--disassemble-fn=subgroup_elect::subgroup_elect -// normalize-stderr-test "OpLine .*\n" -> "" use spirv_std::spirv; diff --git a/tests/compiletests/ui/arch/subgroup/subgroup_elect.stderr b/tests/compiletests/ui/arch/subgroup/subgroup_elect.stderr index 4c94384ff2..26a079b145 100644 --- a/tests/compiletests/ui/arch/subgroup/subgroup_elect.stderr +++ b/tests/compiletests/ui/arch/subgroup/subgroup_elect.stderr @@ -1,5 +1,6 @@ %1 = OpFunction %2 None %3 %4 = OpLabel +OpLine %5 161 13 %6 = OpGroupNonUniformElect %2 %7 OpNoLine OpReturnValue %6 diff --git a/tests/compiletests/ui/arch/subgroup/subgroup_i_add_clustered.rs b/tests/compiletests/ui/arch/subgroup/subgroup_i_add_clustered.rs index 028a1a78b4..880325aa61 100644 --- a/tests/compiletests/ui/arch/subgroup/subgroup_i_add_clustered.rs +++ b/tests/compiletests/ui/arch/subgroup/subgroup_i_add_clustered.rs @@ -1,7 +1,6 @@ // build-pass // compile-flags: -C target-feature=+GroupNonUniform,+GroupNonUniformArithmetic,+GroupNonUniformClustered,+ext:SPV_KHR_vulkan_memory_model // compile-flags: -C llvm-args=--disassemble-fn=subgroup_i_add_clustered::subgroup_i_add_clustered -// normalize-stderr-test "OpLine .*\n" -> "" use glam::UVec3; use spirv_std::arch::{GroupOperation, SubgroupMask}; diff --git a/tests/compiletests/ui/arch/subgroup/subgroup_i_add_clustered.stderr b/tests/compiletests/ui/arch/subgroup/subgroup_i_add_clustered.stderr index 1ba9f80c10..4c022abaf0 100644 --- a/tests/compiletests/ui/arch/subgroup/subgroup_i_add_clustered.stderr +++ b/tests/compiletests/ui/arch/subgroup/subgroup_i_add_clustered.stderr @@ -1,6 +1,7 @@ %1 = OpFunction %2 None %3 %4 = OpFunctionParameter %2 %5 = OpLabel +OpLine %6 826 0 %7 = OpGroupNonUniformIAdd %2 %8 ClusteredReduce %4 %9 OpNoLine OpReturnValue %7 diff --git a/tests/compiletests/ui/arch/subgroup/subgroup_i_add_exclusive_scan.rs b/tests/compiletests/ui/arch/subgroup/subgroup_i_add_exclusive_scan.rs index fd97235a71..feab4bd986 100644 --- a/tests/compiletests/ui/arch/subgroup/subgroup_i_add_exclusive_scan.rs +++ b/tests/compiletests/ui/arch/subgroup/subgroup_i_add_exclusive_scan.rs @@ -1,7 +1,6 @@ // build-pass // compile-flags: -C target-feature=+GroupNonUniform,+GroupNonUniformArithmetic,+ext:SPV_KHR_vulkan_memory_model // compile-flags: -C llvm-args=--disassemble-fn=subgroup_i_add_exclusive_scan::subgroup_i_add_exclusive_scan -// normalize-stderr-test "OpLine .*\n" -> "" use glam::UVec3; use spirv_std::arch::{GroupOperation, SubgroupMask}; diff --git a/tests/compiletests/ui/arch/subgroup/subgroup_i_add_exclusive_scan.stderr b/tests/compiletests/ui/arch/subgroup/subgroup_i_add_exclusive_scan.stderr index a1abe00020..a5ec1af956 100644 --- a/tests/compiletests/ui/arch/subgroup/subgroup_i_add_exclusive_scan.stderr +++ b/tests/compiletests/ui/arch/subgroup/subgroup_i_add_exclusive_scan.stderr @@ -1,6 +1,7 @@ %1 = OpFunction %2 None %3 %4 = OpFunctionParameter %2 %5 = OpLabel +OpLine %6 813 0 %7 = OpGroupNonUniformIAdd %2 %8 ExclusiveScan %4 OpNoLine OpReturnValue %7 diff --git a/tests/compiletests/ui/arch/subgroup/subgroup_i_add_inclusive_scan.rs b/tests/compiletests/ui/arch/subgroup/subgroup_i_add_inclusive_scan.rs index 786bdd71e4..e880491793 100644 --- a/tests/compiletests/ui/arch/subgroup/subgroup_i_add_inclusive_scan.rs +++ b/tests/compiletests/ui/arch/subgroup/subgroup_i_add_inclusive_scan.rs @@ -1,7 +1,6 @@ // build-pass // compile-flags: -C target-feature=+GroupNonUniform,+GroupNonUniformArithmetic,+ext:SPV_KHR_vulkan_memory_model // compile-flags: -C llvm-args=--disassemble-fn=subgroup_i_add_inclusive_scan::subgroup_i_add_inclusive_scan -// normalize-stderr-test "OpLine .*\n" -> "" use glam::UVec3; use spirv_std::arch::{GroupOperation, SubgroupMask}; diff --git a/tests/compiletests/ui/arch/subgroup/subgroup_i_add_inclusive_scan.stderr b/tests/compiletests/ui/arch/subgroup/subgroup_i_add_inclusive_scan.stderr index 5db68bc975..b6fcceb39f 100644 --- a/tests/compiletests/ui/arch/subgroup/subgroup_i_add_inclusive_scan.stderr +++ b/tests/compiletests/ui/arch/subgroup/subgroup_i_add_inclusive_scan.stderr @@ -1,6 +1,7 @@ %1 = OpFunction %2 None %3 %4 = OpFunctionParameter %2 %5 = OpLabel +OpLine %6 813 0 %7 = OpGroupNonUniformIAdd %2 %8 InclusiveScan %4 OpNoLine OpReturnValue %7 diff --git a/tests/compiletests/ui/arch/subgroup/subgroup_i_add_reduce.rs b/tests/compiletests/ui/arch/subgroup/subgroup_i_add_reduce.rs index 086ddd7f24..7739e0f4bf 100644 --- a/tests/compiletests/ui/arch/subgroup/subgroup_i_add_reduce.rs +++ b/tests/compiletests/ui/arch/subgroup/subgroup_i_add_reduce.rs @@ -1,7 +1,6 @@ // build-pass // compile-flags: -C target-feature=+GroupNonUniform,+GroupNonUniformArithmetic,+ext:SPV_KHR_vulkan_memory_model // compile-flags: -C llvm-args=--disassemble-fn=subgroup_i_add_reduce::subgroup_i_add_reduce -// normalize-stderr-test "OpLine .*\n" -> "" use glam::UVec3; use spirv_std::arch::{GroupOperation, SubgroupMask}; diff --git a/tests/compiletests/ui/arch/subgroup/subgroup_i_add_reduce.stderr b/tests/compiletests/ui/arch/subgroup/subgroup_i_add_reduce.stderr index c82f53e16d..73fdd65b86 100644 --- a/tests/compiletests/ui/arch/subgroup/subgroup_i_add_reduce.stderr +++ b/tests/compiletests/ui/arch/subgroup/subgroup_i_add_reduce.stderr @@ -1,6 +1,7 @@ %1 = OpFunction %2 None %3 %4 = OpFunctionParameter %2 %5 = OpLabel +OpLine %6 813 0 %7 = OpGroupNonUniformIAdd %2 %8 Reduce %4 OpNoLine OpReturnValue %7 diff --git a/tests/compiletests/ui/dis/ptr_copy.normal.stderr b/tests/compiletests/ui/dis/ptr_copy.normal.stderr index dd442fbb40..b60fa81606 100644 --- a/tests/compiletests/ui/dis/ptr_copy.normal.stderr +++ b/tests/compiletests/ui/dis/ptr_copy.normal.stderr @@ -1,68 +1,68 @@ error: cannot memcpy dynamically sized data - --> $CORE_SRC/ptr/mod.rs:633:9 - | -LL | crate::intrinsics::copy(src, dst, count) - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - | + --> $CORE_SRC/ptr/mod.rs:638:9 + | +638 | crate::intrinsics::copy(src, dst, count) + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | note: used from within `core::ptr::copy::` - --> $CORE_SRC/ptr/mod.rs:618:21 - | -LL | pub const unsafe fn copy(src: *const T, dst: *mut T, count: usize) { - | ^^^^ + --> $CORE_SRC/ptr/mod.rs:623:21 + | +623 | 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 - | -LL | unsafe { core::ptr::copy(src, dst, 1) } - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + --> $DIR/ptr_copy.rs:28:18 + | + 28 | unsafe { core::ptr::copy(src, dst, 1) } + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ note: called by `ptr_copy::main` - --> $DIR/ptr_copy.rs:33:5 - | -LL | copy_via_raw_ptr(&i, o); - | ^^^^^^^^^^^^^^^^^^^^^^^ + --> $DIR/ptr_copy.rs:33:5 + | + 33 | copy_via_raw_ptr(&i, o); + | ^^^^^^^^^^^^^^^^^^^^^^^ note: called by `main` - --> $DIR/ptr_copy.rs:32:8 - | -LL | pub fn main(i: f32, o: &mut f32) { - | ^^^^ + --> $DIR/ptr_copy.rs:32:8 + | + 32 | pub fn main(i: f32, o: &mut f32) { + | ^^^^ error: cannot cast between pointer types from `*f32` to `*struct () { }` - --> $CORE_SRC/ptr/mod.rs:621:9 - | -LL | / ub_checks::assert_unsafe_precondition!( -LL | | check_language_ub, -LL | | "ptr::copy requires that both pointer arguments are aligned and non-null", -... | -LL | | && ub_checks::maybe_is_aligned_and_not_null(dst, align, zero_size) -LL | | ); - | |_________^ - | + --> $CORE_SRC/ptr/mod.rs:626:9 + | +626 | / ub_checks::assert_unsafe_precondition!( +627 | | check_language_ub, +628 | | "ptr::copy requires that both pointer arguments are aligned and non-null", +... | +636 | | && ub_checks::maybe_is_aligned_and_not_null(dst, align, zero_size) +637 | | ); + | |_________^ + | note: used from within `core::ptr::copy::` - --> $CORE_SRC/ptr/mod.rs:621:9 - | -LL | / ub_checks::assert_unsafe_precondition!( -LL | | check_language_ub, -LL | | "ptr::copy requires that both pointer arguments are aligned and non-null", -... | -LL | | && ub_checks::maybe_is_aligned_and_not_null(dst, align, zero_size) -LL | | ); - | |_________^ + --> $CORE_SRC/ptr/mod.rs:626:9 + | +626 | / ub_checks::assert_unsafe_precondition!( +627 | | check_language_ub, +628 | | "ptr::copy requires that both pointer arguments are aligned and non-null", +... | +636 | | && ub_checks::maybe_is_aligned_and_not_null(dst, align, zero_size) +637 | | ); + | |_________^ note: called by `ptr_copy::copy_via_raw_ptr` - --> $DIR/ptr_copy.rs:28:18 - | -LL | unsafe { core::ptr::copy(src, dst, 1) } - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + --> $DIR/ptr_copy.rs:28:18 + | + 28 | unsafe { core::ptr::copy(src, dst, 1) } + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ note: called by `ptr_copy::main` - --> $DIR/ptr_copy.rs:33:5 - | -LL | copy_via_raw_ptr(&i, o); - | ^^^^^^^^^^^^^^^^^^^^^^^ + --> $DIR/ptr_copy.rs:33:5 + | + 33 | copy_via_raw_ptr(&i, o); + | ^^^^^^^^^^^^^^^^^^^^^^^ note: called by `main` - --> $DIR/ptr_copy.rs:32:8 - | -LL | pub fn main(i: f32, o: &mut f32) { - | ^^^^ + --> $DIR/ptr_copy.rs:32:8 + | + 32 | pub fn main(i: f32, o: &mut f32) { + | ^^^^ error: aborting due to 2 previous errors diff --git a/tests/compiletests/ui/dis/scalars.nocaps.stderr b/tests/compiletests/ui/dis/scalars.nocaps.stderr index f537b2c338..f8bcf199d7 100644 --- a/tests/compiletests/ui/dis/scalars.nocaps.stderr +++ b/tests/compiletests/ui/dis/scalars.nocaps.stderr @@ -3,7 +3,7 @@ error: `u8` type used without `OpCapability Int8` note: used from within Fragment entry-point `main` --> $DIR/scalars.rs:25:5 | -LL | #[spirv(flat)] in_u8: u8, +25 | #[spirv(flat)] in_u8: u8, | ^^^^^^^^^^^^^^^^^^^^^^^^ error: `u16` type used without `OpCapability Int16` @@ -11,7 +11,7 @@ error: `u16` type used without `OpCapability Int16` note: used from within Fragment entry-point `main` --> $DIR/scalars.rs:26:5 | -LL | #[spirv(flat)] in_u16: u16, +26 | #[spirv(flat)] in_u16: u16, | ^^^^^^^^^^^^^^^^^^^^^^^^^^ error: `u64` type used without `OpCapability Int64` @@ -19,7 +19,7 @@ error: `u64` type used without `OpCapability Int64` note: used from within Fragment entry-point `main` --> $DIR/scalars.rs:28:5 | -LL | #[spirv(flat)] in_u64: u64, +28 | #[spirv(flat)] in_u64: u64, | ^^^^^^^^^^^^^^^^^^^^^^^^^^ error: `u128` type unsupported in SPIR-V @@ -27,9 +27,9 @@ error: `u128` type unsupported in SPIR-V note: used from within Fragment entry-point `main` --> $DIR/scalars.rs:30:5 | -LL | / #[cfg(not(supported))] -LL | | #[spirv(flat)] -LL | | in_u128: u128, +30 | / #[cfg(not(supported))] +31 | | #[spirv(flat)] +32 | | in_u128: u128, | |_________________^ error: `i8` type used without `OpCapability Int8` @@ -37,7 +37,7 @@ error: `i8` type used without `OpCapability Int8` note: used from within Fragment entry-point `main` --> $DIR/scalars.rs:34:5 | -LL | #[spirv(flat)] in_i8: i8, +34 | #[spirv(flat)] in_i8: i8, | ^^^^^^^^^^^^^^^^^^^^^^^^ error: `i16` type used without `OpCapability Int16` @@ -45,7 +45,7 @@ error: `i16` type used without `OpCapability Int16` note: used from within Fragment entry-point `main` --> $DIR/scalars.rs:35:5 | -LL | #[spirv(flat)] in_i16: i16, +35 | #[spirv(flat)] in_i16: i16, | ^^^^^^^^^^^^^^^^^^^^^^^^^^ error: `i64` type used without `OpCapability Int64` @@ -53,7 +53,7 @@ error: `i64` type used without `OpCapability Int64` note: used from within Fragment entry-point `main` --> $DIR/scalars.rs:37:5 | -LL | #[spirv(flat)] in_i64: i64, +37 | #[spirv(flat)] in_i64: i64, | ^^^^^^^^^^^^^^^^^^^^^^^^^^ error: `i128` type unsupported in SPIR-V @@ -61,9 +61,9 @@ error: `i128` type unsupported in SPIR-V note: used from within Fragment entry-point `main` --> $DIR/scalars.rs:39:5 | -LL | / #[cfg(not(supported))] -LL | | #[spirv(flat)] -LL | | in_i128: i128, +39 | / #[cfg(not(supported))] +40 | | #[spirv(flat)] +41 | | in_i128: i128, | |_________________^ error: `f64` type used without `OpCapability Float64` @@ -71,7 +71,7 @@ error: `f64` type used without `OpCapability Float64` note: used from within Fragment entry-point `main` --> $DIR/scalars.rs:44:5 | -LL | #[spirv(flat)] in_f64: f64, +44 | #[spirv(flat)] in_f64: f64, | ^^^^^^^^^^^^^^^^^^^^^^^^^^ error: aborting due to 9 previous errors diff --git a/tests/compiletests/ui/dis/spec_constant_array.rs b/tests/compiletests/ui/dis/spec_constant_array.rs deleted file mode 100644 index 8c70003051..0000000000 --- a/tests/compiletests/ui/dis/spec_constant_array.rs +++ /dev/null @@ -1,28 +0,0 @@ -// Tests the various forms of `#[spirv(spec_constant)]`. - -// build-pass -// ignore-spv1.0 -// ignore-spv1.1 -// ignore-spv1.2 -// ignore-spv1.3 -// ignore-vulkan1.0 -// ignore-vulkan1.1 - -// compile-flags: -C llvm-args=--disassemble -// normalize-stderr-test "; .*\n" -> "" -// normalize-stderr-test "OpCapability VulkanMemoryModel\n" -> "" -// normalize-stderr-test "OpSource .*\n" -> "" -// normalize-stderr-test "OpMemoryModel Logical Vulkan" -> "OpMemoryModel Logical Simple" - -// HACK(eddyb) `compiletest` handles `ui\dis\`, but not `ui\\dis\\`, on Windows. -// normalize-stderr-test "ui/dis/" -> "$$DIR/" - -use spirv_std::spirv; - -#[spirv(compute(threads(1)))] -pub fn main( - #[spirv(spec_constant(id = 42, default = 69))] array: [u32; 4], - #[spirv(storage_buffer, descriptor_set = 0, binding = 0)] out: &mut u32, -) { - *out = array[0] + array[1] + array[2] + array[3]; -} diff --git a/tests/compiletests/ui/dis/spec_constant_array.stderr b/tests/compiletests/ui/dis/spec_constant_array.stderr deleted file mode 100644 index 9533cdb38a..0000000000 --- a/tests/compiletests/ui/dis/spec_constant_array.stderr +++ /dev/null @@ -1,38 +0,0 @@ -OpCapability Shader -OpMemoryModel Logical Simple -OpEntryPoint GLCompute %1 "main" %2 -OpExecutionMode %1 LocalSize 1 1 1 -%3 = OpString "$DIR/spec_constant_array.rs" -OpDecorate %4 Block -OpMemberDecorate %4 0 Offset 0 -OpDecorate %2 Binding 0 -OpDecorate %2 DescriptorSet 0 -OpDecorate %5 SpecId 42 -OpDecorate %6 SpecId 43 -OpDecorate %7 SpecId 44 -OpDecorate %8 SpecId 45 -%9 = OpTypeInt 32 0 -%4 = OpTypeStruct %9 -%10 = OpTypePointer StorageBuffer %4 -%11 = OpTypeVoid -%12 = OpTypeFunction %11 -%13 = OpTypePointer StorageBuffer %9 -%2 = OpVariable %10 StorageBuffer -%14 = OpConstant %9 0 -%5 = OpSpecConstant %9 69 -%6 = OpSpecConstant %9 69 -%7 = OpSpecConstant %9 69 -%8 = OpSpecConstant %9 69 -%1 = OpFunction %11 None %12 -%15 = OpLabel -OpLine %3 25 4 -%16 = OpInBoundsAccessChain %13 %2 %14 -OpLine %3 27 11 -%17 = OpIAdd %9 %5 %6 -%18 = OpIAdd %9 %17 %7 -OpLine %3 27 4 -%19 = OpIAdd %9 %18 %8 -OpStore %16 %19 -OpNoLine -OpReturn -OpFunctionEnd diff --git a/tests/compiletests/ui/glam/invalid_vector_type.stderr b/tests/compiletests/ui/glam/invalid_vector_type.stderr index c040cd4d9a..b0826e800c 100644 --- a/tests/compiletests/ui/glam/invalid_vector_type.stderr +++ b/tests/compiletests/ui/glam/invalid_vector_type.stderr @@ -1,19 +1,19 @@ error: `#[spirv(vector)]` must have 2, 3 or 4 members - --> $DIR/invalid_vector_type.rs:8:1 - | -LL | pub struct FewerFields { - | ^^^^^^^^^^^^^^^^^^^^^^ + --> $DIR/invalid_vector_type.rs:8:1 + | +8 | pub struct FewerFields { + | ^^^^^^^^^^^^^^^^^^^^^^ error: `#[spirv(vector)]` must have 2, 3 or 4 members --> $DIR/invalid_vector_type.rs:13:1 | -LL | pub struct TooManyFields { +13 | pub struct TooManyFields { | ^^^^^^^^^^^^^^^^^^^^^^^^ error: `#[spirv(vector)]` type fields must all be floats, integers or bools --> $DIR/invalid_vector_type.rs:22:1 | -LL | pub struct NotVectorField { +22 | pub struct NotVectorField { | ^^^^^^^^^^^^^^^^^^^^^^^^^ | = note: field type is f32x2 @@ -21,7 +21,7 @@ LL | pub struct NotVectorField { error: `#[spirv(vector)]` member types must all be the same --> $DIR/invalid_vector_type.rs:34:1 | -LL | pub struct DifferentTypes { +34 | pub struct DifferentTypes { | ^^^^^^^^^^^^^^^^^^^^^^^^^ error: aborting due to 4 previous errors diff --git a/tests/compiletests/ui/image/gather_err.stderr b/tests/compiletests/ui/image/gather_err.stderr index e2c603b229..4914b62d05 100644 --- a/tests/compiletests/ui/image/gather_err.stderr +++ b/tests/compiletests/ui/image/gather_err.stderr @@ -1,40 +1,40 @@ error[E0277]: the trait bound `Image: HasGather` is not satisfied - --> $DIR/gather_err.rs:15:34 - | -LL | let r1: glam::Vec4 = image1d.gather(*sampler, 0.0f32, 0); - | ^^^^^^ the trait `HasGather` is not implemented for `Image` - | - = help: the following other types implement trait `HasGather`: - Image - Image - Image + --> $DIR/gather_err.rs:15:34 + | + 15 | let r1: glam::Vec4 = image1d.gather(*sampler, 0.0f32, 0); + | ^^^^^^ the trait `HasGather` is not implemented for `Image` + | + = help: the following other types implement trait `HasGather`: + Image + Image + Image note: required by a bound in `Image::::gather` - --> $SPIRV_STD_SRC/image.rs:212:15 - | -LL | pub fn gather( - | ------ required by a bound in this associated function + --> $SPIRV_STD_SRC/image.rs:215:15 + | +208 | pub fn gather( + | ------ required by a bound in this associated function ... -LL | Self: HasGather, - | ^^^^^^^^^ required by this bound in `Image::::gather` +215 | Self: HasGather, + | ^^^^^^^^^ required by this bound in `Image::::gather` error[E0277]: the trait bound `Image: HasGather` is not satisfied - --> $DIR/gather_err.rs:16:34 - | -LL | let r2: glam::Vec4 = image3d.gather(*sampler, v3, 0); - | ^^^^^^ the trait `HasGather` is not implemented for `Image` - | - = help: the following other types implement trait `HasGather`: - Image - Image - Image + --> $DIR/gather_err.rs:16:34 + | + 16 | let r2: glam::Vec4 = image3d.gather(*sampler, v3, 0); + | ^^^^^^ the trait `HasGather` is not implemented for `Image` + | + = help: the following other types implement trait `HasGather`: + Image + Image + Image note: required by a bound in `Image::::gather` - --> $SPIRV_STD_SRC/image.rs:212:15 - | -LL | pub fn gather( - | ------ required by a bound in this associated function + --> $SPIRV_STD_SRC/image.rs:215:15 + | +208 | pub fn gather( + | ------ required by a bound in this associated function ... -LL | Self: HasGather, - | ^^^^^^^^^ required by this bound in `Image::::gather` +215 | Self: HasGather, + | ^^^^^^^^^ required by this bound in `Image::::gather` error: aborting due to 2 previous errors diff --git a/tests/compiletests/ui/image/implicit_not_in_fragment.stderr b/tests/compiletests/ui/image/implicit_not_in_fragment.stderr index bad49aef2b..e799fee473 100644 --- a/tests/compiletests/ui/image/implicit_not_in_fragment.stderr +++ b/tests/compiletests/ui/image/implicit_not_in_fragment.stderr @@ -1,18 +1,18 @@ error: ImageSampleImplicitLod cannot be used outside a fragment shader - | - = note: Stack: - >::sample:: - implicit_not_in_fragment::deeper_stack - implicit_not_in_fragment::deep_stack - implicit_not_in_fragment::main - main + | + = note: Stack: + >::sample:: + implicit_not_in_fragment::deeper_stack + implicit_not_in_fragment::deep_stack + implicit_not_in_fragment::main + main error: ImageSampleImplicitLod cannot be used outside a fragment shader - | - = note: Stack: - >::sample:: - implicit_not_in_fragment::main - main + | + = note: Stack: + >::sample:: + implicit_not_in_fragment::main + main error: aborting due to 2 previous errors diff --git a/tests/compiletests/ui/image/query/query_levels_err.stderr b/tests/compiletests/ui/image/query/query_levels_err.stderr index 7b3d0c0e86..ff5377bb1f 100644 --- a/tests/compiletests/ui/image/query/query_levels_err.stderr +++ b/tests/compiletests/ui/image/query/query_levels_err.stderr @@ -1,22 +1,22 @@ error[E0277]: the trait bound `Image: HasQueryLevels` is not satisfied - --> $DIR/query_levels_err.rs:12:21 - | -LL | *output = image.query_levels(); - | ^^^^^^^^^^^^ the trait `HasQueryLevels` is not implemented for `Image` - | - = help: the following other types implement trait `HasQueryLevels`: - Image - Image - Image - Image + --> $DIR/query_levels_err.rs:12:21 + | + 12 | *output = image.query_levels(); + | ^^^^^^^^^^^^ the trait `HasQueryLevels` is not implemented for `Image` + | + = help: the following other types implement trait `HasQueryLevels`: + Image + Image + Image + Image note: required by a bound in `Image::::query_levels` - --> $SPIRV_STD_SRC/image.rs:964:15 - | -LL | pub fn query_levels(&self) -> u32 - | ------------ required by a bound in this associated function -LL | where -LL | Self: HasQueryLevels, - | ^^^^^^^^^^^^^^ required by this bound in `Image::::query_levels` + --> $SPIRV_STD_SRC/image.rs:967:15 + | +965 | pub fn query_levels(&self) -> u32 + | ------------ required by a bound in this associated function +966 | where +967 | Self: HasQueryLevels, + | ^^^^^^^^^^^^^^ required by this bound in `Image::::query_levels` error: aborting due to 1 previous error diff --git a/tests/compiletests/ui/image/query/query_lod_err.stderr b/tests/compiletests/ui/image/query/query_lod_err.stderr index 5387b12746..b4cb52fea0 100644 --- a/tests/compiletests/ui/image/query/query_lod_err.stderr +++ b/tests/compiletests/ui/image/query/query_lod_err.stderr @@ -1,22 +1,22 @@ error[E0277]: the trait bound `Image: HasQueryLevels` is not satisfied - --> $DIR/query_lod_err.rs:13:21 - | -LL | *output = image.query_lod(*sampler, glam::Vec2::new(0.0, 1.0)); - | ^^^^^^^^^ the trait `HasQueryLevels` is not implemented for `Image` - | - = help: the following other types implement trait `HasQueryLevels`: - Image - Image - Image - Image + --> $DIR/query_lod_err.rs:13:21 + | + 13 | *output = image.query_lod(*sampler, glam::Vec2::new(0.0, 1.0)); + | ^^^^^^^^^ the trait `HasQueryLevels` is not implemented for `Image` + | + = help: the following other types implement trait `HasQueryLevels`: + Image + Image + Image + Image note: required by a bound in `Image::::query_lod` - --> $SPIRV_STD_SRC/image.rs:993:15 - | -LL | pub fn query_lod( - | --------- required by a bound in this associated function + --> $SPIRV_STD_SRC/image.rs:996:15 + | +990 | pub fn query_lod( + | --------- required by a bound in this associated function ... -LL | Self: HasQueryLevels, - | ^^^^^^^^^^^^^^ required by this bound in `Image::::query_lod` +996 | Self: HasQueryLevels, + | ^^^^^^^^^^^^^^ required by this bound in `Image::::query_lod` error: aborting due to 1 previous error diff --git a/tests/compiletests/ui/image/query/query_size_err.stderr b/tests/compiletests/ui/image/query/query_size_err.stderr index 3a799174ba..0750ee1785 100644 --- a/tests/compiletests/ui/image/query/query_size_err.stderr +++ b/tests/compiletests/ui/image/query/query_size_err.stderr @@ -1,27 +1,27 @@ error[E0277]: the trait bound `Image: HasQuerySize` is not satisfied - --> $DIR/query_size_err.rs:12:21 - | -LL | *output = image.query_size(); - | ^^^^^^^^^^ the trait `HasQuerySize` is not implemented for `Image` - | - = help: the following other types implement trait `HasQuerySize`: - Image - Image - Image - Image - Image - Image - Image - Image - and 6 others + --> $DIR/query_size_err.rs:12:21 + | + 12 | *output = image.query_size(); + | ^^^^^^^^^^ the trait `HasQuerySize` is not implemented for `Image` + | + = help: the following other types implement trait `HasQuerySize`: + Image + Image + Image + Image + Image + Image + Image + Image + and 6 others note: required by a bound in `Image::::query_size` - --> $SPIRV_STD_SRC/image.rs:1028:15 - | -LL | pub fn query_size + Default>(&self) -> Size - | ---------- required by a bound in this associated function -LL | where -LL | Self: HasQuerySize, - | ^^^^^^^^^^^^ required by this bound in `Image::::query_size` + --> $SPIRV_STD_SRC/image.rs:1031:15 + | +1029 | pub fn query_size + Default>(&self) -> Size + | ---------- required by a bound in this associated function +1030 | where +1031 | Self: HasQuerySize, + | ^^^^^^^^^^^^ required by this bound in `Image::::query_size` error: aborting due to 1 previous error diff --git a/tests/compiletests/ui/image/query/query_size_lod_err.stderr b/tests/compiletests/ui/image/query/query_size_lod_err.stderr index b24e99ff32..21eae48bd6 100644 --- a/tests/compiletests/ui/image/query/query_size_lod_err.stderr +++ b/tests/compiletests/ui/image/query/query_size_lod_err.stderr @@ -1,22 +1,22 @@ error[E0277]: the trait bound `Image: HasQuerySizeLod` is not satisfied - --> $DIR/query_size_lod_err.rs:12:21 - | -LL | *output = image.query_size_lod(0); - | ^^^^^^^^^^^^^^ the trait `HasQuerySizeLod` is not implemented for `Image` - | - = help: the following other types implement trait `HasQuerySizeLod`: - Image - Image - Image - Image + --> $DIR/query_size_lod_err.rs:12:21 + | + 12 | *output = image.query_size_lod(0); + | ^^^^^^^^^^^^^^ the trait `HasQuerySizeLod` is not implemented for `Image` + | + = help: the following other types implement trait `HasQuerySizeLod`: + Image + Image + Image + Image note: required by a bound in `Image::::query_size_lod` - --> $SPIRV_STD_SRC/image.rs:1074:15 - | -LL | pub fn query_size_lod + Default>( - | -------------- required by a bound in this associated function + --> $SPIRV_STD_SRC/image.rs:1077:15 + | +1072 | pub fn query_size_lod + Default>( + | -------------- required by a bound in this associated function ... -LL | Self: HasQuerySizeLod, - | ^^^^^^^^^^^^^^^ required by this bound in `Image::::query_size_lod` +1077 | Self: HasQuerySizeLod, + | ^^^^^^^^^^^^^^^ required by this bound in `Image::::query_size_lod` error: aborting due to 1 previous error diff --git a/tests/compiletests/ui/image/query/sampled_image_rect_query_size_lod_err.stderr b/tests/compiletests/ui/image/query/sampled_image_rect_query_size_lod_err.stderr index 8bb805378c..0b3bcea2ab 100644 --- a/tests/compiletests/ui/image/query/sampled_image_rect_query_size_lod_err.stderr +++ b/tests/compiletests/ui/image/query/sampled_image_rect_query_size_lod_err.stderr @@ -1,22 +1,22 @@ error[E0277]: the trait bound `Image: HasQuerySizeLod` is not satisfied - --> $DIR/sampled_image_rect_query_size_lod_err.rs:21:28 - | -LL | *output = rect_sampled.query_size_lod(0); - | ^^^^^^^^^^^^^^ the trait `HasQuerySizeLod` is not implemented for `Image` - | - = help: the following other types implement trait `HasQuerySizeLod`: - Image - Image - Image - Image + --> $DIR/sampled_image_rect_query_size_lod_err.rs:21:28 + | +21 | *output = rect_sampled.query_size_lod(0); + | ^^^^^^^^^^^^^^ the trait `HasQuerySizeLod` is not implemented for `Image` + | + = help: the following other types implement trait `HasQuerySizeLod`: + Image + Image + Image + Image note: required by a bound in `SampledImage::>::query_size_lod` - --> /image.rs:1239:12 - | -LL | pub fn query_size_lod + Default>( - | -------------- required by a bound in this associated function + --> /image.rs:1242:12 + | +1228 | pub fn query_size_lod + Default>( + | -------------- required by a bound in this associated function ... -LL | >: HasQuerySizeLod, - | ^^^^^^^^^^^^^^^ required by this bound in `SampledImage::>::query_size_lod` +1242 | >: HasQuerySizeLod, + | ^^^^^^^^^^^^^^^ required by this bound in `SampledImage::>::query_size_lod` error: aborting due to 1 previous error diff --git a/tests/compiletests/ui/lang/asm/block_tracking_fail.stderr b/tests/compiletests/ui/lang/asm/block_tracking_fail.stderr index cdd2c7b0b3..12c83f142e 100644 --- a/tests/compiletests/ui/lang/asm/block_tracking_fail.stderr +++ b/tests/compiletests/ui/lang/asm/block_tracking_fail.stderr @@ -1,19 +1,19 @@ error: `noreturn` requires a terminator at the end --> $DIR/block_tracking_fail.rs:11:15 | -LL | asm!("", options(noreturn)); +11 | asm!("", options(noreturn)); | ^ error: trailing terminator `OpUnreachable` requires `options(noreturn)` --> $DIR/block_tracking_fail.rs:18:15 | -LL | asm!("OpUnreachable"); +18 | asm!("OpUnreachable"); | ^^^^^^^^^^^^^ error: expected `OpLabel` after terminator `OpKill` --> $DIR/block_tracking_fail.rs:26:14 | -LL | "OpKill", +26 | "OpKill", | ^^^^^^ error: aborting due to 3 previous errors diff --git a/tests/compiletests/ui/lang/asm/issue-1002.stderr b/tests/compiletests/ui/lang/asm/issue-1002.stderr index 8b811d8ae9..e1f8c10c6e 100644 --- a/tests/compiletests/ui/lang/asm/issue-1002.stderr +++ b/tests/compiletests/ui/lang/asm/issue-1002.stderr @@ -1,15 +1,15 @@ error: using `OpReturn` to return from within `asm!` is disallowed - --> $DIR/issue-1002.rs:9:15 - | -LL | asm!("OpReturn", options(noreturn)); - | ^^^^^^^^ - | - = note: resuming execution, without falling through the end of the `asm!` block, is always undefined behavior + --> $DIR/issue-1002.rs:9:15 + | +9 | 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}", +16 | "OpReturnValue {x}", | ^^^^^^^^^^^^^^^^^ | = note: resuming execution, without falling through the end of the `asm!` block, is always undefined behavior @@ -17,7 +17,7 @@ LL | "OpReturnValue {x}", error: using `OpReturn` to return from within `asm!` is disallowed --> $DIR/issue-1002.rs:26:14 | -LL | "OpReturn", // close active block +26 | "OpReturn", // close active block | ^^^^^^^^ | = note: resuming execution, without falling through the end of the `asm!` block, is always undefined behavior @@ -25,7 +25,7 @@ LL | "OpReturn", // close active block error: using `OpReturnValue` to return from within `asm!` is disallowed --> $DIR/issue-1002.rs:35:14 | -LL | "OpReturnValue {x}", // close active block +35 | "OpReturnValue {x}", // close active block | ^^^^^^^^^^^^^^^^^ | = note: resuming execution, without falling through the end of the `asm!` block, is always undefined behavior 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..632757f31d 100644 --- a/tests/compiletests/ui/lang/consts/nested-ref-in-composite.stderr +++ b/tests/compiletests/ui/lang/consts/nested-ref-in-composite.stderr @@ -1,35 +1,35 @@ 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)); +20 | *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)); +20 | *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)) { +19 | 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 | -LL | *array3_out = array3_deep_load(&[&0, &1, &2]); +25 | *array3_out = array3_deep_load(&[&0, &1, &2]); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | note: used from within `nested_ref_in_composite::main_array3` --> $DIR/nested-ref-in-composite.rs:25:19 | -LL | *array3_out = array3_deep_load(&[&0, &1, &2]); +25 | *array3_out = array3_deep_load(&[&0, &1, &2]); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ note: called by `main_array3` --> $DIR/nested-ref-in-composite.rs:24:8 | -LL | pub fn main_array3(array3_out: &mut [u32; 3]) { +24 | pub fn main_array3(array3_out: &mut [u32; 3]) { | ^^^^^^^^^^^ error: aborting due to 2 previous errors diff --git a/tests/compiletests/ui/lang/consts/nested-ref.stderr b/tests/compiletests/ui/lang/consts/nested-ref.stderr index 805ec9b607..e66427d0a3 100644 --- a/tests/compiletests/ui/lang/consts/nested-ref.stderr +++ b/tests/compiletests/ui/lang/consts/nested-ref.stderr @@ -1,7 +1,7 @@ warning: `#[inline(never)]` function `nested_ref::deep_load` has been inlined --> $DIR/nested-ref.rs:12:4 | -LL | fn deep_load(r: &'static &'static u32) -> u32 { +12 | fn deep_load(r: &'static &'static u32) -> u32 { | ^^^^^^^^^ | = note: inlining was required due to illegal parameter type @@ -10,7 +10,7 @@ LL | fn deep_load(r: &'static &'static u32) -> u32 { warning: `#[inline(never)]` function `nested_ref::deep_transpose` has been inlined --> $DIR/nested-ref.rs:19:4 | -LL | fn deep_transpose(r: &'static &'static Mat2) -> Mat2 { +19 | fn deep_transpose(r: &'static &'static Mat2) -> Mat2 { | ^^^^^^^^^^^^^^ | = note: inlining was required due to illegal parameter type diff --git a/tests/compiletests/ui/lang/consts/u32-from-u64-fail.stderr b/tests/compiletests/ui/lang/consts/u32-from-u64-fail.stderr index 9ada3d8e3b..4b9e8f23ea 100644 --- a/tests/compiletests/ui/lang/consts/u32-from-u64-fail.stderr +++ b/tests/compiletests/ui/lang/consts/u32-from-u64-fail.stderr @@ -1,7 +1,7 @@ error[E0277]: the trait bound `u32: From` is not satisfied --> $DIR/u32-from-u64-fail.rs:14:17 | -LL | let value = u32::from(K); +14 | let value = u32::from(K); | ^^^ the trait `From` is not implemented for `u32` | = help: the following other types implement trait `From`: diff --git a/tests/compiletests/ui/lang/core/ptr/allocate_const_scalar.stderr b/tests/compiletests/ui/lang/core/ptr/allocate_const_scalar.stderr index aac0775325..f094f850fa 100644 --- a/tests/compiletests/ui/lang/core/ptr/allocate_const_scalar.stderr +++ b/tests/compiletests/ui/lang/core/ptr/allocate_const_scalar.stderr @@ -1,23 +1,23 @@ warning: the feature `ptr_internals` is internal to the compiler or standard library - --> $DIR/allocate_const_scalar.rs:6:12 - | -LL | #![feature(ptr_internals)] - | ^^^^^^^^^^^^^ - | - = note: using it is strongly discouraged - = note: `#[warn(internal_features)]` on by default + --> $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` --> $DIR/allocate_const_scalar.rs:16:5 | -LL | *output = POINTER; +16 | *output = POINTER; | ^^^^^^^^^^^^^^^^^ note: called by `main` --> $DIR/allocate_const_scalar.rs:15:8 | -LL | pub fn main(output: &mut Unique<()>) { +15 | pub fn main(output: &mut Unique<()>) { | ^^^^ error: aborting due to 1 previous error; 1 warning emitted diff --git a/tests/compiletests/ui/lang/core/ptr/allocate_vec_like.stderr b/tests/compiletests/ui/lang/core/ptr/allocate_vec_like.stderr index 529834b08d..d4376b8486 100644 --- a/tests/compiletests/ui/lang/core/ptr/allocate_vec_like.stderr +++ b/tests/compiletests/ui/lang/core/ptr/allocate_vec_like.stderr @@ -1,11 +1,11 @@ warning: the feature `ptr_internals` is internal to the compiler or standard library - --> $DIR/allocate_vec_like.rs:4:12 - | -LL | #![feature(ptr_internals)] - | ^^^^^^^^^^^^^ - | - = note: using it is strongly discouraged - = note: `#[warn(internal_features)]` on by default + --> $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 diff --git a/tests/compiletests/ui/lang/core/ref/member_ref_arg-broken.stderr b/tests/compiletests/ui/lang/core/ref/member_ref_arg-broken.stderr index 4a41bfb462..21d8dd55b6 100644 --- a/tests/compiletests/ui/lang/core/ref/member_ref_arg-broken.stderr +++ b/tests/compiletests/ui/lang/core/ref/member_ref_arg-broken.stderr @@ -1,7 +1,7 @@ warning: `#[inline(never)]` function `member_ref_arg_broken::f` has been inlined --> $DIR/member_ref_arg-broken.rs:20:4 | -LL | fn f(x: &u32) -> u32 { +20 | fn f(x: &u32) -> u32 { | ^ | = note: inlining was required due to illegal (pointer) argument @@ -10,7 +10,7 @@ LL | fn f(x: &u32) -> u32 { warning: `#[inline(never)]` function `member_ref_arg_broken::g` has been inlined --> $DIR/member_ref_arg-broken.rs:25:4 | -LL | fn g(xy: (&u32, &u32)) -> (u32, u32) { +25 | fn g(xy: (&u32, &u32)) -> (u32, u32) { | ^ | = note: inlining was required due to illegal (pointer) argument @@ -19,7 +19,7 @@ LL | fn g(xy: (&u32, &u32)) -> (u32, u32) { warning: `#[inline(never)]` function `member_ref_arg_broken::h` has been inlined --> $DIR/member_ref_arg-broken.rs:30:4 | -LL | fn h(xyz: (&u32, &u32, &u32)) -> (u32, u32, u32) { +30 | fn h(xyz: (&u32, &u32, &u32)) -> (u32, u32, u32) { | ^ | = note: inlining was required due to illegal parameter type @@ -28,7 +28,7 @@ LL | fn h(xyz: (&u32, &u32, &u32)) -> (u32, u32, u32) { warning: `#[inline(never)]` function `member_ref_arg_broken::h_newtyped` has been inlined --> $DIR/member_ref_arg-broken.rs:41:4 | -LL | fn h_newtyped(xyz: ((&u32, &u32, &u32),)) -> (u32, u32, u32) { +41 | fn h_newtyped(xyz: ((&u32, &u32, &u32),)) -> (u32, u32, u32) { | ^^^^^^^^^^ | = note: inlining was required due to illegal parameter type @@ -36,9 +36,9 @@ LL | fn h_newtyped(xyz: ((&u32, &u32, &u32),)) -> (u32, u32, u32) { error: error:0:0 - OpLoad Pointer '$ID[%$ID]' is not a logical pointer. %39 = OpLoad %uint %38 - | - = note: spirv-val failed - = note: module `$TEST_BUILD_DIR/lang/core/ref/member_ref_arg-broken` + | + = note: spirv-val failed + = note: module `$TEST_BUILD_DIR/lang/core/ref/member_ref_arg-broken` error: aborting due to 1 previous error; 4 warnings emitted diff --git a/tests/compiletests/ui/lang/core/ref/member_ref_arg.stderr b/tests/compiletests/ui/lang/core/ref/member_ref_arg.stderr index 5ec9e260b4..fd875abfcc 100644 --- a/tests/compiletests/ui/lang/core/ref/member_ref_arg.stderr +++ b/tests/compiletests/ui/lang/core/ref/member_ref_arg.stderr @@ -1,7 +1,7 @@ warning: `#[inline(never)]` function `member_ref_arg::f` has been inlined --> $DIR/member_ref_arg.rs:14:4 | -LL | fn f(x: &u32) {} +14 | fn f(x: &u32) {} | ^ | = note: inlining was required due to illegal (pointer) argument @@ -10,7 +10,7 @@ LL | fn f(x: &u32) {} warning: `#[inline(never)]` function `member_ref_arg::g` has been inlined --> $DIR/member_ref_arg.rs:17:4 | -LL | fn g(xy: (&u32, &u32)) {} +17 | fn g(xy: (&u32, &u32)) {} | ^ | = note: inlining was required due to illegal (pointer) argument diff --git a/tests/compiletests/ui/lang/core/ref/zst_member_ref_arg-broken.stderr b/tests/compiletests/ui/lang/core/ref/zst_member_ref_arg-broken.stderr index 748fe9a222..126ff058ac 100644 --- a/tests/compiletests/ui/lang/core/ref/zst_member_ref_arg-broken.stderr +++ b/tests/compiletests/ui/lang/core/ref/zst_member_ref_arg-broken.stderr @@ -1,18 +1,18 @@ error: cannot offset a pointer to an arbitrary element --> $DIR/zst_member_ref_arg-broken.rs:23:7 | -LL | f(&s.y); +23 | f(&s.y); | ^^^^ | note: used from within `zst_member_ref_arg_broken::main_scalar` --> $DIR/zst_member_ref_arg-broken.rs:23:7 | -LL | f(&s.y); +23 | f(&s.y); | ^^^^ note: called by `main_scalar` --> $DIR/zst_member_ref_arg-broken.rs:22:8 | -LL | pub fn main_scalar(#[spirv(push_constant)] s: &S) { +22 | pub fn main_scalar(#[spirv(push_constant)] s: &S) { | ^^^^^^^^^^^ error: cannot cast between pointer types @@ -20,18 +20,18 @@ error: cannot cast between pointer types to `*u8` --> $DIR/zst_member_ref_arg-broken.rs:23:7 | -LL | f(&s.y); +23 | f(&s.y); | ^^^^ | note: used from within `zst_member_ref_arg_broken::main_scalar` --> $DIR/zst_member_ref_arg-broken.rs:23:7 | -LL | f(&s.y); +23 | f(&s.y); | ^^^^ note: called by `main_scalar` --> $DIR/zst_member_ref_arg-broken.rs:22:8 | -LL | pub fn main_scalar(#[spirv(push_constant)] s: &S) { +22 | pub fn main_scalar(#[spirv(push_constant)] s: &S) { | ^^^^^^^^^^^ error: cannot cast between pointer types @@ -39,35 +39,35 @@ error: cannot cast between pointer types to `*struct B { }` --> $DIR/zst_member_ref_arg-broken.rs:23:5 | -LL | f(&s.y); +23 | f(&s.y); | ^^^^^^^ | note: used from within `zst_member_ref_arg_broken::main_scalar` --> $DIR/zst_member_ref_arg-broken.rs:23:5 | -LL | f(&s.y); +23 | f(&s.y); | ^^^^^^^ note: called by `main_scalar` --> $DIR/zst_member_ref_arg-broken.rs:22:8 | -LL | pub fn main_scalar(#[spirv(push_constant)] s: &S) { +22 | pub fn main_scalar(#[spirv(push_constant)] s: &S) { | ^^^^^^^^^^^ error: cannot offset a pointer to an arbitrary element --> $DIR/zst_member_ref_arg-broken.rs:28:7 | -LL | f(&s.y); +28 | f(&s.y); | ^^^^ | note: used from within `zst_member_ref_arg_broken::main_scalar_pair` --> $DIR/zst_member_ref_arg-broken.rs:28:7 | -LL | f(&s.y); +28 | f(&s.y); | ^^^^ note: called by `main_scalar_pair` --> $DIR/zst_member_ref_arg-broken.rs:27:8 | -LL | pub fn main_scalar_pair(#[spirv(push_constant)] s: &S) { +27 | pub fn main_scalar_pair(#[spirv(push_constant)] s: &S) { | ^^^^^^^^^^^^^^^^ error: cannot cast between pointer types @@ -75,18 +75,18 @@ error: cannot cast between pointer types to `*u8` --> $DIR/zst_member_ref_arg-broken.rs:28:7 | -LL | f(&s.y); +28 | f(&s.y); | ^^^^ | note: used from within `zst_member_ref_arg_broken::main_scalar_pair` --> $DIR/zst_member_ref_arg-broken.rs:28:7 | -LL | f(&s.y); +28 | f(&s.y); | ^^^^ note: called by `main_scalar_pair` --> $DIR/zst_member_ref_arg-broken.rs:27:8 | -LL | pub fn main_scalar_pair(#[spirv(push_constant)] s: &S) { +27 | pub fn main_scalar_pair(#[spirv(push_constant)] s: &S) { | ^^^^^^^^^^^^^^^^ error: cannot cast between pointer types @@ -94,35 +94,35 @@ error: cannot cast between pointer types to `*struct B { }` --> $DIR/zst_member_ref_arg-broken.rs:28:5 | -LL | f(&s.y); +28 | f(&s.y); | ^^^^^^^ | note: used from within `zst_member_ref_arg_broken::main_scalar_pair` --> $DIR/zst_member_ref_arg-broken.rs:28:5 | -LL | f(&s.y); +28 | f(&s.y); | ^^^^^^^ note: called by `main_scalar_pair` --> $DIR/zst_member_ref_arg-broken.rs:27:8 | -LL | pub fn main_scalar_pair(#[spirv(push_constant)] s: &S) { +27 | pub fn main_scalar_pair(#[spirv(push_constant)] s: &S) { | ^^^^^^^^^^^^^^^^ error: cannot offset a pointer to an arbitrary element --> $DIR/zst_member_ref_arg-broken.rs:33:7 | -LL | f(&s.y); +33 | f(&s.y); | ^^^^ | note: used from within `zst_member_ref_arg_broken::main_scalar_scalar_pair_nested` --> $DIR/zst_member_ref_arg-broken.rs:33:7 | -LL | f(&s.y); +33 | f(&s.y); | ^^^^ note: called by `main_scalar_scalar_pair_nested` --> $DIR/zst_member_ref_arg-broken.rs:32:8 | -LL | pub fn main_scalar_scalar_pair_nested(#[spirv(push_constant)] s: &S<(usize, usize)>) { +32 | pub fn main_scalar_scalar_pair_nested(#[spirv(push_constant)] s: &S<(usize, usize)>) { | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ error: cannot cast between pointer types @@ -130,18 +130,18 @@ error: cannot cast between pointer types to `*u8` --> $DIR/zst_member_ref_arg-broken.rs:33:7 | -LL | f(&s.y); +33 | f(&s.y); | ^^^^ | note: used from within `zst_member_ref_arg_broken::main_scalar_scalar_pair_nested` --> $DIR/zst_member_ref_arg-broken.rs:33:7 | -LL | f(&s.y); +33 | f(&s.y); | ^^^^ note: called by `main_scalar_scalar_pair_nested` --> $DIR/zst_member_ref_arg-broken.rs:32:8 | -LL | pub fn main_scalar_scalar_pair_nested(#[spirv(push_constant)] s: &S<(usize, usize)>) { +32 | pub fn main_scalar_scalar_pair_nested(#[spirv(push_constant)] s: &S<(usize, usize)>) { | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ error: cannot cast between pointer types @@ -149,18 +149,18 @@ error: cannot cast between pointer types to `*struct B { }` --> $DIR/zst_member_ref_arg-broken.rs:33:5 | -LL | f(&s.y); +33 | f(&s.y); | ^^^^^^^ | note: used from within `zst_member_ref_arg_broken::main_scalar_scalar_pair_nested` --> $DIR/zst_member_ref_arg-broken.rs:33:5 | -LL | f(&s.y); +33 | f(&s.y); | ^^^^^^^ note: called by `main_scalar_scalar_pair_nested` --> $DIR/zst_member_ref_arg-broken.rs:32:8 | -LL | pub fn main_scalar_scalar_pair_nested(#[spirv(push_constant)] s: &S<(usize, usize)>) { +32 | pub fn main_scalar_scalar_pair_nested(#[spirv(push_constant)] s: &S<(usize, usize)>) { | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ error: aborting due to 9 previous errors diff --git a/tests/compiletests/ui/lang/issue-452.rs b/tests/compiletests/ui/lang/issue-452.rs deleted file mode 100644 index 585ff99183..0000000000 --- a/tests/compiletests/ui/lang/issue-452.rs +++ /dev/null @@ -1,18 +0,0 @@ -// build-fail - -use spirv_std::spirv; - -#[derive(Clone, Copy)] -struct Position(u32); - -fn use_cmp(cmp: fn(&Position) -> u32) { - let a = Position(0); - let b = Position(1); - - let _ = if cmp(&a) <= cmp(&b) { a } else { b }; -} - -#[spirv(compute(threads(1)))] -pub fn main() { - use_cmp(|p| p.0); -} diff --git a/tests/compiletests/ui/lang/issue-452.stderr b/tests/compiletests/ui/lang/issue-452.stderr deleted file mode 100644 index adc228530a..0000000000 --- a/tests/compiletests/ui/lang/issue-452.stderr +++ /dev/null @@ -1,47 +0,0 @@ -error: function pointer types are not allowed - --> $DIR/issue-452.rs:8:1 - | -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` - --> $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: aborting due to 2 previous errors - diff --git a/tests/compiletests/ui/lang/panic/track_caller.stderr b/tests/compiletests/ui/lang/panic/track_caller.stderr index b18b2fed0d..0b97060a71 100644 --- a/tests/compiletests/ui/lang/panic/track_caller.stderr +++ b/tests/compiletests/ui/lang/panic/track_caller.stderr @@ -1,7 +1,7 @@ warning: `#[inline(never)]` function `track_caller::track_caller_maybe_panic::panic_cold_explicit` has been inlined --> $DIR/track_caller.rs:10:9 | -LL | panic!(); +10 | panic!(); | ^^^^^^^^ | = note: inlining was required due to panicking diff --git a/tests/compiletests/ui/spirv-attr/bad-deduce-storage-class.stderr b/tests/compiletests/ui/spirv-attr/bad-deduce-storage-class.stderr index b98d2e98a8..d1295c78ab 100644 --- a/tests/compiletests/ui/spirv-attr/bad-deduce-storage-class.stderr +++ b/tests/compiletests/ui/spirv-attr/bad-deduce-storage-class.stderr @@ -1,24 +1,24 @@ error: storage class mismatch - --> $DIR/bad-deduce-storage-class.rs:8:5 - | -LL | #[spirv(uniform)] error: &Image!(2D, type=f32), - | ^^^^^^^^-------^^^^^^^^^^--------------------- - | | | - | | `UniformConstant` deduced from type - | `Uniform` specified in attribute - | - = help: remove storage class attribute to use `UniformConstant` as storage class + --> $DIR/bad-deduce-storage-class.rs:8:5 + | +8 | #[spirv(uniform)] error: &Image!(2D, type=f32), + | ^^^^^^^^-------^^^^^^^^^^--------------------- + | | | + | | `UniformConstant` deduced from type + | `Uniform` specified in attribute + | + = help: remove storage class attribute to use `UniformConstant` as storage class warning: redundant storage class attribute, storage class is deduced from type - --> $DIR/bad-deduce-storage-class.rs:9:13 - | -LL | #[spirv(uniform_constant)] warning: &Image!(2D, type=f32), - | ^^^^^^^^^^^^^^^^ + --> $DIR/bad-deduce-storage-class.rs:9:13 + | +9 | #[spirv(uniform_constant)] warning: &Image!(2D, type=f32), + | ^^^^^^^^^^^^^^^^ error: entry parameter type must be by-reference: `&spirv_std::image::Image` --> $DIR/bad-deduce-storage-class.rs:15:27 | -LL | pub fn issue_585(invalid: Image!(2D, type=f32)) {} +15 | pub fn issue_585(invalid: Image!(2D, type=f32)) {} | ^^^^^^^^^^^^^^^^^^^^ | = note: this error originates in the macro `Image` (in Nightly builds, run with -Z macro-backtrace for more info) diff --git a/tests/compiletests/ui/spirv-attr/bool-inputs-err.stderr b/tests/compiletests/ui/spirv-attr/bool-inputs-err.stderr index 8a08baf3eb..2f79db13b5 100644 --- a/tests/compiletests/ui/spirv-attr/bool-inputs-err.stderr +++ b/tests/compiletests/ui/spirv-attr/bool-inputs-err.stderr @@ -1,25 +1,25 @@ error: entry-point parameter cannot contain `bool`s --> $DIR/bool-inputs-err.rs:13:12 | -LL | input: bool, +13 | input: bool, | ^^^^ error: entry-point parameter cannot contain `bool`s --> $DIR/bool-inputs-err.rs:14:13 | -LL | output: &mut bool, +14 | output: &mut bool, | ^^^^^^^^^ error: entry-point parameter cannot contain `bool`s --> $DIR/bool-inputs-err.rs:15:35 | -LL | #[spirv(push_constant)] push: &bool, +15 | #[spirv(push_constant)] push: &bool, | ^^^^^ error: entry-point parameter cannot contain `bool`s --> $DIR/bool-inputs-err.rs:16:32 | -LL | #[spirv(uniform)] uniform: &Boolthing, +16 | #[spirv(uniform)] uniform: &Boolthing, | ^^^^^^^^^^ error: aborting due to 4 previous errors diff --git a/tests/compiletests/ui/spirv-attr/int-without-flat.stderr b/tests/compiletests/ui/spirv-attr/int-without-flat.stderr index 00b65552dc..45b5fcbc6b 100644 --- a/tests/compiletests/ui/spirv-attr/int-without-flat.stderr +++ b/tests/compiletests/ui/spirv-attr/int-without-flat.stderr @@ -1,14 +1,14 @@ error: `Fragment` entry-point `Input` parameter must be decorated with `#[spirv(flat)]` - --> $DIR/int-without-flat.rs:6:22 - | -LL | pub fn fragment(int: u32, double: f64) {} - | ^^^ + --> $DIR/int-without-flat.rs:6:22 + | +6 | pub fn fragment(int: u32, double: f64) {} + | ^^^ error: `Fragment` entry-point `Input` parameter must be decorated with `#[spirv(flat)]` - --> $DIR/int-without-flat.rs:6:35 - | -LL | pub fn fragment(int: u32, double: f64) {} - | ^^^ + --> $DIR/int-without-flat.rs:6:35 + | +6 | pub fn fragment(int: u32, double: f64) {} + | ^^^ error: aborting due to 2 previous errors diff --git a/tests/compiletests/ui/spirv-attr/invalid-matrix-type-empty.stderr b/tests/compiletests/ui/spirv-attr/invalid-matrix-type-empty.stderr index 2f768d790d..45b1139cc0 100644 --- a/tests/compiletests/ui/spirv-attr/invalid-matrix-type-empty.stderr +++ b/tests/compiletests/ui/spirv-attr/invalid-matrix-type-empty.stderr @@ -1,8 +1,8 @@ error: `#[spirv(matrix)]` member types must all be the same - --> $DIR/invalid-matrix-type-empty.rs:7:1 - | -LL | pub struct EmptyStruct {} - | ^^^^^^^^^^^^^^^^^^^^^^ + --> $DIR/invalid-matrix-type-empty.rs:7:1 + | +7 | pub struct EmptyStruct {} + | ^^^^^^^^^^^^^^^^^^^^^^ error: aborting due to 1 previous error diff --git a/tests/compiletests/ui/spirv-attr/invalid-matrix-type.stderr b/tests/compiletests/ui/spirv-attr/invalid-matrix-type.stderr index 17e30c91dd..a14a76b6d6 100644 --- a/tests/compiletests/ui/spirv-attr/invalid-matrix-type.stderr +++ b/tests/compiletests/ui/spirv-attr/invalid-matrix-type.stderr @@ -1,13 +1,13 @@ error: `#[spirv(matrix)]` must have 2, 3 or 4 members - --> $DIR/invalid-matrix-type.rs:7:1 - | -LL | pub struct _FewerFields { - | ^^^^^^^^^^^^^^^^^^^^^^^ + --> $DIR/invalid-matrix-type.rs:7:1 + | +7 | pub struct _FewerFields { + | ^^^^^^^^^^^^^^^^^^^^^^^ error: `#[spirv(matrix)]` type fields must all be vectors --> $DIR/invalid-matrix-type.rs:12:1 | -LL | pub struct _NotVectorField { +12 | pub struct _NotVectorField { | ^^^^^^^^^^^^^^^^^^^^^^^^^^ | = note: field type is f32 @@ -15,7 +15,7 @@ LL | pub struct _NotVectorField { error: `#[spirv(matrix)]` member types must all be the same --> $DIR/invalid-matrix-type.rs:19:1 | -LL | pub struct _DifferentType { +19 | pub struct _DifferentType { | ^^^^^^^^^^^^^^^^^^^^^^^^^ error: aborting due to 3 previous errors diff --git a/tests/compiletests/ui/spirv-attr/invalid-storage-class.stderr b/tests/compiletests/ui/spirv-attr/invalid-storage-class.stderr index d2020f822d..e3d8a39cb0 100644 --- a/tests/compiletests/ui/spirv-attr/invalid-storage-class.stderr +++ b/tests/compiletests/ui/spirv-attr/invalid-storage-class.stderr @@ -1,31 +1,31 @@ error: `Input` storage class is the default and should not be explicitly specified - --> $DIR/invalid-storage-class.rs:9:13 - | -LL | #[spirv(input)] _: (), - | ^^^^^ + --> $DIR/invalid-storage-class.rs:9:13 + | +9 | #[spirv(input)] _: (), + | ^^^^^ error: `Output` storage class is the default and should not be explicitly specified --> $DIR/invalid-storage-class.rs:10:13 | -LL | #[spirv(output)] _: (), +10 | #[spirv(output)] _: (), | ^^^^^^ error: `Private` storage class can not be used as part of an entry's interface --> $DIR/invalid-storage-class.rs:11:13 | -LL | #[spirv(private)] _: (), +11 | #[spirv(private)] _: (), | ^^^^^^^ error: `Function` storage class can not be used as part of an entry's interface --> $DIR/invalid-storage-class.rs:12:13 | -LL | #[spirv(function)] _: (), +12 | #[spirv(function)] _: (), | ^^^^^^^^ error: `Generic` storage class can not be used as part of an entry's interface --> $DIR/invalid-storage-class.rs:13:13 | -LL | #[spirv(generic)] _: (), +13 | #[spirv(generic)] _: (), | ^^^^^^^ error: aborting due to 5 previous errors diff --git a/tests/compiletests/ui/spirv-attr/invalid-target.stderr b/tests/compiletests/ui/spirv-attr/invalid-target.stderr index 5cb3a5e890..9a848bf39f 100644 --- a/tests/compiletests/ui/spirv-attr/invalid-target.stderr +++ b/tests/compiletests/ui/spirv-attr/invalid-target.stderr @@ -1,2651 +1,2651 @@ error: attribute is only valid on a struct, not on a macro def --> $DIR/invalid-target.rs:38:5 | -LL | sampler, block, sampled_image, generic_image_type, // struct-only +38 | sampler, block, sampled_image, generic_image_type, // struct-only | ^^^^^^^ error: attribute is only valid on a struct, not on a macro def --> $DIR/invalid-target.rs:38:14 | -LL | sampler, block, sampled_image, generic_image_type, // struct-only +38 | sampler, block, sampled_image, generic_image_type, // struct-only | ^^^^^ error: attribute is only valid on a struct, not on a macro def --> $DIR/invalid-target.rs:38:21 | -LL | sampler, block, sampled_image, generic_image_type, // struct-only +38 | sampler, block, sampled_image, generic_image_type, // struct-only | ^^^^^^^^^^^^^ error: attribute is only valid on a struct, not on a macro def --> $DIR/invalid-target.rs:38:36 | -LL | sampler, block, sampled_image, generic_image_type, // struct-only +38 | sampler, block, sampled_image, generic_image_type, // struct-only | ^^^^^^^^^^^^^^^^^^ error: attribute is only valid on a function, not on a macro def --> $DIR/invalid-target.rs:39:5 | -LL | vertex, // fn-only +39 | vertex, // fn-only | ^^^^^^ error: attribute is only valid on a function parameter, not on a macro def --> $DIR/invalid-target.rs:40:5 | -LL | uniform, position, descriptor_set = 0, binding = 0, flat, invariant, // param-only +40 | uniform, position, descriptor_set = 0, binding = 0, flat, invariant, // param-only | ^^^^^^^ error: attribute is only valid on a function parameter, not on a macro def --> $DIR/invalid-target.rs:40:14 | -LL | uniform, position, descriptor_set = 0, binding = 0, flat, invariant, // param-only +40 | uniform, position, descriptor_set = 0, binding = 0, flat, invariant, // param-only | ^^^^^^^^ error: attribute is only valid on a function parameter, not on a macro def --> $DIR/invalid-target.rs:40:24 | -LL | uniform, position, descriptor_set = 0, binding = 0, flat, invariant, // param-only +40 | uniform, position, descriptor_set = 0, binding = 0, flat, invariant, // param-only | ^^^^^^^^^^^^^^^^^^ error: attribute is only valid on a function parameter, not on a macro def --> $DIR/invalid-target.rs:40:44 | -LL | uniform, position, descriptor_set = 0, binding = 0, flat, invariant, // param-only +40 | uniform, position, descriptor_set = 0, binding = 0, flat, invariant, // param-only | ^^^^^^^^^^^ error: attribute is only valid on a function parameter, not on a macro def --> $DIR/invalid-target.rs:40:57 | -LL | uniform, position, descriptor_set = 0, binding = 0, flat, invariant, // param-only +40 | uniform, position, descriptor_set = 0, binding = 0, flat, invariant, // param-only | ^^^^ error: attribute is only valid on a function parameter, not on a macro def --> $DIR/invalid-target.rs:40:63 | -LL | uniform, position, descriptor_set = 0, binding = 0, flat, invariant, // param-only +40 | uniform, position, descriptor_set = 0, binding = 0, flat, invariant, // param-only | ^^^^^^^^^ error: attribute is only valid on a struct, not on a extern crate --> $DIR/invalid-target.rs:47:5 | -LL | sampler, block, sampled_image, generic_image_type, // struct-only +47 | sampler, block, sampled_image, generic_image_type, // struct-only | ^^^^^^^ error: attribute is only valid on a struct, not on a extern crate --> $DIR/invalid-target.rs:47:14 | -LL | sampler, block, sampled_image, generic_image_type, // struct-only +47 | sampler, block, sampled_image, generic_image_type, // struct-only | ^^^^^ error: attribute is only valid on a struct, not on a extern crate --> $DIR/invalid-target.rs:47:21 | -LL | sampler, block, sampled_image, generic_image_type, // struct-only +47 | sampler, block, sampled_image, generic_image_type, // struct-only | ^^^^^^^^^^^^^ error: attribute is only valid on a struct, not on a extern crate --> $DIR/invalid-target.rs:47:36 | -LL | sampler, block, sampled_image, generic_image_type, // struct-only +47 | sampler, block, sampled_image, generic_image_type, // struct-only | ^^^^^^^^^^^^^^^^^^ error: attribute is only valid on a function, not on a extern crate --> $DIR/invalid-target.rs:48:5 | -LL | vertex, // fn-only +48 | vertex, // fn-only | ^^^^^^ error: attribute is only valid on a function parameter, not on a extern crate --> $DIR/invalid-target.rs:49:5 | -LL | uniform, position, descriptor_set = 0, binding = 0, flat, invariant, // param-only +49 | uniform, position, descriptor_set = 0, binding = 0, flat, invariant, // param-only | ^^^^^^^ error: attribute is only valid on a function parameter, not on a extern crate --> $DIR/invalid-target.rs:49:14 | -LL | uniform, position, descriptor_set = 0, binding = 0, flat, invariant, // param-only +49 | uniform, position, descriptor_set = 0, binding = 0, flat, invariant, // param-only | ^^^^^^^^ error: attribute is only valid on a function parameter, not on a extern crate --> $DIR/invalid-target.rs:49:24 | -LL | uniform, position, descriptor_set = 0, binding = 0, flat, invariant, // param-only +49 | uniform, position, descriptor_set = 0, binding = 0, flat, invariant, // param-only | ^^^^^^^^^^^^^^^^^^ error: attribute is only valid on a function parameter, not on a extern crate --> $DIR/invalid-target.rs:49:44 | -LL | uniform, position, descriptor_set = 0, binding = 0, flat, invariant, // param-only +49 | uniform, position, descriptor_set = 0, binding = 0, flat, invariant, // param-only | ^^^^^^^^^^^ error: attribute is only valid on a function parameter, not on a extern crate --> $DIR/invalid-target.rs:49:57 | -LL | uniform, position, descriptor_set = 0, binding = 0, flat, invariant, // param-only +49 | uniform, position, descriptor_set = 0, binding = 0, flat, invariant, // param-only | ^^^^ error: attribute is only valid on a function parameter, not on a extern crate --> $DIR/invalid-target.rs:49:63 | -LL | uniform, position, descriptor_set = 0, binding = 0, flat, invariant, // param-only +49 | uniform, position, descriptor_set = 0, binding = 0, flat, invariant, // param-only | ^^^^^^^^^ error: attribute is only valid on a struct, not on a use --> $DIR/invalid-target.rs:54:5 | -LL | sampler, block, sampled_image, generic_image_type, // struct-only +54 | sampler, block, sampled_image, generic_image_type, // struct-only | ^^^^^^^ error: attribute is only valid on a struct, not on a use --> $DIR/invalid-target.rs:54:14 | -LL | sampler, block, sampled_image, generic_image_type, // struct-only +54 | sampler, block, sampled_image, generic_image_type, // struct-only | ^^^^^ error: attribute is only valid on a struct, not on a use --> $DIR/invalid-target.rs:54:21 | -LL | sampler, block, sampled_image, generic_image_type, // struct-only +54 | sampler, block, sampled_image, generic_image_type, // struct-only | ^^^^^^^^^^^^^ error: attribute is only valid on a struct, not on a use --> $DIR/invalid-target.rs:54:36 | -LL | sampler, block, sampled_image, generic_image_type, // struct-only +54 | sampler, block, sampled_image, generic_image_type, // struct-only | ^^^^^^^^^^^^^^^^^^ error: attribute is only valid on a function, not on a use --> $DIR/invalid-target.rs:55:5 | -LL | vertex, // fn-only +55 | vertex, // fn-only | ^^^^^^ error: attribute is only valid on a function parameter, not on a use --> $DIR/invalid-target.rs:56:5 | -LL | uniform, position, descriptor_set = 0, binding = 0, flat, invariant, // param-only +56 | uniform, position, descriptor_set = 0, binding = 0, flat, invariant, // param-only | ^^^^^^^ error: attribute is only valid on a function parameter, not on a use --> $DIR/invalid-target.rs:56:14 | -LL | uniform, position, descriptor_set = 0, binding = 0, flat, invariant, // param-only +56 | uniform, position, descriptor_set = 0, binding = 0, flat, invariant, // param-only | ^^^^^^^^ error: attribute is only valid on a function parameter, not on a use --> $DIR/invalid-target.rs:56:24 | -LL | uniform, position, descriptor_set = 0, binding = 0, flat, invariant, // param-only +56 | uniform, position, descriptor_set = 0, binding = 0, flat, invariant, // param-only | ^^^^^^^^^^^^^^^^^^ error: attribute is only valid on a function parameter, not on a use --> $DIR/invalid-target.rs:56:44 | -LL | uniform, position, descriptor_set = 0, binding = 0, flat, invariant, // param-only +56 | uniform, position, descriptor_set = 0, binding = 0, flat, invariant, // param-only | ^^^^^^^^^^^ error: attribute is only valid on a function parameter, not on a use --> $DIR/invalid-target.rs:56:57 | -LL | uniform, position, descriptor_set = 0, binding = 0, flat, invariant, // param-only +56 | uniform, position, descriptor_set = 0, binding = 0, flat, invariant, // param-only | ^^^^ error: attribute is only valid on a function parameter, not on a use --> $DIR/invalid-target.rs:56:63 | -LL | uniform, position, descriptor_set = 0, binding = 0, flat, invariant, // param-only +56 | uniform, position, descriptor_set = 0, binding = 0, flat, invariant, // param-only | ^^^^^^^^^ error: attribute is only valid on a struct, not on a module --> $DIR/invalid-target.rs:61:5 | -LL | sampler, block, sampled_image, generic_image_type, // struct-only +61 | sampler, block, sampled_image, generic_image_type, // struct-only | ^^^^^^^ error: attribute is only valid on a struct, not on a module --> $DIR/invalid-target.rs:61:14 | -LL | sampler, block, sampled_image, generic_image_type, // struct-only +61 | sampler, block, sampled_image, generic_image_type, // struct-only | ^^^^^ error: attribute is only valid on a struct, not on a module --> $DIR/invalid-target.rs:61:21 | -LL | sampler, block, sampled_image, generic_image_type, // struct-only +61 | sampler, block, sampled_image, generic_image_type, // struct-only | ^^^^^^^^^^^^^ error: attribute is only valid on a struct, not on a module --> $DIR/invalid-target.rs:61:36 | -LL | sampler, block, sampled_image, generic_image_type, // struct-only +61 | sampler, block, sampled_image, generic_image_type, // struct-only | ^^^^^^^^^^^^^^^^^^ error: attribute is only valid on a function, not on a module --> $DIR/invalid-target.rs:62:5 | -LL | vertex, // fn-only +62 | vertex, // fn-only | ^^^^^^ error: attribute is only valid on a function parameter, not on a module --> $DIR/invalid-target.rs:63:5 | -LL | uniform, position, descriptor_set = 0, binding = 0, flat, invariant, // param-only +63 | uniform, position, descriptor_set = 0, binding = 0, flat, invariant, // param-only | ^^^^^^^ error: attribute is only valid on a function parameter, not on a module --> $DIR/invalid-target.rs:63:14 | -LL | uniform, position, descriptor_set = 0, binding = 0, flat, invariant, // param-only +63 | uniform, position, descriptor_set = 0, binding = 0, flat, invariant, // param-only | ^^^^^^^^ error: attribute is only valid on a function parameter, not on a module --> $DIR/invalid-target.rs:63:24 | -LL | uniform, position, descriptor_set = 0, binding = 0, flat, invariant, // param-only +63 | uniform, position, descriptor_set = 0, binding = 0, flat, invariant, // param-only | ^^^^^^^^^^^^^^^^^^ error: attribute is only valid on a function parameter, not on a module --> $DIR/invalid-target.rs:63:44 | -LL | uniform, position, descriptor_set = 0, binding = 0, flat, invariant, // param-only +63 | uniform, position, descriptor_set = 0, binding = 0, flat, invariant, // param-only | ^^^^^^^^^^^ error: attribute is only valid on a function parameter, not on a module --> $DIR/invalid-target.rs:63:57 | -LL | uniform, position, descriptor_set = 0, binding = 0, flat, invariant, // param-only +63 | uniform, position, descriptor_set = 0, binding = 0, flat, invariant, // param-only | ^^^^ error: attribute is only valid on a function parameter, not on a module --> $DIR/invalid-target.rs:63:63 | -LL | uniform, position, descriptor_set = 0, binding = 0, flat, invariant, // param-only +63 | uniform, position, descriptor_set = 0, binding = 0, flat, invariant, // param-only | ^^^^^^^^^ error: attribute is only valid on a struct, not on a foreign module --> $DIR/invalid-target.rs:68:5 | -LL | sampler, block, sampled_image, generic_image_type, // struct-only +68 | sampler, block, sampled_image, generic_image_type, // struct-only | ^^^^^^^ error: attribute is only valid on a struct, not on a foreign module --> $DIR/invalid-target.rs:68:14 | -LL | sampler, block, sampled_image, generic_image_type, // struct-only +68 | sampler, block, sampled_image, generic_image_type, // struct-only | ^^^^^ error: attribute is only valid on a struct, not on a foreign module --> $DIR/invalid-target.rs:68:21 | -LL | sampler, block, sampled_image, generic_image_type, // struct-only +68 | sampler, block, sampled_image, generic_image_type, // struct-only | ^^^^^^^^^^^^^ error: attribute is only valid on a struct, not on a foreign module --> $DIR/invalid-target.rs:68:36 | -LL | sampler, block, sampled_image, generic_image_type, // struct-only +68 | sampler, block, sampled_image, generic_image_type, // struct-only | ^^^^^^^^^^^^^^^^^^ error: attribute is only valid on a function, not on a foreign module --> $DIR/invalid-target.rs:69:5 | -LL | vertex, // fn-only +69 | vertex, // fn-only | ^^^^^^ error: attribute is only valid on a function parameter, not on a foreign module --> $DIR/invalid-target.rs:70:5 | -LL | uniform, position, descriptor_set = 0, binding = 0, flat, invariant, // param-only +70 | uniform, position, descriptor_set = 0, binding = 0, flat, invariant, // param-only | ^^^^^^^ error: attribute is only valid on a function parameter, not on a foreign module --> $DIR/invalid-target.rs:70:14 | -LL | uniform, position, descriptor_set = 0, binding = 0, flat, invariant, // param-only +70 | uniform, position, descriptor_set = 0, binding = 0, flat, invariant, // param-only | ^^^^^^^^ error: attribute is only valid on a function parameter, not on a foreign module --> $DIR/invalid-target.rs:70:24 | -LL | uniform, position, descriptor_set = 0, binding = 0, flat, invariant, // param-only +70 | uniform, position, descriptor_set = 0, binding = 0, flat, invariant, // param-only | ^^^^^^^^^^^^^^^^^^ error: attribute is only valid on a function parameter, not on a foreign module --> $DIR/invalid-target.rs:70:44 | -LL | uniform, position, descriptor_set = 0, binding = 0, flat, invariant, // param-only +70 | uniform, position, descriptor_set = 0, binding = 0, flat, invariant, // param-only | ^^^^^^^^^^^ error: attribute is only valid on a function parameter, not on a foreign module --> $DIR/invalid-target.rs:70:57 | -LL | uniform, position, descriptor_set = 0, binding = 0, flat, invariant, // param-only +70 | uniform, position, descriptor_set = 0, binding = 0, flat, invariant, // param-only | ^^^^ error: attribute is only valid on a function parameter, not on a foreign module --> $DIR/invalid-target.rs:70:63 | -LL | uniform, position, descriptor_set = 0, binding = 0, flat, invariant, // param-only +70 | uniform, position, descriptor_set = 0, binding = 0, flat, invariant, // param-only | ^^^^^^^^^ error: attribute is only valid on a struct, not on a static item --> $DIR/invalid-target.rs:96:5 | -LL | sampler, block, sampled_image, generic_image_type, // struct-only +96 | sampler, block, sampled_image, generic_image_type, // struct-only | ^^^^^^^ error: attribute is only valid on a struct, not on a static item --> $DIR/invalid-target.rs:96:14 | -LL | sampler, block, sampled_image, generic_image_type, // struct-only +96 | sampler, block, sampled_image, generic_image_type, // struct-only | ^^^^^ error: attribute is only valid on a struct, not on a static item --> $DIR/invalid-target.rs:96:21 | -LL | sampler, block, sampled_image, generic_image_type, // struct-only +96 | sampler, block, sampled_image, generic_image_type, // struct-only | ^^^^^^^^^^^^^ error: attribute is only valid on a struct, not on a static item --> $DIR/invalid-target.rs:96:36 | -LL | sampler, block, sampled_image, generic_image_type, // struct-only +96 | sampler, block, sampled_image, generic_image_type, // struct-only | ^^^^^^^^^^^^^^^^^^ error: attribute is only valid on a function, not on a static item --> $DIR/invalid-target.rs:97:5 | -LL | vertex, // fn-only +97 | vertex, // fn-only | ^^^^^^ error: attribute is only valid on a function parameter, not on a static item --> $DIR/invalid-target.rs:98:5 | -LL | uniform, position, descriptor_set = 0, binding = 0, flat, invariant, // param-only +98 | 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 --> $DIR/invalid-target.rs:98:14 | -LL | uniform, position, descriptor_set = 0, binding = 0, flat, invariant, // param-only +98 | 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 --> $DIR/invalid-target.rs:98:24 | -LL | uniform, position, descriptor_set = 0, binding = 0, flat, invariant, // param-only +98 | 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 --> $DIR/invalid-target.rs:98:44 | -LL | uniform, position, descriptor_set = 0, binding = 0, flat, invariant, // param-only +98 | 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 --> $DIR/invalid-target.rs:98:57 | -LL | uniform, position, descriptor_set = 0, binding = 0, flat, invariant, // param-only +98 | 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 --> $DIR/invalid-target.rs:98:63 | -LL | uniform, position, descriptor_set = 0, binding = 0, flat, invariant, // param-only +98 | uniform, position, descriptor_set = 0, binding = 0, flat, invariant, // param-only | ^^^^^^^^^ error: attribute is only valid on a struct, not on a constant item - --> $DIR/invalid-target.rs:103:5 - | -LL | sampler, block, sampled_image, generic_image_type, // struct-only - | ^^^^^^^ + --> $DIR/invalid-target.rs:103:5 + | +103 | sampler, block, sampled_image, generic_image_type, // struct-only + | ^^^^^^^ error: attribute is only valid on a struct, not on a constant item - --> $DIR/invalid-target.rs:103:14 - | -LL | sampler, block, sampled_image, generic_image_type, // struct-only - | ^^^^^ + --> $DIR/invalid-target.rs:103:14 + | +103 | sampler, block, sampled_image, generic_image_type, // struct-only + | ^^^^^ error: attribute is only valid on a struct, not on a constant item - --> $DIR/invalid-target.rs:103:21 - | -LL | sampler, block, sampled_image, generic_image_type, // struct-only - | ^^^^^^^^^^^^^ + --> $DIR/invalid-target.rs:103:21 + | +103 | sampler, block, sampled_image, generic_image_type, // struct-only + | ^^^^^^^^^^^^^ error: attribute is only valid on a struct, not on a constant item - --> $DIR/invalid-target.rs:103:36 - | -LL | sampler, block, sampled_image, generic_image_type, // struct-only - | ^^^^^^^^^^^^^^^^^^ + --> $DIR/invalid-target.rs:103:36 + | +103 | sampler, block, sampled_image, generic_image_type, // struct-only + | ^^^^^^^^^^^^^^^^^^ error: attribute is only valid on a function, not on a constant item - --> $DIR/invalid-target.rs:104:5 - | -LL | vertex, // fn-only - | ^^^^^^ + --> $DIR/invalid-target.rs:104:5 + | +104 | vertex, // fn-only + | ^^^^^^ error: attribute is only valid on a function parameter, not on a constant item - --> $DIR/invalid-target.rs:105:5 - | -LL | uniform, position, descriptor_set = 0, binding = 0, flat, invariant, // param-only - | ^^^^^^^ + --> $DIR/invalid-target.rs:105:5 + | +105 | 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 - --> $DIR/invalid-target.rs:105:14 - | -LL | uniform, position, descriptor_set = 0, binding = 0, flat, invariant, // param-only - | ^^^^^^^^ + --> $DIR/invalid-target.rs:105:14 + | +105 | 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 - --> $DIR/invalid-target.rs:105:24 - | -LL | uniform, position, descriptor_set = 0, binding = 0, flat, invariant, // param-only - | ^^^^^^^^^^^^^^^^^^ + --> $DIR/invalid-target.rs:105:24 + | +105 | 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 - --> $DIR/invalid-target.rs:105:44 - | -LL | uniform, position, descriptor_set = 0, binding = 0, flat, invariant, // param-only - | ^^^^^^^^^^^ + --> $DIR/invalid-target.rs:105:44 + | +105 | 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 - --> $DIR/invalid-target.rs:105:57 - | -LL | uniform, position, descriptor_set = 0, binding = 0, flat, invariant, // param-only - | ^^^^ + --> $DIR/invalid-target.rs:105:57 + | +105 | 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 - --> $DIR/invalid-target.rs:105:63 - | -LL | uniform, position, descriptor_set = 0, binding = 0, flat, invariant, // param-only - | ^^^^^^^^^ + --> $DIR/invalid-target.rs:105:63 + | +105 | uniform, position, descriptor_set = 0, binding = 0, flat, invariant, // param-only + | ^^^^^^^^^ error: attribute is only valid on a struct, not on a type alias - --> $DIR/invalid-target.rs:110:5 - | -LL | sampler, block, sampled_image, generic_image_type, // struct-only - | ^^^^^^^ + --> $DIR/invalid-target.rs:110:5 + | +110 | sampler, block, sampled_image, generic_image_type, // struct-only + | ^^^^^^^ error: attribute is only valid on a struct, not on a type alias - --> $DIR/invalid-target.rs:110:14 - | -LL | sampler, block, sampled_image, generic_image_type, // struct-only - | ^^^^^ + --> $DIR/invalid-target.rs:110:14 + | +110 | sampler, block, sampled_image, generic_image_type, // struct-only + | ^^^^^ error: attribute is only valid on a struct, not on a type alias - --> $DIR/invalid-target.rs:110:21 - | -LL | sampler, block, sampled_image, generic_image_type, // struct-only - | ^^^^^^^^^^^^^ + --> $DIR/invalid-target.rs:110:21 + | +110 | sampler, block, sampled_image, generic_image_type, // struct-only + | ^^^^^^^^^^^^^ error: attribute is only valid on a struct, not on a type alias - --> $DIR/invalid-target.rs:110:36 - | -LL | sampler, block, sampled_image, generic_image_type, // struct-only - | ^^^^^^^^^^^^^^^^^^ + --> $DIR/invalid-target.rs:110:36 + | +110 | sampler, block, sampled_image, generic_image_type, // struct-only + | ^^^^^^^^^^^^^^^^^^ error: attribute is only valid on a function, not on a type alias - --> $DIR/invalid-target.rs:111:5 - | -LL | vertex, // fn-only - | ^^^^^^ + --> $DIR/invalid-target.rs:111:5 + | +111 | vertex, // fn-only + | ^^^^^^ error: attribute is only valid on a function parameter, not on a type alias - --> $DIR/invalid-target.rs:112:5 - | -LL | uniform, position, descriptor_set = 0, binding = 0, flat, invariant, // param-only - | ^^^^^^^ + --> $DIR/invalid-target.rs:112:5 + | +112 | uniform, position, descriptor_set = 0, binding = 0, flat, invariant, // param-only + | ^^^^^^^ error: attribute is only valid on a function parameter, not on a type alias - --> $DIR/invalid-target.rs:112:14 - | -LL | uniform, position, descriptor_set = 0, binding = 0, flat, invariant, // param-only - | ^^^^^^^^ + --> $DIR/invalid-target.rs:112:14 + | +112 | uniform, position, descriptor_set = 0, binding = 0, flat, invariant, // param-only + | ^^^^^^^^ error: attribute is only valid on a function parameter, not on a type alias - --> $DIR/invalid-target.rs:112:24 - | -LL | uniform, position, descriptor_set = 0, binding = 0, flat, invariant, // param-only - | ^^^^^^^^^^^^^^^^^^ + --> $DIR/invalid-target.rs:112:24 + | +112 | uniform, position, descriptor_set = 0, binding = 0, flat, invariant, // param-only + | ^^^^^^^^^^^^^^^^^^ error: attribute is only valid on a function parameter, not on a type alias - --> $DIR/invalid-target.rs:112:44 - | -LL | uniform, position, descriptor_set = 0, binding = 0, flat, invariant, // param-only - | ^^^^^^^^^^^ + --> $DIR/invalid-target.rs:112:44 + | +112 | uniform, position, descriptor_set = 0, binding = 0, flat, invariant, // param-only + | ^^^^^^^^^^^ error: attribute is only valid on a function parameter, not on a type alias - --> $DIR/invalid-target.rs:112:57 - | -LL | uniform, position, descriptor_set = 0, binding = 0, flat, invariant, // param-only - | ^^^^ + --> $DIR/invalid-target.rs:112:57 + | +112 | uniform, position, descriptor_set = 0, binding = 0, flat, invariant, // param-only + | ^^^^ error: attribute is only valid on a function parameter, not on a type alias - --> $DIR/invalid-target.rs:112:63 - | -LL | uniform, position, descriptor_set = 0, binding = 0, flat, invariant, // param-only - | ^^^^^^^^^ + --> $DIR/invalid-target.rs:112:63 + | +112 | uniform, position, descriptor_set = 0, binding = 0, flat, invariant, // param-only + | ^^^^^^^^^ error: attribute is only valid on a struct, not on a type alias - --> $DIR/invalid-target.rs:117:5 - | -LL | sampler, block, sampled_image, generic_image_type, // struct-only - | ^^^^^^^ + --> $DIR/invalid-target.rs:117:5 + | +117 | sampler, block, sampled_image, generic_image_type, // struct-only + | ^^^^^^^ error: attribute is only valid on a struct, not on a type alias - --> $DIR/invalid-target.rs:117:14 - | -LL | sampler, block, sampled_image, generic_image_type, // struct-only - | ^^^^^ + --> $DIR/invalid-target.rs:117:14 + | +117 | sampler, block, sampled_image, generic_image_type, // struct-only + | ^^^^^ error: attribute is only valid on a struct, not on a type alias - --> $DIR/invalid-target.rs:117:21 - | -LL | sampler, block, sampled_image, generic_image_type, // struct-only - | ^^^^^^^^^^^^^ + --> $DIR/invalid-target.rs:117:21 + | +117 | sampler, block, sampled_image, generic_image_type, // struct-only + | ^^^^^^^^^^^^^ error: attribute is only valid on a struct, not on a type alias - --> $DIR/invalid-target.rs:117:36 - | -LL | sampler, block, sampled_image, generic_image_type, // struct-only - | ^^^^^^^^^^^^^^^^^^ + --> $DIR/invalid-target.rs:117:36 + | +117 | sampler, block, sampled_image, generic_image_type, // struct-only + | ^^^^^^^^^^^^^^^^^^ error: attribute is only valid on a function, not on a type alias - --> $DIR/invalid-target.rs:118:5 - | -LL | vertex, // fn-only - | ^^^^^^ + --> $DIR/invalid-target.rs:118:5 + | +118 | vertex, // fn-only + | ^^^^^^ error: attribute is only valid on a function parameter, not on a type alias - --> $DIR/invalid-target.rs:119:5 - | -LL | uniform, position, descriptor_set = 0, binding = 0, flat, invariant, // param-only - | ^^^^^^^ + --> $DIR/invalid-target.rs:119:5 + | +119 | uniform, position, descriptor_set = 0, binding = 0, flat, invariant, // param-only + | ^^^^^^^ error: attribute is only valid on a function parameter, not on a type alias - --> $DIR/invalid-target.rs:119:14 - | -LL | uniform, position, descriptor_set = 0, binding = 0, flat, invariant, // param-only - | ^^^^^^^^ + --> $DIR/invalid-target.rs:119:14 + | +119 | uniform, position, descriptor_set = 0, binding = 0, flat, invariant, // param-only + | ^^^^^^^^ error: attribute is only valid on a function parameter, not on a type alias - --> $DIR/invalid-target.rs:119:24 - | -LL | uniform, position, descriptor_set = 0, binding = 0, flat, invariant, // param-only - | ^^^^^^^^^^^^^^^^^^ + --> $DIR/invalid-target.rs:119:24 + | +119 | uniform, position, descriptor_set = 0, binding = 0, flat, invariant, // param-only + | ^^^^^^^^^^^^^^^^^^ error: attribute is only valid on a function parameter, not on a type alias - --> $DIR/invalid-target.rs:119:44 - | -LL | uniform, position, descriptor_set = 0, binding = 0, flat, invariant, // param-only - | ^^^^^^^^^^^ + --> $DIR/invalid-target.rs:119:44 + | +119 | uniform, position, descriptor_set = 0, binding = 0, flat, invariant, // param-only + | ^^^^^^^^^^^ error: attribute is only valid on a function parameter, not on a type alias - --> $DIR/invalid-target.rs:119:57 - | -LL | uniform, position, descriptor_set = 0, binding = 0, flat, invariant, // param-only - | ^^^^ + --> $DIR/invalid-target.rs:119:57 + | +119 | uniform, position, descriptor_set = 0, binding = 0, flat, invariant, // param-only + | ^^^^ error: attribute is only valid on a function parameter, not on a type alias - --> $DIR/invalid-target.rs:119:63 - | -LL | uniform, position, descriptor_set = 0, binding = 0, flat, invariant, // param-only - | ^^^^^^^^^ + --> $DIR/invalid-target.rs:119:63 + | +119 | uniform, position, descriptor_set = 0, binding = 0, flat, invariant, // param-only + | ^^^^^^^^^ error: attribute is only valid on a struct, not on a enum - --> $DIR/invalid-target.rs:128:5 - | -LL | sampler, block, sampled_image, generic_image_type, // struct-only - | ^^^^^^^ + --> $DIR/invalid-target.rs:128:5 + | +128 | sampler, block, sampled_image, generic_image_type, // struct-only + | ^^^^^^^ error: attribute is only valid on a struct, not on a enum - --> $DIR/invalid-target.rs:128:14 - | -LL | sampler, block, sampled_image, generic_image_type, // struct-only - | ^^^^^ + --> $DIR/invalid-target.rs:128:14 + | +128 | sampler, block, sampled_image, generic_image_type, // struct-only + | ^^^^^ error: attribute is only valid on a struct, not on a enum - --> $DIR/invalid-target.rs:128:21 - | -LL | sampler, block, sampled_image, generic_image_type, // struct-only - | ^^^^^^^^^^^^^ + --> $DIR/invalid-target.rs:128:21 + | +128 | sampler, block, sampled_image, generic_image_type, // struct-only + | ^^^^^^^^^^^^^ error: attribute is only valid on a struct, not on a enum - --> $DIR/invalid-target.rs:128:36 - | -LL | sampler, block, sampled_image, generic_image_type, // struct-only - | ^^^^^^^^^^^^^^^^^^ + --> $DIR/invalid-target.rs:128:36 + | +128 | sampler, block, sampled_image, generic_image_type, // struct-only + | ^^^^^^^^^^^^^^^^^^ error: attribute is only valid on a function, not on a enum - --> $DIR/invalid-target.rs:129:5 - | -LL | vertex, // fn-only - | ^^^^^^ + --> $DIR/invalid-target.rs:129:5 + | +129 | vertex, // fn-only + | ^^^^^^ error: attribute is only valid on a function parameter, not on a enum - --> $DIR/invalid-target.rs:130:5 - | -LL | uniform, position, descriptor_set = 0, binding = 0, flat, invariant, // param-only - | ^^^^^^^ + --> $DIR/invalid-target.rs:130:5 + | +130 | uniform, position, descriptor_set = 0, binding = 0, flat, invariant, // param-only + | ^^^^^^^ error: attribute is only valid on a function parameter, not on a enum - --> $DIR/invalid-target.rs:130:14 - | -LL | uniform, position, descriptor_set = 0, binding = 0, flat, invariant, // param-only - | ^^^^^^^^ + --> $DIR/invalid-target.rs:130:14 + | +130 | uniform, position, descriptor_set = 0, binding = 0, flat, invariant, // param-only + | ^^^^^^^^ error: attribute is only valid on a function parameter, not on a enum - --> $DIR/invalid-target.rs:130:24 - | -LL | uniform, position, descriptor_set = 0, binding = 0, flat, invariant, // param-only - | ^^^^^^^^^^^^^^^^^^ + --> $DIR/invalid-target.rs:130:24 + | +130 | uniform, position, descriptor_set = 0, binding = 0, flat, invariant, // param-only + | ^^^^^^^^^^^^^^^^^^ error: attribute is only valid on a function parameter, not on a enum - --> $DIR/invalid-target.rs:130:44 - | -LL | uniform, position, descriptor_set = 0, binding = 0, flat, invariant, // param-only - | ^^^^^^^^^^^ + --> $DIR/invalid-target.rs:130:44 + | +130 | uniform, position, descriptor_set = 0, binding = 0, flat, invariant, // param-only + | ^^^^^^^^^^^ error: attribute is only valid on a function parameter, not on a enum - --> $DIR/invalid-target.rs:130:57 - | -LL | uniform, position, descriptor_set = 0, binding = 0, flat, invariant, // param-only - | ^^^^ + --> $DIR/invalid-target.rs:130:57 + | +130 | uniform, position, descriptor_set = 0, binding = 0, flat, invariant, // param-only + | ^^^^ error: attribute is only valid on a function parameter, not on a enum - --> $DIR/invalid-target.rs:130:63 - | -LL | uniform, position, descriptor_set = 0, binding = 0, flat, invariant, // param-only - | ^^^^^^^^^ + --> $DIR/invalid-target.rs:130:63 + | +130 | uniform, position, descriptor_set = 0, binding = 0, flat, invariant, // param-only + | ^^^^^^^^^ error: attribute is only valid on a struct, not on a enum variant - --> $DIR/invalid-target.rs:134:9 - | -LL | sampler, block, sampled_image, generic_image_type, // struct-only - | ^^^^^^^ + --> $DIR/invalid-target.rs:134:9 + | +134 | sampler, block, sampled_image, generic_image_type, // struct-only + | ^^^^^^^ error: attribute is only valid on a struct, not on a enum variant - --> $DIR/invalid-target.rs:134:18 - | -LL | sampler, block, sampled_image, generic_image_type, // struct-only - | ^^^^^ + --> $DIR/invalid-target.rs:134:18 + | +134 | sampler, block, sampled_image, generic_image_type, // struct-only + | ^^^^^ error: attribute is only valid on a struct, not on a enum variant - --> $DIR/invalid-target.rs:134:25 - | -LL | sampler, block, sampled_image, generic_image_type, // struct-only - | ^^^^^^^^^^^^^ + --> $DIR/invalid-target.rs:134:25 + | +134 | sampler, block, sampled_image, generic_image_type, // struct-only + | ^^^^^^^^^^^^^ error: attribute is only valid on a struct, not on a enum variant - --> $DIR/invalid-target.rs:134:40 - | -LL | sampler, block, sampled_image, generic_image_type, // struct-only - | ^^^^^^^^^^^^^^^^^^ + --> $DIR/invalid-target.rs:134:40 + | +134 | sampler, block, sampled_image, generic_image_type, // struct-only + | ^^^^^^^^^^^^^^^^^^ error: attribute is only valid on a function, not on a enum variant - --> $DIR/invalid-target.rs:135:9 - | -LL | vertex, // fn-only - | ^^^^^^ + --> $DIR/invalid-target.rs:135:9 + | +135 | vertex, // fn-only + | ^^^^^^ error: attribute is only valid on a function parameter, not on a enum variant - --> $DIR/invalid-target.rs:136:9 - | -LL | uniform, position, descriptor_set = 0, binding = 0, flat, invariant, // param-only - | ^^^^^^^ + --> $DIR/invalid-target.rs:136:9 + | +136 | uniform, position, descriptor_set = 0, binding = 0, flat, invariant, // param-only + | ^^^^^^^ error: attribute is only valid on a function parameter, not on a enum variant - --> $DIR/invalid-target.rs:136:18 - | -LL | uniform, position, descriptor_set = 0, binding = 0, flat, invariant, // param-only - | ^^^^^^^^ + --> $DIR/invalid-target.rs:136:18 + | +136 | uniform, position, descriptor_set = 0, binding = 0, flat, invariant, // param-only + | ^^^^^^^^ error: attribute is only valid on a function parameter, not on a enum variant - --> $DIR/invalid-target.rs:136:28 - | -LL | uniform, position, descriptor_set = 0, binding = 0, flat, invariant, // param-only - | ^^^^^^^^^^^^^^^^^^ + --> $DIR/invalid-target.rs:136:28 + | +136 | uniform, position, descriptor_set = 0, binding = 0, flat, invariant, // param-only + | ^^^^^^^^^^^^^^^^^^ error: attribute is only valid on a function parameter, not on a enum variant - --> $DIR/invalid-target.rs:136:48 - | -LL | uniform, position, descriptor_set = 0, binding = 0, flat, invariant, // param-only - | ^^^^^^^^^^^ + --> $DIR/invalid-target.rs:136:48 + | +136 | uniform, position, descriptor_set = 0, binding = 0, flat, invariant, // param-only + | ^^^^^^^^^^^ error: attribute is only valid on a function parameter, not on a enum variant - --> $DIR/invalid-target.rs:136:61 - | -LL | uniform, position, descriptor_set = 0, binding = 0, flat, invariant, // param-only - | ^^^^ + --> $DIR/invalid-target.rs:136:61 + | +136 | uniform, position, descriptor_set = 0, binding = 0, flat, invariant, // param-only + | ^^^^ error: attribute is only valid on a function parameter, not on a enum variant - --> $DIR/invalid-target.rs:136:67 - | -LL | uniform, position, descriptor_set = 0, binding = 0, flat, invariant, // param-only - | ^^^^^^^^^ + --> $DIR/invalid-target.rs:136:67 + | +136 | uniform, position, descriptor_set = 0, binding = 0, flat, invariant, // param-only + | ^^^^^^^^^ error: attribute is only valid on a struct, not on a struct field - --> $DIR/invalid-target.rs:140:13 - | -LL | sampler, block, sampled_image, generic_image_type, // struct-only - | ^^^^^^^ + --> $DIR/invalid-target.rs:140:13 + | +140 | sampler, block, sampled_image, generic_image_type, // struct-only + | ^^^^^^^ error: attribute is only valid on a struct, not on a struct field - --> $DIR/invalid-target.rs:140:22 - | -LL | sampler, block, sampled_image, generic_image_type, // struct-only - | ^^^^^ + --> $DIR/invalid-target.rs:140:22 + | +140 | sampler, block, sampled_image, generic_image_type, // struct-only + | ^^^^^ error: attribute is only valid on a struct, not on a struct field - --> $DIR/invalid-target.rs:140:29 - | -LL | sampler, block, sampled_image, generic_image_type, // struct-only - | ^^^^^^^^^^^^^ + --> $DIR/invalid-target.rs:140:29 + | +140 | sampler, block, sampled_image, generic_image_type, // struct-only + | ^^^^^^^^^^^^^ error: attribute is only valid on a struct, not on a struct field - --> $DIR/invalid-target.rs:140:44 - | -LL | sampler, block, sampled_image, generic_image_type, // struct-only - | ^^^^^^^^^^^^^^^^^^ + --> $DIR/invalid-target.rs:140:44 + | +140 | sampler, block, sampled_image, generic_image_type, // struct-only + | ^^^^^^^^^^^^^^^^^^ error: attribute is only valid on a function, not on a struct field - --> $DIR/invalid-target.rs:141:13 - | -LL | vertex, // fn-only - | ^^^^^^ + --> $DIR/invalid-target.rs:141:13 + | +141 | vertex, // fn-only + | ^^^^^^ error: attribute is only valid on a function parameter, not on a struct field - --> $DIR/invalid-target.rs:142:13 - | -LL | uniform, position, descriptor_set = 0, binding = 0, flat, invariant, // param-only - | ^^^^^^^ + --> $DIR/invalid-target.rs:142:13 + | +142 | uniform, position, descriptor_set = 0, binding = 0, flat, invariant, // param-only + | ^^^^^^^ error: attribute is only valid on a function parameter, not on a struct field - --> $DIR/invalid-target.rs:142:22 - | -LL | uniform, position, descriptor_set = 0, binding = 0, flat, invariant, // param-only - | ^^^^^^^^ + --> $DIR/invalid-target.rs:142:22 + | +142 | uniform, position, descriptor_set = 0, binding = 0, flat, invariant, // param-only + | ^^^^^^^^ error: attribute is only valid on a function parameter, not on a struct field - --> $DIR/invalid-target.rs:142:32 - | -LL | uniform, position, descriptor_set = 0, binding = 0, flat, invariant, // param-only - | ^^^^^^^^^^^^^^^^^^ + --> $DIR/invalid-target.rs:142:32 + | +142 | uniform, position, descriptor_set = 0, binding = 0, flat, invariant, // param-only + | ^^^^^^^^^^^^^^^^^^ error: attribute is only valid on a function parameter, not on a struct field - --> $DIR/invalid-target.rs:142:52 - | -LL | uniform, position, descriptor_set = 0, binding = 0, flat, invariant, // param-only - | ^^^^^^^^^^^ + --> $DIR/invalid-target.rs:142:52 + | +142 | uniform, position, descriptor_set = 0, binding = 0, flat, invariant, // param-only + | ^^^^^^^^^^^ error: attribute is only valid on a function parameter, not on a struct field - --> $DIR/invalid-target.rs:142:65 - | -LL | uniform, position, descriptor_set = 0, binding = 0, flat, invariant, // param-only - | ^^^^ + --> $DIR/invalid-target.rs:142:65 + | +142 | uniform, position, descriptor_set = 0, binding = 0, flat, invariant, // param-only + | ^^^^ error: attribute is only valid on a function parameter, not on a struct field - --> $DIR/invalid-target.rs:142:71 - | -LL | uniform, position, descriptor_set = 0, binding = 0, flat, invariant, // param-only - | ^^^^^^^^^ + --> $DIR/invalid-target.rs:142:71 + | +142 | uniform, position, descriptor_set = 0, binding = 0, flat, invariant, // param-only + | ^^^^^^^^^ error: attribute is only valid on a struct, not on a union - --> $DIR/invalid-target.rs:149:5 - | -LL | sampler, block, sampled_image, generic_image_type, // struct-only - | ^^^^^^^ + --> $DIR/invalid-target.rs:149:5 + | +149 | sampler, block, sampled_image, generic_image_type, // struct-only + | ^^^^^^^ error: attribute is only valid on a struct, not on a union - --> $DIR/invalid-target.rs:149:14 - | -LL | sampler, block, sampled_image, generic_image_type, // struct-only - | ^^^^^ + --> $DIR/invalid-target.rs:149:14 + | +149 | sampler, block, sampled_image, generic_image_type, // struct-only + | ^^^^^ error: attribute is only valid on a struct, not on a union - --> $DIR/invalid-target.rs:149:21 - | -LL | sampler, block, sampled_image, generic_image_type, // struct-only - | ^^^^^^^^^^^^^ + --> $DIR/invalid-target.rs:149:21 + | +149 | sampler, block, sampled_image, generic_image_type, // struct-only + | ^^^^^^^^^^^^^ error: attribute is only valid on a struct, not on a union - --> $DIR/invalid-target.rs:149:36 - | -LL | sampler, block, sampled_image, generic_image_type, // struct-only - | ^^^^^^^^^^^^^^^^^^ + --> $DIR/invalid-target.rs:149:36 + | +149 | sampler, block, sampled_image, generic_image_type, // struct-only + | ^^^^^^^^^^^^^^^^^^ error: attribute is only valid on a function, not on a union - --> $DIR/invalid-target.rs:150:5 - | -LL | vertex, // fn-only - | ^^^^^^ + --> $DIR/invalid-target.rs:150:5 + | +150 | vertex, // fn-only + | ^^^^^^ error: attribute is only valid on a function parameter, not on a union - --> $DIR/invalid-target.rs:151:5 - | -LL | uniform, position, descriptor_set = 0, binding = 0, flat, invariant, // param-only - | ^^^^^^^ + --> $DIR/invalid-target.rs:151:5 + | +151 | uniform, position, descriptor_set = 0, binding = 0, flat, invariant, // param-only + | ^^^^^^^ error: attribute is only valid on a function parameter, not on a union - --> $DIR/invalid-target.rs:151:14 - | -LL | uniform, position, descriptor_set = 0, binding = 0, flat, invariant, // param-only - | ^^^^^^^^ + --> $DIR/invalid-target.rs:151:14 + | +151 | uniform, position, descriptor_set = 0, binding = 0, flat, invariant, // param-only + | ^^^^^^^^ error: attribute is only valid on a function parameter, not on a union - --> $DIR/invalid-target.rs:151:24 - | -LL | uniform, position, descriptor_set = 0, binding = 0, flat, invariant, // param-only - | ^^^^^^^^^^^^^^^^^^ + --> $DIR/invalid-target.rs:151:24 + | +151 | uniform, position, descriptor_set = 0, binding = 0, flat, invariant, // param-only + | ^^^^^^^^^^^^^^^^^^ error: attribute is only valid on a function parameter, not on a union - --> $DIR/invalid-target.rs:151:44 - | -LL | uniform, position, descriptor_set = 0, binding = 0, flat, invariant, // param-only - | ^^^^^^^^^^^ + --> $DIR/invalid-target.rs:151:44 + | +151 | uniform, position, descriptor_set = 0, binding = 0, flat, invariant, // param-only + | ^^^^^^^^^^^ error: attribute is only valid on a function parameter, not on a union - --> $DIR/invalid-target.rs:151:57 - | -LL | uniform, position, descriptor_set = 0, binding = 0, flat, invariant, // param-only - | ^^^^ + --> $DIR/invalid-target.rs:151:57 + | +151 | uniform, position, descriptor_set = 0, binding = 0, flat, invariant, // param-only + | ^^^^ error: attribute is only valid on a function parameter, not on a union - --> $DIR/invalid-target.rs:151:63 - | -LL | uniform, position, descriptor_set = 0, binding = 0, flat, invariant, // param-only - | ^^^^^^^^^ + --> $DIR/invalid-target.rs:151:63 + | +151 | uniform, position, descriptor_set = 0, binding = 0, flat, invariant, // param-only + | ^^^^^^^^^ error: attribute is only valid on a struct, not on a struct field - --> $DIR/invalid-target.rs:155:9 - | -LL | sampler, block, sampled_image, generic_image_type, // struct-only - | ^^^^^^^ + --> $DIR/invalid-target.rs:155:9 + | +155 | sampler, block, sampled_image, generic_image_type, // struct-only + | ^^^^^^^ error: attribute is only valid on a struct, not on a struct field - --> $DIR/invalid-target.rs:155:18 - | -LL | sampler, block, sampled_image, generic_image_type, // struct-only - | ^^^^^ + --> $DIR/invalid-target.rs:155:18 + | +155 | sampler, block, sampled_image, generic_image_type, // struct-only + | ^^^^^ error: attribute is only valid on a struct, not on a struct field - --> $DIR/invalid-target.rs:155:25 - | -LL | sampler, block, sampled_image, generic_image_type, // struct-only - | ^^^^^^^^^^^^^ + --> $DIR/invalid-target.rs:155:25 + | +155 | sampler, block, sampled_image, generic_image_type, // struct-only + | ^^^^^^^^^^^^^ error: attribute is only valid on a struct, not on a struct field - --> $DIR/invalid-target.rs:155:40 - | -LL | sampler, block, sampled_image, generic_image_type, // struct-only - | ^^^^^^^^^^^^^^^^^^ + --> $DIR/invalid-target.rs:155:40 + | +155 | sampler, block, sampled_image, generic_image_type, // struct-only + | ^^^^^^^^^^^^^^^^^^ error: attribute is only valid on a function, not on a struct field - --> $DIR/invalid-target.rs:156:9 - | -LL | vertex, // fn-only - | ^^^^^^ + --> $DIR/invalid-target.rs:156:9 + | +156 | vertex, // fn-only + | ^^^^^^ error: attribute is only valid on a function parameter, not on a struct field - --> $DIR/invalid-target.rs:157:9 - | -LL | uniform, position, descriptor_set = 0, binding = 0, flat, invariant, // param-only - | ^^^^^^^ + --> $DIR/invalid-target.rs:157:9 + | +157 | uniform, position, descriptor_set = 0, binding = 0, flat, invariant, // param-only + | ^^^^^^^ error: attribute is only valid on a function parameter, not on a struct field - --> $DIR/invalid-target.rs:157:18 - | -LL | uniform, position, descriptor_set = 0, binding = 0, flat, invariant, // param-only - | ^^^^^^^^ + --> $DIR/invalid-target.rs:157:18 + | +157 | uniform, position, descriptor_set = 0, binding = 0, flat, invariant, // param-only + | ^^^^^^^^ error: attribute is only valid on a function parameter, not on a struct field - --> $DIR/invalid-target.rs:157:28 - | -LL | uniform, position, descriptor_set = 0, binding = 0, flat, invariant, // param-only - | ^^^^^^^^^^^^^^^^^^ + --> $DIR/invalid-target.rs:157:28 + | +157 | uniform, position, descriptor_set = 0, binding = 0, flat, invariant, // param-only + | ^^^^^^^^^^^^^^^^^^ error: attribute is only valid on a function parameter, not on a struct field - --> $DIR/invalid-target.rs:157:48 - | -LL | uniform, position, descriptor_set = 0, binding = 0, flat, invariant, // param-only - | ^^^^^^^^^^^ + --> $DIR/invalid-target.rs:157:48 + | +157 | uniform, position, descriptor_set = 0, binding = 0, flat, invariant, // param-only + | ^^^^^^^^^^^ error: attribute is only valid on a function parameter, not on a struct field - --> $DIR/invalid-target.rs:157:61 - | -LL | uniform, position, descriptor_set = 0, binding = 0, flat, invariant, // param-only - | ^^^^ + --> $DIR/invalid-target.rs:157:61 + | +157 | uniform, position, descriptor_set = 0, binding = 0, flat, invariant, // param-only + | ^^^^ error: attribute is only valid on a function parameter, not on a struct field - --> $DIR/invalid-target.rs:157:67 - | -LL | uniform, position, descriptor_set = 0, binding = 0, flat, invariant, // param-only - | ^^^^^^^^^ + --> $DIR/invalid-target.rs:157:67 + | +157 | uniform, position, descriptor_set = 0, binding = 0, flat, invariant, // param-only + | ^^^^^^^^^ error: attribute is only valid on a function, not on a struct - --> $DIR/invalid-target.rs:163:5 - | -LL | vertex, // fn-only - | ^^^^^^ + --> $DIR/invalid-target.rs:163:5 + | +163 | vertex, // fn-only + | ^^^^^^ error: attribute is only valid on a function parameter, not on a struct - --> $DIR/invalid-target.rs:164:5 - | -LL | uniform, position, descriptor_set = 0, binding = 0, flat, invariant, // param-only - | ^^^^^^^ + --> $DIR/invalid-target.rs:164:5 + | +164 | uniform, position, descriptor_set = 0, binding = 0, flat, invariant, // param-only + | ^^^^^^^ error: attribute is only valid on a function parameter, not on a struct - --> $DIR/invalid-target.rs:164:14 - | -LL | uniform, position, descriptor_set = 0, binding = 0, flat, invariant, // param-only - | ^^^^^^^^ + --> $DIR/invalid-target.rs:164:14 + | +164 | uniform, position, descriptor_set = 0, binding = 0, flat, invariant, // param-only + | ^^^^^^^^ error: attribute is only valid on a function parameter, not on a struct - --> $DIR/invalid-target.rs:164:24 - | -LL | uniform, position, descriptor_set = 0, binding = 0, flat, invariant, // param-only - | ^^^^^^^^^^^^^^^^^^ + --> $DIR/invalid-target.rs:164:24 + | +164 | uniform, position, descriptor_set = 0, binding = 0, flat, invariant, // param-only + | ^^^^^^^^^^^^^^^^^^ error: attribute is only valid on a function parameter, not on a struct - --> $DIR/invalid-target.rs:164:44 - | -LL | uniform, position, descriptor_set = 0, binding = 0, flat, invariant, // param-only - | ^^^^^^^^^^^ + --> $DIR/invalid-target.rs:164:44 + | +164 | uniform, position, descriptor_set = 0, binding = 0, flat, invariant, // param-only + | ^^^^^^^^^^^ error: attribute is only valid on a function parameter, not on a struct - --> $DIR/invalid-target.rs:164:57 - | -LL | uniform, position, descriptor_set = 0, binding = 0, flat, invariant, // param-only - | ^^^^ + --> $DIR/invalid-target.rs:164:57 + | +164 | uniform, position, descriptor_set = 0, binding = 0, flat, invariant, // param-only + | ^^^^ error: attribute is only valid on a function parameter, not on a struct - --> $DIR/invalid-target.rs:164:63 - | -LL | uniform, position, descriptor_set = 0, binding = 0, flat, invariant, // param-only - | ^^^^^^^^^ + --> $DIR/invalid-target.rs:164:63 + | +164 | uniform, position, descriptor_set = 0, binding = 0, flat, invariant, // param-only + | ^^^^^^^^^ error: attribute is only valid on a struct, not on a struct field - --> $DIR/invalid-target.rs:168:9 - | -LL | sampler, block, sampled_image, generic_image_type, // struct-only - | ^^^^^^^ + --> $DIR/invalid-target.rs:168:9 + | +168 | sampler, block, sampled_image, generic_image_type, // struct-only + | ^^^^^^^ error: attribute is only valid on a struct, not on a struct field - --> $DIR/invalid-target.rs:168:18 - | -LL | sampler, block, sampled_image, generic_image_type, // struct-only - | ^^^^^ + --> $DIR/invalid-target.rs:168:18 + | +168 | sampler, block, sampled_image, generic_image_type, // struct-only + | ^^^^^ error: attribute is only valid on a struct, not on a struct field - --> $DIR/invalid-target.rs:168:25 - | -LL | sampler, block, sampled_image, generic_image_type, // struct-only - | ^^^^^^^^^^^^^ + --> $DIR/invalid-target.rs:168:25 + | +168 | sampler, block, sampled_image, generic_image_type, // struct-only + | ^^^^^^^^^^^^^ error: attribute is only valid on a struct, not on a struct field - --> $DIR/invalid-target.rs:168:40 - | -LL | sampler, block, sampled_image, generic_image_type, // struct-only - | ^^^^^^^^^^^^^^^^^^ + --> $DIR/invalid-target.rs:168:40 + | +168 | sampler, block, sampled_image, generic_image_type, // struct-only + | ^^^^^^^^^^^^^^^^^^ error: attribute is only valid on a function, not on a struct field - --> $DIR/invalid-target.rs:169:9 - | -LL | vertex, // fn-only - | ^^^^^^ + --> $DIR/invalid-target.rs:169:9 + | +169 | vertex, // fn-only + | ^^^^^^ error: attribute is only valid on a function parameter, not on a struct field - --> $DIR/invalid-target.rs:170:9 - | -LL | uniform, position, descriptor_set = 0, binding = 0, flat, invariant, // param-only - | ^^^^^^^ + --> $DIR/invalid-target.rs:170:9 + | +170 | uniform, position, descriptor_set = 0, binding = 0, flat, invariant, // param-only + | ^^^^^^^ error: attribute is only valid on a function parameter, not on a struct field - --> $DIR/invalid-target.rs:170:18 - | -LL | uniform, position, descriptor_set = 0, binding = 0, flat, invariant, // param-only - | ^^^^^^^^ + --> $DIR/invalid-target.rs:170:18 + | +170 | uniform, position, descriptor_set = 0, binding = 0, flat, invariant, // param-only + | ^^^^^^^^ error: attribute is only valid on a function parameter, not on a struct field - --> $DIR/invalid-target.rs:170:28 - | -LL | uniform, position, descriptor_set = 0, binding = 0, flat, invariant, // param-only - | ^^^^^^^^^^^^^^^^^^ + --> $DIR/invalid-target.rs:170:28 + | +170 | uniform, position, descriptor_set = 0, binding = 0, flat, invariant, // param-only + | ^^^^^^^^^^^^^^^^^^ error: attribute is only valid on a function parameter, not on a struct field - --> $DIR/invalid-target.rs:170:48 - | -LL | uniform, position, descriptor_set = 0, binding = 0, flat, invariant, // param-only - | ^^^^^^^^^^^ + --> $DIR/invalid-target.rs:170:48 + | +170 | uniform, position, descriptor_set = 0, binding = 0, flat, invariant, // param-only + | ^^^^^^^^^^^ error: attribute is only valid on a function parameter, not on a struct field - --> $DIR/invalid-target.rs:170:61 - | -LL | uniform, position, descriptor_set = 0, binding = 0, flat, invariant, // param-only - | ^^^^ + --> $DIR/invalid-target.rs:170:61 + | +170 | uniform, position, descriptor_set = 0, binding = 0, flat, invariant, // param-only + | ^^^^ error: attribute is only valid on a function parameter, not on a struct field - --> $DIR/invalid-target.rs:170:67 - | -LL | uniform, position, descriptor_set = 0, binding = 0, flat, invariant, // param-only - | ^^^^^^^^^ - -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 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 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 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 implementation block - --> $DIR/invalid-target.rs:177:5 - | -LL | vertex, // fn-only - | ^^^^^^ - -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 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 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 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 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 implementation block - --> $DIR/invalid-target.rs:178:63 - | -LL | uniform, position, descriptor_set = 0, binding = 0, flat, invariant, // param-only - | ^^^^^^^^^ + --> $DIR/invalid-target.rs:170:67 + | +170 | 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 + --> $DIR/invalid-target.rs:176:5 + | +176 | sampler, block, sampled_image, generic_image_type, // struct-only + | ^^^^^^^ + +error: attribute is only valid on a struct, not on a inherent implementation block + --> $DIR/invalid-target.rs:176:14 + | +176 | sampler, block, sampled_image, generic_image_type, // struct-only + | ^^^^^ + +error: attribute is only valid on a struct, not on a inherent implementation block + --> $DIR/invalid-target.rs:176:21 + | +176 | sampler, block, sampled_image, generic_image_type, // struct-only + | ^^^^^^^^^^^^^ + +error: attribute is only valid on a struct, not on a inherent implementation block + --> $DIR/invalid-target.rs:176:36 + | +176 | sampler, block, sampled_image, generic_image_type, // struct-only + | ^^^^^^^^^^^^^^^^^^ + +error: attribute is only valid on a function, not on a inherent implementation block + --> $DIR/invalid-target.rs:177:5 + | +177 | vertex, // fn-only + | ^^^^^^ + +error: attribute is only valid on a function parameter, not on a inherent implementation block + --> $DIR/invalid-target.rs:178:5 + | +178 | 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 + --> $DIR/invalid-target.rs:178:14 + | +178 | 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 + --> $DIR/invalid-target.rs:178:24 + | +178 | 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 + --> $DIR/invalid-target.rs:178:44 + | +178 | 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 + --> $DIR/invalid-target.rs:178:57 + | +178 | 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 + --> $DIR/invalid-target.rs:178:63 + | +178 | uniform, position, descriptor_set = 0, binding = 0, flat, invariant, // param-only + | ^^^^^^^^^ error: attribute is only valid on a struct, not on a trait alias - --> $DIR/invalid-target.rs:196:5 - | -LL | sampler, block, sampled_image, generic_image_type, // struct-only - | ^^^^^^^ + --> $DIR/invalid-target.rs:196:5 + | +196 | sampler, block, sampled_image, generic_image_type, // struct-only + | ^^^^^^^ error: attribute is only valid on a struct, not on a trait alias - --> $DIR/invalid-target.rs:196:14 - | -LL | sampler, block, sampled_image, generic_image_type, // struct-only - | ^^^^^ + --> $DIR/invalid-target.rs:196:14 + | +196 | sampler, block, sampled_image, generic_image_type, // struct-only + | ^^^^^ error: attribute is only valid on a struct, not on a trait alias - --> $DIR/invalid-target.rs:196:21 - | -LL | sampler, block, sampled_image, generic_image_type, // struct-only - | ^^^^^^^^^^^^^ + --> $DIR/invalid-target.rs:196:21 + | +196 | sampler, block, sampled_image, generic_image_type, // struct-only + | ^^^^^^^^^^^^^ error: attribute is only valid on a struct, not on a trait alias - --> $DIR/invalid-target.rs:196:36 - | -LL | sampler, block, sampled_image, generic_image_type, // struct-only - | ^^^^^^^^^^^^^^^^^^ + --> $DIR/invalid-target.rs:196:36 + | +196 | sampler, block, sampled_image, generic_image_type, // struct-only + | ^^^^^^^^^^^^^^^^^^ error: attribute is only valid on a function, not on a trait alias - --> $DIR/invalid-target.rs:197:5 - | -LL | vertex, // fn-only - | ^^^^^^ + --> $DIR/invalid-target.rs:197:5 + | +197 | vertex, // fn-only + | ^^^^^^ error: attribute is only valid on a function parameter, not on a trait alias - --> $DIR/invalid-target.rs:198:5 - | -LL | uniform, position, descriptor_set = 0, binding = 0, flat, invariant, // param-only - | ^^^^^^^ + --> $DIR/invalid-target.rs:198:5 + | +198 | uniform, position, descriptor_set = 0, binding = 0, flat, invariant, // param-only + | ^^^^^^^ error: attribute is only valid on a function parameter, not on a trait alias - --> $DIR/invalid-target.rs:198:14 - | -LL | uniform, position, descriptor_set = 0, binding = 0, flat, invariant, // param-only - | ^^^^^^^^ + --> $DIR/invalid-target.rs:198:14 + | +198 | uniform, position, descriptor_set = 0, binding = 0, flat, invariant, // param-only + | ^^^^^^^^ error: attribute is only valid on a function parameter, not on a trait alias - --> $DIR/invalid-target.rs:198:24 - | -LL | uniform, position, descriptor_set = 0, binding = 0, flat, invariant, // param-only - | ^^^^^^^^^^^^^^^^^^ + --> $DIR/invalid-target.rs:198:24 + | +198 | uniform, position, descriptor_set = 0, binding = 0, flat, invariant, // param-only + | ^^^^^^^^^^^^^^^^^^ error: attribute is only valid on a function parameter, not on a trait alias - --> $DIR/invalid-target.rs:198:44 - | -LL | uniform, position, descriptor_set = 0, binding = 0, flat, invariant, // param-only - | ^^^^^^^^^^^ + --> $DIR/invalid-target.rs:198:44 + | +198 | uniform, position, descriptor_set = 0, binding = 0, flat, invariant, // param-only + | ^^^^^^^^^^^ error: attribute is only valid on a function parameter, not on a trait alias - --> $DIR/invalid-target.rs:198:57 - | -LL | uniform, position, descriptor_set = 0, binding = 0, flat, invariant, // param-only - | ^^^^ + --> $DIR/invalid-target.rs:198:57 + | +198 | uniform, position, descriptor_set = 0, binding = 0, flat, invariant, // param-only + | ^^^^ error: attribute is only valid on a function parameter, not on a trait alias - --> $DIR/invalid-target.rs:198:63 - | -LL | uniform, position, descriptor_set = 0, binding = 0, flat, invariant, // param-only - | ^^^^^^^^^ + --> $DIR/invalid-target.rs:198:63 + | +198 | uniform, position, descriptor_set = 0, binding = 0, flat, invariant, // param-only + | ^^^^^^^^^ error: attribute is only valid on a struct, not on a trait - --> $DIR/invalid-target.rs:203:5 - | -LL | sampler, block, sampled_image, generic_image_type, // struct-only - | ^^^^^^^ + --> $DIR/invalid-target.rs:203:5 + | +203 | sampler, block, sampled_image, generic_image_type, // struct-only + | ^^^^^^^ error: attribute is only valid on a struct, not on a trait - --> $DIR/invalid-target.rs:203:14 - | -LL | sampler, block, sampled_image, generic_image_type, // struct-only - | ^^^^^ + --> $DIR/invalid-target.rs:203:14 + | +203 | sampler, block, sampled_image, generic_image_type, // struct-only + | ^^^^^ error: attribute is only valid on a struct, not on a trait - --> $DIR/invalid-target.rs:203:21 - | -LL | sampler, block, sampled_image, generic_image_type, // struct-only - | ^^^^^^^^^^^^^ + --> $DIR/invalid-target.rs:203:21 + | +203 | sampler, block, sampled_image, generic_image_type, // struct-only + | ^^^^^^^^^^^^^ error: attribute is only valid on a struct, not on a trait - --> $DIR/invalid-target.rs:203:36 - | -LL | sampler, block, sampled_image, generic_image_type, // struct-only - | ^^^^^^^^^^^^^^^^^^ + --> $DIR/invalid-target.rs:203:36 + | +203 | sampler, block, sampled_image, generic_image_type, // struct-only + | ^^^^^^^^^^^^^^^^^^ error: attribute is only valid on a function, not on a trait - --> $DIR/invalid-target.rs:204:5 - | -LL | vertex, // fn-only - | ^^^^^^ + --> $DIR/invalid-target.rs:204:5 + | +204 | vertex, // fn-only + | ^^^^^^ error: attribute is only valid on a function parameter, not on a trait - --> $DIR/invalid-target.rs:205:5 - | -LL | uniform, position, descriptor_set = 0, binding = 0, flat, invariant, // param-only - | ^^^^^^^ + --> $DIR/invalid-target.rs:205:5 + | +205 | uniform, position, descriptor_set = 0, binding = 0, flat, invariant, // param-only + | ^^^^^^^ error: attribute is only valid on a function parameter, not on a trait - --> $DIR/invalid-target.rs:205:14 - | -LL | uniform, position, descriptor_set = 0, binding = 0, flat, invariant, // param-only - | ^^^^^^^^ + --> $DIR/invalid-target.rs:205:14 + | +205 | uniform, position, descriptor_set = 0, binding = 0, flat, invariant, // param-only + | ^^^^^^^^ error: attribute is only valid on a function parameter, not on a trait - --> $DIR/invalid-target.rs:205:24 - | -LL | uniform, position, descriptor_set = 0, binding = 0, flat, invariant, // param-only - | ^^^^^^^^^^^^^^^^^^ + --> $DIR/invalid-target.rs:205:24 + | +205 | uniform, position, descriptor_set = 0, binding = 0, flat, invariant, // param-only + | ^^^^^^^^^^^^^^^^^^ error: attribute is only valid on a function parameter, not on a trait - --> $DIR/invalid-target.rs:205:44 - | -LL | uniform, position, descriptor_set = 0, binding = 0, flat, invariant, // param-only - | ^^^^^^^^^^^ + --> $DIR/invalid-target.rs:205:44 + | +205 | uniform, position, descriptor_set = 0, binding = 0, flat, invariant, // param-only + | ^^^^^^^^^^^ error: attribute is only valid on a function parameter, not on a trait - --> $DIR/invalid-target.rs:205:57 - | -LL | uniform, position, descriptor_set = 0, binding = 0, flat, invariant, // param-only - | ^^^^ + --> $DIR/invalid-target.rs:205:57 + | +205 | uniform, position, descriptor_set = 0, binding = 0, flat, invariant, // param-only + | ^^^^ error: attribute is only valid on a function parameter, not on a trait - --> $DIR/invalid-target.rs:205:63 - | -LL | uniform, position, descriptor_set = 0, binding = 0, flat, invariant, // param-only - | ^^^^^^^^^ - -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 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 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 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 implementation block - --> $DIR/invalid-target.rs:238:5 - | -LL | vertex, // fn-only - | ^^^^^^ - -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 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 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 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 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 implementation block - --> $DIR/invalid-target.rs:239:63 - | -LL | uniform, position, descriptor_set = 0, binding = 0, flat, invariant, // param-only - | ^^^^^^^^^ + --> $DIR/invalid-target.rs:205:63 + | +205 | 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 + --> $DIR/invalid-target.rs:237:5 + | +237 | sampler, block, sampled_image, generic_image_type, // struct-only + | ^^^^^^^ + +error: attribute is only valid on a struct, not on a trait implementation block + --> $DIR/invalid-target.rs:237:14 + | +237 | sampler, block, sampled_image, generic_image_type, // struct-only + | ^^^^^ + +error: attribute is only valid on a struct, not on a trait implementation block + --> $DIR/invalid-target.rs:237:21 + | +237 | sampler, block, sampled_image, generic_image_type, // struct-only + | ^^^^^^^^^^^^^ + +error: attribute is only valid on a struct, not on a trait implementation block + --> $DIR/invalid-target.rs:237:36 + | +237 | sampler, block, sampled_image, generic_image_type, // struct-only + | ^^^^^^^^^^^^^^^^^^ + +error: attribute is only valid on a function, not on a trait implementation block + --> $DIR/invalid-target.rs:238:5 + | +238 | vertex, // fn-only + | ^^^^^^ + +error: attribute is only valid on a function parameter, not on a trait implementation block + --> $DIR/invalid-target.rs:239:5 + | +239 | 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 + --> $DIR/invalid-target.rs:239:14 + | +239 | 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 + --> $DIR/invalid-target.rs:239:24 + | +239 | 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 + --> $DIR/invalid-target.rs:239:44 + | +239 | 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 + --> $DIR/invalid-target.rs:239:57 + | +239 | 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 + --> $DIR/invalid-target.rs:239:63 + | +239 | uniform, position, descriptor_set = 0, binding = 0, flat, invariant, // param-only + | ^^^^^^^^^ error: attribute is only valid on a struct, not on a function - --> $DIR/invalid-target.rs:264:5 - | -LL | sampler, block, sampled_image, generic_image_type, // struct-only - | ^^^^^^^ + --> $DIR/invalid-target.rs:264:5 + | +264 | sampler, block, sampled_image, generic_image_type, // struct-only + | ^^^^^^^ error: attribute is only valid on a struct, not on a function - --> $DIR/invalid-target.rs:264:14 - | -LL | sampler, block, sampled_image, generic_image_type, // struct-only - | ^^^^^ + --> $DIR/invalid-target.rs:264:14 + | +264 | sampler, block, sampled_image, generic_image_type, // struct-only + | ^^^^^ error: attribute is only valid on a struct, not on a function - --> $DIR/invalid-target.rs:264:21 - | -LL | sampler, block, sampled_image, generic_image_type, // struct-only - | ^^^^^^^^^^^^^ + --> $DIR/invalid-target.rs:264:21 + | +264 | sampler, block, sampled_image, generic_image_type, // struct-only + | ^^^^^^^^^^^^^ error: attribute is only valid on a struct, not on a function - --> $DIR/invalid-target.rs:264:36 - | -LL | sampler, block, sampled_image, generic_image_type, // struct-only - | ^^^^^^^^^^^^^^^^^^ + --> $DIR/invalid-target.rs:264:36 + | +264 | sampler, block, sampled_image, generic_image_type, // struct-only + | ^^^^^^^^^^^^^^^^^^ error: attribute is only valid on a function parameter, not on a function - --> $DIR/invalid-target.rs:265:5 - | -LL | uniform, position, descriptor_set = 0, binding = 0, flat, invariant, // param-only - | ^^^^^^^ + --> $DIR/invalid-target.rs:265:5 + | +265 | uniform, position, descriptor_set = 0, binding = 0, flat, invariant, // param-only + | ^^^^^^^ error: attribute is only valid on a function parameter, not on a function - --> $DIR/invalid-target.rs:265:14 - | -LL | uniform, position, descriptor_set = 0, binding = 0, flat, invariant, // param-only - | ^^^^^^^^ + --> $DIR/invalid-target.rs:265:14 + | +265 | uniform, position, descriptor_set = 0, binding = 0, flat, invariant, // param-only + | ^^^^^^^^ error: attribute is only valid on a function parameter, not on a function - --> $DIR/invalid-target.rs:265:24 - | -LL | uniform, position, descriptor_set = 0, binding = 0, flat, invariant, // param-only - | ^^^^^^^^^^^^^^^^^^ + --> $DIR/invalid-target.rs:265:24 + | +265 | uniform, position, descriptor_set = 0, binding = 0, flat, invariant, // param-only + | ^^^^^^^^^^^^^^^^^^ error: attribute is only valid on a function parameter, not on a function - --> $DIR/invalid-target.rs:265:44 - | -LL | uniform, position, descriptor_set = 0, binding = 0, flat, invariant, // param-only - | ^^^^^^^^^^^ + --> $DIR/invalid-target.rs:265:44 + | +265 | uniform, position, descriptor_set = 0, binding = 0, flat, invariant, // param-only + | ^^^^^^^^^^^ error: attribute is only valid on a function parameter, not on a function - --> $DIR/invalid-target.rs:265:57 - | -LL | uniform, position, descriptor_set = 0, binding = 0, flat, invariant, // param-only - | ^^^^ + --> $DIR/invalid-target.rs:265:57 + | +265 | uniform, position, descriptor_set = 0, binding = 0, flat, invariant, // param-only + | ^^^^ error: attribute is only valid on a function parameter, not on a function - --> $DIR/invalid-target.rs:265:63 - | -LL | uniform, position, descriptor_set = 0, binding = 0, flat, invariant, // param-only - | ^^^^^^^^^ + --> $DIR/invalid-target.rs:265:63 + | +265 | uniform, position, descriptor_set = 0, binding = 0, flat, invariant, // param-only + | ^^^^^^^^^ error: attribute is only valid on a struct, not on a function param - --> $DIR/invalid-target.rs:269:9 - | -LL | sampler, block, sampled_image, generic_image_type, // struct-only - | ^^^^^^^ + --> $DIR/invalid-target.rs:269:9 + | +269 | sampler, block, sampled_image, generic_image_type, // struct-only + | ^^^^^^^ error: attribute is only valid on a struct, not on a function param - --> $DIR/invalid-target.rs:269:18 - | -LL | sampler, block, sampled_image, generic_image_type, // struct-only - | ^^^^^ + --> $DIR/invalid-target.rs:269:18 + | +269 | sampler, block, sampled_image, generic_image_type, // struct-only + | ^^^^^ error: attribute is only valid on a struct, not on a function param - --> $DIR/invalid-target.rs:269:25 - | -LL | sampler, block, sampled_image, generic_image_type, // struct-only - | ^^^^^^^^^^^^^ + --> $DIR/invalid-target.rs:269:25 + | +269 | sampler, block, sampled_image, generic_image_type, // struct-only + | ^^^^^^^^^^^^^ error: attribute is only valid on a struct, not on a function param - --> $DIR/invalid-target.rs:269:40 - | -LL | sampler, block, sampled_image, generic_image_type, // struct-only - | ^^^^^^^^^^^^^^^^^^ + --> $DIR/invalid-target.rs:269:40 + | +269 | sampler, block, sampled_image, generic_image_type, // struct-only + | ^^^^^^^^^^^^^^^^^^ error: attribute is only valid on a function, not on a function param - --> $DIR/invalid-target.rs:270:9 - | -LL | vertex, // fn-only - | ^^^^^^ + --> $DIR/invalid-target.rs:270:9 + | +270 | vertex, // fn-only + | ^^^^^^ error: attribute is only valid on a struct, not on a statement - --> $DIR/invalid-target.rs:275:9 - | -LL | sampler, block, sampled_image, generic_image_type, // struct-only - | ^^^^^^^ + --> $DIR/invalid-target.rs:275:9 + | +275 | sampler, block, sampled_image, generic_image_type, // struct-only + | ^^^^^^^ error: attribute is only valid on a struct, not on a statement - --> $DIR/invalid-target.rs:275:18 - | -LL | sampler, block, sampled_image, generic_image_type, // struct-only - | ^^^^^ + --> $DIR/invalid-target.rs:275:18 + | +275 | sampler, block, sampled_image, generic_image_type, // struct-only + | ^^^^^ error: attribute is only valid on a struct, not on a statement - --> $DIR/invalid-target.rs:275:25 - | -LL | sampler, block, sampled_image, generic_image_type, // struct-only - | ^^^^^^^^^^^^^ + --> $DIR/invalid-target.rs:275:25 + | +275 | sampler, block, sampled_image, generic_image_type, // struct-only + | ^^^^^^^^^^^^^ error: attribute is only valid on a struct, not on a statement - --> $DIR/invalid-target.rs:275:40 - | -LL | sampler, block, sampled_image, generic_image_type, // struct-only - | ^^^^^^^^^^^^^^^^^^ + --> $DIR/invalid-target.rs:275:40 + | +275 | sampler, block, sampled_image, generic_image_type, // struct-only + | ^^^^^^^^^^^^^^^^^^ error: attribute is only valid on a function, not on a statement - --> $DIR/invalid-target.rs:276:9 - | -LL | vertex, // fn-only - | ^^^^^^ + --> $DIR/invalid-target.rs:276:9 + | +276 | vertex, // fn-only + | ^^^^^^ error: attribute is only valid on a function parameter, not on a statement - --> $DIR/invalid-target.rs:277:9 - | -LL | uniform, position, descriptor_set = 0, binding = 0, flat, invariant, // param-only - | ^^^^^^^ + --> $DIR/invalid-target.rs:277:9 + | +277 | uniform, position, descriptor_set = 0, binding = 0, flat, invariant, // param-only + | ^^^^^^^ error: attribute is only valid on a function parameter, not on a statement - --> $DIR/invalid-target.rs:277:18 - | -LL | uniform, position, descriptor_set = 0, binding = 0, flat, invariant, // param-only - | ^^^^^^^^ + --> $DIR/invalid-target.rs:277:18 + | +277 | uniform, position, descriptor_set = 0, binding = 0, flat, invariant, // param-only + | ^^^^^^^^ error: attribute is only valid on a function parameter, not on a statement - --> $DIR/invalid-target.rs:277:28 - | -LL | uniform, position, descriptor_set = 0, binding = 0, flat, invariant, // param-only - | ^^^^^^^^^^^^^^^^^^ + --> $DIR/invalid-target.rs:277:28 + | +277 | uniform, position, descriptor_set = 0, binding = 0, flat, invariant, // param-only + | ^^^^^^^^^^^^^^^^^^ error: attribute is only valid on a function parameter, not on a statement - --> $DIR/invalid-target.rs:277:48 - | -LL | uniform, position, descriptor_set = 0, binding = 0, flat, invariant, // param-only - | ^^^^^^^^^^^ + --> $DIR/invalid-target.rs:277:48 + | +277 | uniform, position, descriptor_set = 0, binding = 0, flat, invariant, // param-only + | ^^^^^^^^^^^ error: attribute is only valid on a function parameter, not on a statement - --> $DIR/invalid-target.rs:277:61 - | -LL | uniform, position, descriptor_set = 0, binding = 0, flat, invariant, // param-only - | ^^^^ + --> $DIR/invalid-target.rs:277:61 + | +277 | uniform, position, descriptor_set = 0, binding = 0, flat, invariant, // param-only + | ^^^^ error: attribute is only valid on a function parameter, not on a statement - --> $DIR/invalid-target.rs:277:67 - | -LL | uniform, position, descriptor_set = 0, binding = 0, flat, invariant, // param-only - | ^^^^^^^^^ + --> $DIR/invalid-target.rs:277:67 + | +277 | uniform, position, descriptor_set = 0, binding = 0, flat, invariant, // param-only + | ^^^^^^^^^ error: attribute is only valid on a struct, not on a closure - --> $DIR/invalid-target.rs:282:13 - | -LL | sampler, block, sampled_image, generic_image_type, // struct-only - | ^^^^^^^ + --> $DIR/invalid-target.rs:282:13 + | +282 | sampler, block, sampled_image, generic_image_type, // struct-only + | ^^^^^^^ error: attribute is only valid on a struct, not on a closure - --> $DIR/invalid-target.rs:282:22 - | -LL | sampler, block, sampled_image, generic_image_type, // struct-only - | ^^^^^ + --> $DIR/invalid-target.rs:282:22 + | +282 | sampler, block, sampled_image, generic_image_type, // struct-only + | ^^^^^ error: attribute is only valid on a struct, not on a closure - --> $DIR/invalid-target.rs:282:29 - | -LL | sampler, block, sampled_image, generic_image_type, // struct-only - | ^^^^^^^^^^^^^ + --> $DIR/invalid-target.rs:282:29 + | +282 | sampler, block, sampled_image, generic_image_type, // struct-only + | ^^^^^^^^^^^^^ error: attribute is only valid on a struct, not on a closure - --> $DIR/invalid-target.rs:282:44 - | -LL | sampler, block, sampled_image, generic_image_type, // struct-only - | ^^^^^^^^^^^^^^^^^^ + --> $DIR/invalid-target.rs:282:44 + | +282 | sampler, block, sampled_image, generic_image_type, // struct-only + | ^^^^^^^^^^^^^^^^^^ error: attribute is only valid on a function, not on a closure - --> $DIR/invalid-target.rs:283:13 - | -LL | vertex, // fn-only - | ^^^^^^ + --> $DIR/invalid-target.rs:283:13 + | +283 | vertex, // fn-only + | ^^^^^^ error: attribute is only valid on a function parameter, not on a closure - --> $DIR/invalid-target.rs:284:13 - | -LL | uniform, position, descriptor_set = 0, binding = 0, flat, invariant, // param-only - | ^^^^^^^ + --> $DIR/invalid-target.rs:284:13 + | +284 | uniform, position, descriptor_set = 0, binding = 0, flat, invariant, // param-only + | ^^^^^^^ error: attribute is only valid on a function parameter, not on a closure - --> $DIR/invalid-target.rs:284:22 - | -LL | uniform, position, descriptor_set = 0, binding = 0, flat, invariant, // param-only - | ^^^^^^^^ + --> $DIR/invalid-target.rs:284:22 + | +284 | uniform, position, descriptor_set = 0, binding = 0, flat, invariant, // param-only + | ^^^^^^^^ error: attribute is only valid on a function parameter, not on a closure - --> $DIR/invalid-target.rs:284:32 - | -LL | uniform, position, descriptor_set = 0, binding = 0, flat, invariant, // param-only - | ^^^^^^^^^^^^^^^^^^ + --> $DIR/invalid-target.rs:284:32 + | +284 | uniform, position, descriptor_set = 0, binding = 0, flat, invariant, // param-only + | ^^^^^^^^^^^^^^^^^^ error: attribute is only valid on a function parameter, not on a closure - --> $DIR/invalid-target.rs:284:52 - | -LL | uniform, position, descriptor_set = 0, binding = 0, flat, invariant, // param-only - | ^^^^^^^^^^^ + --> $DIR/invalid-target.rs:284:52 + | +284 | uniform, position, descriptor_set = 0, binding = 0, flat, invariant, // param-only + | ^^^^^^^^^^^ error: attribute is only valid on a function parameter, not on a closure - --> $DIR/invalid-target.rs:284:65 - | -LL | uniform, position, descriptor_set = 0, binding = 0, flat, invariant, // param-only - | ^^^^ + --> $DIR/invalid-target.rs:284:65 + | +284 | uniform, position, descriptor_set = 0, binding = 0, flat, invariant, // param-only + | ^^^^ error: attribute is only valid on a function parameter, not on a closure - --> $DIR/invalid-target.rs:284:71 - | -LL | uniform, position, descriptor_set = 0, binding = 0, flat, invariant, // param-only - | ^^^^^^^^^ + --> $DIR/invalid-target.rs:284:71 + | +284 | uniform, position, descriptor_set = 0, binding = 0, flat, invariant, // param-only + | ^^^^^^^^^ error: attribute is only valid on a struct, not on a expression - --> $DIR/invalid-target.rs:290:13 - | -LL | sampler, block, sampled_image, generic_image_type, // struct-only - | ^^^^^^^ + --> $DIR/invalid-target.rs:290:13 + | +290 | sampler, block, sampled_image, generic_image_type, // struct-only + | ^^^^^^^ error: attribute is only valid on a struct, not on a expression - --> $DIR/invalid-target.rs:290:22 - | -LL | sampler, block, sampled_image, generic_image_type, // struct-only - | ^^^^^ + --> $DIR/invalid-target.rs:290:22 + | +290 | sampler, block, sampled_image, generic_image_type, // struct-only + | ^^^^^ error: attribute is only valid on a struct, not on a expression - --> $DIR/invalid-target.rs:290:29 - | -LL | sampler, block, sampled_image, generic_image_type, // struct-only - | ^^^^^^^^^^^^^ + --> $DIR/invalid-target.rs:290:29 + | +290 | sampler, block, sampled_image, generic_image_type, // struct-only + | ^^^^^^^^^^^^^ error: attribute is only valid on a struct, not on a expression - --> $DIR/invalid-target.rs:290:44 - | -LL | sampler, block, sampled_image, generic_image_type, // struct-only - | ^^^^^^^^^^^^^^^^^^ + --> $DIR/invalid-target.rs:290:44 + | +290 | sampler, block, sampled_image, generic_image_type, // struct-only + | ^^^^^^^^^^^^^^^^^^ error: attribute is only valid on a function, not on a expression - --> $DIR/invalid-target.rs:291:13 - | -LL | vertex, // fn-only - | ^^^^^^ + --> $DIR/invalid-target.rs:291:13 + | +291 | vertex, // fn-only + | ^^^^^^ error: attribute is only valid on a function parameter, not on a expression - --> $DIR/invalid-target.rs:292:13 - | -LL | uniform, position, descriptor_set = 0, binding = 0, flat, invariant, // param-only - | ^^^^^^^ + --> $DIR/invalid-target.rs:292:13 + | +292 | uniform, position, descriptor_set = 0, binding = 0, flat, invariant, // param-only + | ^^^^^^^ error: attribute is only valid on a function parameter, not on a expression - --> $DIR/invalid-target.rs:292:22 - | -LL | uniform, position, descriptor_set = 0, binding = 0, flat, invariant, // param-only - | ^^^^^^^^ + --> $DIR/invalid-target.rs:292:22 + | +292 | uniform, position, descriptor_set = 0, binding = 0, flat, invariant, // param-only + | ^^^^^^^^ error: attribute is only valid on a function parameter, not on a expression - --> $DIR/invalid-target.rs:292:32 - | -LL | uniform, position, descriptor_set = 0, binding = 0, flat, invariant, // param-only - | ^^^^^^^^^^^^^^^^^^ + --> $DIR/invalid-target.rs:292:32 + | +292 | uniform, position, descriptor_set = 0, binding = 0, flat, invariant, // param-only + | ^^^^^^^^^^^^^^^^^^ error: attribute is only valid on a function parameter, not on a expression - --> $DIR/invalid-target.rs:292:52 - | -LL | uniform, position, descriptor_set = 0, binding = 0, flat, invariant, // param-only - | ^^^^^^^^^^^ + --> $DIR/invalid-target.rs:292:52 + | +292 | uniform, position, descriptor_set = 0, binding = 0, flat, invariant, // param-only + | ^^^^^^^^^^^ error: attribute is only valid on a function parameter, not on a expression - --> $DIR/invalid-target.rs:292:65 - | -LL | uniform, position, descriptor_set = 0, binding = 0, flat, invariant, // param-only - | ^^^^ + --> $DIR/invalid-target.rs:292:65 + | +292 | uniform, position, descriptor_set = 0, binding = 0, flat, invariant, // param-only + | ^^^^ error: attribute is only valid on a function parameter, not on a expression - --> $DIR/invalid-target.rs:292:71 - | -LL | uniform, position, descriptor_set = 0, binding = 0, flat, invariant, // param-only - | ^^^^^^^^^ + --> $DIR/invalid-target.rs:292:71 + | +292 | uniform, position, descriptor_set = 0, binding = 0, flat, invariant, // param-only + | ^^^^^^^^^ error: attribute is only valid on a struct, not on a match arm - --> $DIR/invalid-target.rs:300:13 - | -LL | sampler, block, sampled_image, generic_image_type, // struct-only - | ^^^^^^^ + --> $DIR/invalid-target.rs:300:13 + | +300 | sampler, block, sampled_image, generic_image_type, // struct-only + | ^^^^^^^ error: attribute is only valid on a struct, not on a match arm - --> $DIR/invalid-target.rs:300:22 - | -LL | sampler, block, sampled_image, generic_image_type, // struct-only - | ^^^^^ + --> $DIR/invalid-target.rs:300:22 + | +300 | sampler, block, sampled_image, generic_image_type, // struct-only + | ^^^^^ error: attribute is only valid on a struct, not on a match arm - --> $DIR/invalid-target.rs:300:29 - | -LL | sampler, block, sampled_image, generic_image_type, // struct-only - | ^^^^^^^^^^^^^ + --> $DIR/invalid-target.rs:300:29 + | +300 | sampler, block, sampled_image, generic_image_type, // struct-only + | ^^^^^^^^^^^^^ error: attribute is only valid on a struct, not on a match arm - --> $DIR/invalid-target.rs:300:44 - | -LL | sampler, block, sampled_image, generic_image_type, // struct-only - | ^^^^^^^^^^^^^^^^^^ + --> $DIR/invalid-target.rs:300:44 + | +300 | sampler, block, sampled_image, generic_image_type, // struct-only + | ^^^^^^^^^^^^^^^^^^ error: attribute is only valid on a function, not on a match arm - --> $DIR/invalid-target.rs:301:13 - | -LL | vertex, // fn-only - | ^^^^^^ + --> $DIR/invalid-target.rs:301:13 + | +301 | vertex, // fn-only + | ^^^^^^ error: attribute is only valid on a function parameter, not on a match arm - --> $DIR/invalid-target.rs:302:13 - | -LL | uniform, position, descriptor_set = 0, binding = 0, flat, invariant, // param-only - | ^^^^^^^ + --> $DIR/invalid-target.rs:302:13 + | +302 | uniform, position, descriptor_set = 0, binding = 0, flat, invariant, // param-only + | ^^^^^^^ error: attribute is only valid on a function parameter, not on a match arm - --> $DIR/invalid-target.rs:302:22 - | -LL | uniform, position, descriptor_set = 0, binding = 0, flat, invariant, // param-only - | ^^^^^^^^ + --> $DIR/invalid-target.rs:302:22 + | +302 | uniform, position, descriptor_set = 0, binding = 0, flat, invariant, // param-only + | ^^^^^^^^ error: attribute is only valid on a function parameter, not on a match arm - --> $DIR/invalid-target.rs:302:32 - | -LL | uniform, position, descriptor_set = 0, binding = 0, flat, invariant, // param-only - | ^^^^^^^^^^^^^^^^^^ + --> $DIR/invalid-target.rs:302:32 + | +302 | uniform, position, descriptor_set = 0, binding = 0, flat, invariant, // param-only + | ^^^^^^^^^^^^^^^^^^ error: attribute is only valid on a function parameter, not on a match arm - --> $DIR/invalid-target.rs:302:52 - | -LL | uniform, position, descriptor_set = 0, binding = 0, flat, invariant, // param-only - | ^^^^^^^^^^^ + --> $DIR/invalid-target.rs:302:52 + | +302 | uniform, position, descriptor_set = 0, binding = 0, flat, invariant, // param-only + | ^^^^^^^^^^^ error: attribute is only valid on a function parameter, not on a match arm - --> $DIR/invalid-target.rs:302:65 - | -LL | uniform, position, descriptor_set = 0, binding = 0, flat, invariant, // param-only - | ^^^^ + --> $DIR/invalid-target.rs:302:65 + | +302 | uniform, position, descriptor_set = 0, binding = 0, flat, invariant, // param-only + | ^^^^ error: attribute is only valid on a function parameter, not on a match arm - --> $DIR/invalid-target.rs:302:71 - | -LL | uniform, position, descriptor_set = 0, binding = 0, flat, invariant, // param-only - | ^^^^^^^^^ + --> $DIR/invalid-target.rs:302:71 + | +302 | uniform, position, descriptor_set = 0, binding = 0, flat, invariant, // param-only + | ^^^^^^^^^ error: attribute is only valid on a struct, not on a lifetime parameter - --> $DIR/invalid-target.rs:311:9 - | -LL | sampler, block, sampled_image, generic_image_type, // struct-only - | ^^^^^^^ + --> $DIR/invalid-target.rs:311:9 + | +311 | sampler, block, sampled_image, generic_image_type, // struct-only + | ^^^^^^^ error: attribute is only valid on a struct, not on a lifetime parameter - --> $DIR/invalid-target.rs:311:18 - | -LL | sampler, block, sampled_image, generic_image_type, // struct-only - | ^^^^^ + --> $DIR/invalid-target.rs:311:18 + | +311 | sampler, block, sampled_image, generic_image_type, // struct-only + | ^^^^^ -error: attribute is only valid on a struct, not on a lifetime parameter - --> $DIR/invalid-target.rs:311:25 - | -LL | sampler, block, sampled_image, generic_image_type, // struct-only - | ^^^^^^^^^^^^^ +error: attribute is only valid on a struct, not on a lifetime parameter + --> $DIR/invalid-target.rs:311:25 + | +311 | sampler, block, sampled_image, generic_image_type, // struct-only + | ^^^^^^^^^^^^^ error: attribute is only valid on a struct, not on a lifetime parameter - --> $DIR/invalid-target.rs:311:40 - | -LL | sampler, block, sampled_image, generic_image_type, // struct-only - | ^^^^^^^^^^^^^^^^^^ + --> $DIR/invalid-target.rs:311:40 + | +311 | sampler, block, sampled_image, generic_image_type, // struct-only + | ^^^^^^^^^^^^^^^^^^ error: attribute is only valid on a function, not on a lifetime parameter - --> $DIR/invalid-target.rs:312:9 - | -LL | vertex, // fn-only - | ^^^^^^ + --> $DIR/invalid-target.rs:312:9 + | +312 | vertex, // fn-only + | ^^^^^^ error: attribute is only valid on a function parameter, not on a lifetime parameter - --> $DIR/invalid-target.rs:313:9 - | -LL | uniform, position, descriptor_set = 0, binding = 0, flat, invariant, // param-only - | ^^^^^^^ + --> $DIR/invalid-target.rs:313:9 + | +313 | uniform, position, descriptor_set = 0, binding = 0, flat, invariant, // param-only + | ^^^^^^^ error: attribute is only valid on a function parameter, not on a lifetime parameter - --> $DIR/invalid-target.rs:313:18 - | -LL | uniform, position, descriptor_set = 0, binding = 0, flat, invariant, // param-only - | ^^^^^^^^ + --> $DIR/invalid-target.rs:313:18 + | +313 | uniform, position, descriptor_set = 0, binding = 0, flat, invariant, // param-only + | ^^^^^^^^ error: attribute is only valid on a function parameter, not on a lifetime parameter - --> $DIR/invalid-target.rs:313:28 - | -LL | uniform, position, descriptor_set = 0, binding = 0, flat, invariant, // param-only - | ^^^^^^^^^^^^^^^^^^ + --> $DIR/invalid-target.rs:313:28 + | +313 | uniform, position, descriptor_set = 0, binding = 0, flat, invariant, // param-only + | ^^^^^^^^^^^^^^^^^^ error: attribute is only valid on a function parameter, not on a lifetime parameter - --> $DIR/invalid-target.rs:313:48 - | -LL | uniform, position, descriptor_set = 0, binding = 0, flat, invariant, // param-only - | ^^^^^^^^^^^ + --> $DIR/invalid-target.rs:313:48 + | +313 | uniform, position, descriptor_set = 0, binding = 0, flat, invariant, // param-only + | ^^^^^^^^^^^ error: attribute is only valid on a function parameter, not on a lifetime parameter - --> $DIR/invalid-target.rs:313:61 - | -LL | uniform, position, descriptor_set = 0, binding = 0, flat, invariant, // param-only - | ^^^^ + --> $DIR/invalid-target.rs:313:61 + | +313 | uniform, position, descriptor_set = 0, binding = 0, flat, invariant, // param-only + | ^^^^ error: attribute is only valid on a function parameter, not on a lifetime parameter - --> $DIR/invalid-target.rs:313:67 - | -LL | uniform, position, descriptor_set = 0, binding = 0, flat, invariant, // param-only - | ^^^^^^^^^ + --> $DIR/invalid-target.rs:313:67 + | +313 | uniform, position, descriptor_set = 0, binding = 0, flat, invariant, // param-only + | ^^^^^^^^^ error: attribute is only valid on a struct, not on a type parameter - --> $DIR/invalid-target.rs:316:9 - | -LL | sampler, block, sampled_image, generic_image_type, // struct-only - | ^^^^^^^ + --> $DIR/invalid-target.rs:316:9 + | +316 | sampler, block, sampled_image, generic_image_type, // struct-only + | ^^^^^^^ error: attribute is only valid on a struct, not on a type parameter - --> $DIR/invalid-target.rs:316:18 - | -LL | sampler, block, sampled_image, generic_image_type, // struct-only - | ^^^^^ + --> $DIR/invalid-target.rs:316:18 + | +316 | sampler, block, sampled_image, generic_image_type, // struct-only + | ^^^^^ error: attribute is only valid on a struct, not on a type parameter - --> $DIR/invalid-target.rs:316:25 - | -LL | sampler, block, sampled_image, generic_image_type, // struct-only - | ^^^^^^^^^^^^^ + --> $DIR/invalid-target.rs:316:25 + | +316 | sampler, block, sampled_image, generic_image_type, // struct-only + | ^^^^^^^^^^^^^ error: attribute is only valid on a struct, not on a type parameter - --> $DIR/invalid-target.rs:316:40 - | -LL | sampler, block, sampled_image, generic_image_type, // struct-only - | ^^^^^^^^^^^^^^^^^^ + --> $DIR/invalid-target.rs:316:40 + | +316 | sampler, block, sampled_image, generic_image_type, // struct-only + | ^^^^^^^^^^^^^^^^^^ error: attribute is only valid on a function, not on a type parameter - --> $DIR/invalid-target.rs:317:9 - | -LL | vertex, // fn-only - | ^^^^^^ + --> $DIR/invalid-target.rs:317:9 + | +317 | vertex, // fn-only + | ^^^^^^ error: attribute is only valid on a function parameter, not on a type parameter - --> $DIR/invalid-target.rs:318:9 - | -LL | uniform, position, descriptor_set = 0, binding = 0, flat, invariant, // param-only - | ^^^^^^^ + --> $DIR/invalid-target.rs:318:9 + | +318 | uniform, position, descriptor_set = 0, binding = 0, flat, invariant, // param-only + | ^^^^^^^ error: attribute is only valid on a function parameter, not on a type parameter - --> $DIR/invalid-target.rs:318:18 - | -LL | uniform, position, descriptor_set = 0, binding = 0, flat, invariant, // param-only - | ^^^^^^^^ + --> $DIR/invalid-target.rs:318:18 + | +318 | uniform, position, descriptor_set = 0, binding = 0, flat, invariant, // param-only + | ^^^^^^^^ error: attribute is only valid on a function parameter, not on a type parameter - --> $DIR/invalid-target.rs:318:28 - | -LL | uniform, position, descriptor_set = 0, binding = 0, flat, invariant, // param-only - | ^^^^^^^^^^^^^^^^^^ + --> $DIR/invalid-target.rs:318:28 + | +318 | uniform, position, descriptor_set = 0, binding = 0, flat, invariant, // param-only + | ^^^^^^^^^^^^^^^^^^ error: attribute is only valid on a function parameter, not on a type parameter - --> $DIR/invalid-target.rs:318:48 - | -LL | uniform, position, descriptor_set = 0, binding = 0, flat, invariant, // param-only - | ^^^^^^^^^^^ + --> $DIR/invalid-target.rs:318:48 + | +318 | uniform, position, descriptor_set = 0, binding = 0, flat, invariant, // param-only + | ^^^^^^^^^^^ error: attribute is only valid on a function parameter, not on a type parameter - --> $DIR/invalid-target.rs:318:61 - | -LL | uniform, position, descriptor_set = 0, binding = 0, flat, invariant, // param-only - | ^^^^ + --> $DIR/invalid-target.rs:318:61 + | +318 | uniform, position, descriptor_set = 0, binding = 0, flat, invariant, // param-only + | ^^^^ error: attribute is only valid on a function parameter, not on a type parameter - --> $DIR/invalid-target.rs:318:67 - | -LL | uniform, position, descriptor_set = 0, binding = 0, flat, invariant, // param-only - | ^^^^^^^^^ + --> $DIR/invalid-target.rs:318:67 + | +318 | uniform, position, descriptor_set = 0, binding = 0, flat, invariant, // param-only + | ^^^^^^^^^ error: attribute is only valid on a struct, not on a const parameter - --> $DIR/invalid-target.rs:321:9 - | -LL | sampler, block, sampled_image, generic_image_type, // struct-only - | ^^^^^^^ + --> $DIR/invalid-target.rs:321:9 + | +321 | sampler, block, sampled_image, generic_image_type, // struct-only + | ^^^^^^^ error: attribute is only valid on a struct, not on a const parameter - --> $DIR/invalid-target.rs:321:18 - | -LL | sampler, block, sampled_image, generic_image_type, // struct-only - | ^^^^^ + --> $DIR/invalid-target.rs:321:18 + | +321 | sampler, block, sampled_image, generic_image_type, // struct-only + | ^^^^^ error: attribute is only valid on a struct, not on a const parameter - --> $DIR/invalid-target.rs:321:25 - | -LL | sampler, block, sampled_image, generic_image_type, // struct-only - | ^^^^^^^^^^^^^ + --> $DIR/invalid-target.rs:321:25 + | +321 | sampler, block, sampled_image, generic_image_type, // struct-only + | ^^^^^^^^^^^^^ error: attribute is only valid on a struct, not on a const parameter - --> $DIR/invalid-target.rs:321:40 - | -LL | sampler, block, sampled_image, generic_image_type, // struct-only - | ^^^^^^^^^^^^^^^^^^ + --> $DIR/invalid-target.rs:321:40 + | +321 | sampler, block, sampled_image, generic_image_type, // struct-only + | ^^^^^^^^^^^^^^^^^^ error: attribute is only valid on a function, not on a const parameter - --> $DIR/invalid-target.rs:322:9 - | -LL | vertex, // fn-only - | ^^^^^^ + --> $DIR/invalid-target.rs:322:9 + | +322 | vertex, // fn-only + | ^^^^^^ error: attribute is only valid on a function parameter, not on a const parameter - --> $DIR/invalid-target.rs:323:9 - | -LL | uniform, position, descriptor_set = 0, binding = 0, flat, invariant, // param-only - | ^^^^^^^ + --> $DIR/invalid-target.rs:323:9 + | +323 | uniform, position, descriptor_set = 0, binding = 0, flat, invariant, // param-only + | ^^^^^^^ error: attribute is only valid on a function parameter, not on a const parameter - --> $DIR/invalid-target.rs:323:18 - | -LL | uniform, position, descriptor_set = 0, binding = 0, flat, invariant, // param-only - | ^^^^^^^^ + --> $DIR/invalid-target.rs:323:18 + | +323 | uniform, position, descriptor_set = 0, binding = 0, flat, invariant, // param-only + | ^^^^^^^^ error: attribute is only valid on a function parameter, not on a const parameter - --> $DIR/invalid-target.rs:323:28 - | -LL | uniform, position, descriptor_set = 0, binding = 0, flat, invariant, // param-only - | ^^^^^^^^^^^^^^^^^^ + --> $DIR/invalid-target.rs:323:28 + | +323 | uniform, position, descriptor_set = 0, binding = 0, flat, invariant, // param-only + | ^^^^^^^^^^^^^^^^^^ error: attribute is only valid on a function parameter, not on a const parameter - --> $DIR/invalid-target.rs:323:48 - | -LL | uniform, position, descriptor_set = 0, binding = 0, flat, invariant, // param-only - | ^^^^^^^^^^^ + --> $DIR/invalid-target.rs:323:48 + | +323 | uniform, position, descriptor_set = 0, binding = 0, flat, invariant, // param-only + | ^^^^^^^^^^^ error: attribute is only valid on a function parameter, not on a const parameter - --> $DIR/invalid-target.rs:323:61 - | -LL | uniform, position, descriptor_set = 0, binding = 0, flat, invariant, // param-only - | ^^^^ + --> $DIR/invalid-target.rs:323:61 + | +323 | uniform, position, descriptor_set = 0, binding = 0, flat, invariant, // param-only + | ^^^^ error: attribute is only valid on a function parameter, not on a const parameter - --> $DIR/invalid-target.rs:323:67 - | -LL | uniform, position, descriptor_set = 0, binding = 0, flat, invariant, // param-only - | ^^^^^^^^^ + --> $DIR/invalid-target.rs:323:67 + | +323 | uniform, position, descriptor_set = 0, binding = 0, flat, invariant, // param-only + | ^^^^^^^^^ error: attribute is only valid on a struct, not on a associated type - --> $DIR/invalid-target.rs:209:9 - | -LL | sampler, block, sampled_image, generic_image_type, // struct-only - | ^^^^^^^ + --> $DIR/invalid-target.rs:209:9 + | +209 | sampler, block, sampled_image, generic_image_type, // struct-only + | ^^^^^^^ error: attribute is only valid on a struct, not on a associated type - --> $DIR/invalid-target.rs:209:18 - | -LL | sampler, block, sampled_image, generic_image_type, // struct-only - | ^^^^^ + --> $DIR/invalid-target.rs:209:18 + | +209 | sampler, block, sampled_image, generic_image_type, // struct-only + | ^^^^^ error: attribute is only valid on a struct, not on a associated type - --> $DIR/invalid-target.rs:209:25 - | -LL | sampler, block, sampled_image, generic_image_type, // struct-only - | ^^^^^^^^^^^^^ + --> $DIR/invalid-target.rs:209:25 + | +209 | sampler, block, sampled_image, generic_image_type, // struct-only + | ^^^^^^^^^^^^^ error: attribute is only valid on a struct, not on a associated type - --> $DIR/invalid-target.rs:209:40 - | -LL | sampler, block, sampled_image, generic_image_type, // struct-only - | ^^^^^^^^^^^^^^^^^^ + --> $DIR/invalid-target.rs:209:40 + | +209 | sampler, block, sampled_image, generic_image_type, // struct-only + | ^^^^^^^^^^^^^^^^^^ error: attribute is only valid on a function, not on a associated type - --> $DIR/invalid-target.rs:210:9 - | -LL | vertex, // fn-only - | ^^^^^^ + --> $DIR/invalid-target.rs:210:9 + | +210 | vertex, // fn-only + | ^^^^^^ error: attribute is only valid on a function parameter, not on a associated type - --> $DIR/invalid-target.rs:211:9 - | -LL | uniform, position, descriptor_set = 0, binding = 0, flat, invariant, // param-only - | ^^^^^^^ + --> $DIR/invalid-target.rs:211:9 + | +211 | uniform, position, descriptor_set = 0, binding = 0, flat, invariant, // param-only + | ^^^^^^^ error: attribute is only valid on a function parameter, not on a associated type - --> $DIR/invalid-target.rs:211:18 - | -LL | uniform, position, descriptor_set = 0, binding = 0, flat, invariant, // param-only - | ^^^^^^^^ + --> $DIR/invalid-target.rs:211:18 + | +211 | uniform, position, descriptor_set = 0, binding = 0, flat, invariant, // param-only + | ^^^^^^^^ error: attribute is only valid on a function parameter, not on a associated type - --> $DIR/invalid-target.rs:211:28 - | -LL | uniform, position, descriptor_set = 0, binding = 0, flat, invariant, // param-only - | ^^^^^^^^^^^^^^^^^^ + --> $DIR/invalid-target.rs:211:28 + | +211 | uniform, position, descriptor_set = 0, binding = 0, flat, invariant, // param-only + | ^^^^^^^^^^^^^^^^^^ error: attribute is only valid on a function parameter, not on a associated type - --> $DIR/invalid-target.rs:211:48 - | -LL | uniform, position, descriptor_set = 0, binding = 0, flat, invariant, // param-only - | ^^^^^^^^^^^ + --> $DIR/invalid-target.rs:211:48 + | +211 | uniform, position, descriptor_set = 0, binding = 0, flat, invariant, // param-only + | ^^^^^^^^^^^ error: attribute is only valid on a function parameter, not on a associated type - --> $DIR/invalid-target.rs:211:61 - | -LL | uniform, position, descriptor_set = 0, binding = 0, flat, invariant, // param-only - | ^^^^ + --> $DIR/invalid-target.rs:211:61 + | +211 | uniform, position, descriptor_set = 0, binding = 0, flat, invariant, // param-only + | ^^^^ error: attribute is only valid on a function parameter, not on a associated type - --> $DIR/invalid-target.rs:211:67 - | -LL | uniform, position, descriptor_set = 0, binding = 0, flat, invariant, // param-only - | ^^^^^^^^^ + --> $DIR/invalid-target.rs:211:67 + | +211 | uniform, position, descriptor_set = 0, binding = 0, flat, invariant, // param-only + | ^^^^^^^^^ error: attribute is only valid on a struct, not on a associated const - --> $DIR/invalid-target.rs:216:9 - | -LL | sampler, block, sampled_image, generic_image_type, // struct-only - | ^^^^^^^ + --> $DIR/invalid-target.rs:216:9 + | +216 | sampler, block, sampled_image, generic_image_type, // struct-only + | ^^^^^^^ error: attribute is only valid on a struct, not on a associated const - --> $DIR/invalid-target.rs:216:18 - | -LL | sampler, block, sampled_image, generic_image_type, // struct-only - | ^^^^^ + --> $DIR/invalid-target.rs:216:18 + | +216 | sampler, block, sampled_image, generic_image_type, // struct-only + | ^^^^^ error: attribute is only valid on a struct, not on a associated const - --> $DIR/invalid-target.rs:216:25 - | -LL | sampler, block, sampled_image, generic_image_type, // struct-only - | ^^^^^^^^^^^^^ + --> $DIR/invalid-target.rs:216:25 + | +216 | sampler, block, sampled_image, generic_image_type, // struct-only + | ^^^^^^^^^^^^^ error: attribute is only valid on a struct, not on a associated const - --> $DIR/invalid-target.rs:216:40 - | -LL | sampler, block, sampled_image, generic_image_type, // struct-only - | ^^^^^^^^^^^^^^^^^^ + --> $DIR/invalid-target.rs:216:40 + | +216 | sampler, block, sampled_image, generic_image_type, // struct-only + | ^^^^^^^^^^^^^^^^^^ error: attribute is only valid on a function, not on a associated const - --> $DIR/invalid-target.rs:217:9 - | -LL | vertex, // fn-only - | ^^^^^^ + --> $DIR/invalid-target.rs:217:9 + | +217 | vertex, // fn-only + | ^^^^^^ error: attribute is only valid on a function parameter, not on a associated const - --> $DIR/invalid-target.rs:218:9 - | -LL | uniform, position, descriptor_set = 0, binding = 0, flat, invariant, // param-only - | ^^^^^^^ + --> $DIR/invalid-target.rs:218:9 + | +218 | uniform, position, descriptor_set = 0, binding = 0, flat, invariant, // param-only + | ^^^^^^^ error: attribute is only valid on a function parameter, not on a associated const - --> $DIR/invalid-target.rs:218:18 - | -LL | uniform, position, descriptor_set = 0, binding = 0, flat, invariant, // param-only - | ^^^^^^^^ + --> $DIR/invalid-target.rs:218:18 + | +218 | uniform, position, descriptor_set = 0, binding = 0, flat, invariant, // param-only + | ^^^^^^^^ error: attribute is only valid on a function parameter, not on a associated const - --> $DIR/invalid-target.rs:218:28 - | -LL | uniform, position, descriptor_set = 0, binding = 0, flat, invariant, // param-only - | ^^^^^^^^^^^^^^^^^^ + --> $DIR/invalid-target.rs:218:28 + | +218 | uniform, position, descriptor_set = 0, binding = 0, flat, invariant, // param-only + | ^^^^^^^^^^^^^^^^^^ error: attribute is only valid on a function parameter, not on a associated const - --> $DIR/invalid-target.rs:218:48 - | -LL | uniform, position, descriptor_set = 0, binding = 0, flat, invariant, // param-only - | ^^^^^^^^^^^ + --> $DIR/invalid-target.rs:218:48 + | +218 | uniform, position, descriptor_set = 0, binding = 0, flat, invariant, // param-only + | ^^^^^^^^^^^ error: attribute is only valid on a function parameter, not on a associated const - --> $DIR/invalid-target.rs:218:61 - | -LL | uniform, position, descriptor_set = 0, binding = 0, flat, invariant, // param-only - | ^^^^ + --> $DIR/invalid-target.rs:218:61 + | +218 | uniform, position, descriptor_set = 0, binding = 0, flat, invariant, // param-only + | ^^^^ error: attribute is only valid on a function parameter, not on a associated const - --> $DIR/invalid-target.rs:218:67 - | -LL | uniform, position, descriptor_set = 0, binding = 0, flat, invariant, // param-only - | ^^^^^^^^^ + --> $DIR/invalid-target.rs:218:67 + | +218 | uniform, position, descriptor_set = 0, binding = 0, flat, invariant, // param-only + | ^^^^^^^^^ error: attribute is only valid on a struct, not on a required trait method - --> $DIR/invalid-target.rs:223:9 - | -LL | sampler, block, sampled_image, generic_image_type, // struct-only - | ^^^^^^^ + --> $DIR/invalid-target.rs:223:9 + | +223 | sampler, block, sampled_image, generic_image_type, // struct-only + | ^^^^^^^ error: attribute is only valid on a struct, not on a required trait method - --> $DIR/invalid-target.rs:223:18 - | -LL | sampler, block, sampled_image, generic_image_type, // struct-only - | ^^^^^ + --> $DIR/invalid-target.rs:223:18 + | +223 | sampler, block, sampled_image, generic_image_type, // struct-only + | ^^^^^ error: attribute is only valid on a struct, not on a required trait method - --> $DIR/invalid-target.rs:223:25 - | -LL | sampler, block, sampled_image, generic_image_type, // struct-only - | ^^^^^^^^^^^^^ + --> $DIR/invalid-target.rs:223:25 + | +223 | sampler, block, sampled_image, generic_image_type, // struct-only + | ^^^^^^^^^^^^^ error: attribute is only valid on a struct, not on a required trait method - --> $DIR/invalid-target.rs:223:40 - | -LL | sampler, block, sampled_image, generic_image_type, // struct-only - | ^^^^^^^^^^^^^^^^^^ + --> $DIR/invalid-target.rs:223:40 + | +223 | sampler, block, sampled_image, generic_image_type, // struct-only + | ^^^^^^^^^^^^^^^^^^ error: attribute is only valid on a function, not on a required trait method - --> $DIR/invalid-target.rs:224:9 - | -LL | vertex, // fn-only - | ^^^^^^ + --> $DIR/invalid-target.rs:224:9 + | +224 | vertex, // fn-only + | ^^^^^^ error: attribute is only valid on a function parameter, not on a required trait method - --> $DIR/invalid-target.rs:225:9 - | -LL | uniform, position, descriptor_set = 0, binding = 0, flat, invariant, // param-only - | ^^^^^^^ + --> $DIR/invalid-target.rs:225:9 + | +225 | uniform, position, descriptor_set = 0, binding = 0, flat, invariant, // param-only + | ^^^^^^^ error: attribute is only valid on a function parameter, not on a required trait method - --> $DIR/invalid-target.rs:225:18 - | -LL | uniform, position, descriptor_set = 0, binding = 0, flat, invariant, // param-only - | ^^^^^^^^ + --> $DIR/invalid-target.rs:225:18 + | +225 | uniform, position, descriptor_set = 0, binding = 0, flat, invariant, // param-only + | ^^^^^^^^ error: attribute is only valid on a function parameter, not on a required trait method - --> $DIR/invalid-target.rs:225:28 - | -LL | uniform, position, descriptor_set = 0, binding = 0, flat, invariant, // param-only - | ^^^^^^^^^^^^^^^^^^ + --> $DIR/invalid-target.rs:225:28 + | +225 | uniform, position, descriptor_set = 0, binding = 0, flat, invariant, // param-only + | ^^^^^^^^^^^^^^^^^^ error: attribute is only valid on a function parameter, not on a required trait method - --> $DIR/invalid-target.rs:225:48 - | -LL | uniform, position, descriptor_set = 0, binding = 0, flat, invariant, // param-only - | ^^^^^^^^^^^ + --> $DIR/invalid-target.rs:225:48 + | +225 | uniform, position, descriptor_set = 0, binding = 0, flat, invariant, // param-only + | ^^^^^^^^^^^ error: attribute is only valid on a function parameter, not on a required trait method - --> $DIR/invalid-target.rs:225:61 - | -LL | uniform, position, descriptor_set = 0, binding = 0, flat, invariant, // param-only - | ^^^^ + --> $DIR/invalid-target.rs:225:61 + | +225 | uniform, position, descriptor_set = 0, binding = 0, flat, invariant, // param-only + | ^^^^ error: attribute is only valid on a function parameter, not on a required trait method - --> $DIR/invalid-target.rs:225:67 - | -LL | uniform, position, descriptor_set = 0, binding = 0, flat, invariant, // param-only - | ^^^^^^^^^ + --> $DIR/invalid-target.rs:225:67 + | +225 | uniform, position, descriptor_set = 0, binding = 0, flat, invariant, // param-only + | ^^^^^^^^^ error: attribute is only valid on a struct, not on a provided trait method - --> $DIR/invalid-target.rs:230:9 - | -LL | sampler, block, sampled_image, generic_image_type, // struct-only - | ^^^^^^^ + --> $DIR/invalid-target.rs:230:9 + | +230 | sampler, block, sampled_image, generic_image_type, // struct-only + | ^^^^^^^ error: attribute is only valid on a struct, not on a provided trait method - --> $DIR/invalid-target.rs:230:18 - | -LL | sampler, block, sampled_image, generic_image_type, // struct-only - | ^^^^^ + --> $DIR/invalid-target.rs:230:18 + | +230 | sampler, block, sampled_image, generic_image_type, // struct-only + | ^^^^^ error: attribute is only valid on a struct, not on a provided trait method - --> $DIR/invalid-target.rs:230:25 - | -LL | sampler, block, sampled_image, generic_image_type, // struct-only - | ^^^^^^^^^^^^^ + --> $DIR/invalid-target.rs:230:25 + | +230 | sampler, block, sampled_image, generic_image_type, // struct-only + | ^^^^^^^^^^^^^ error: attribute is only valid on a struct, not on a provided trait method - --> $DIR/invalid-target.rs:230:40 - | -LL | sampler, block, sampled_image, generic_image_type, // struct-only - | ^^^^^^^^^^^^^^^^^^ + --> $DIR/invalid-target.rs:230:40 + | +230 | sampler, block, sampled_image, generic_image_type, // struct-only + | ^^^^^^^^^^^^^^^^^^ error: attribute is only valid on a function parameter, not on a provided trait method - --> $DIR/invalid-target.rs:231:9 - | -LL | uniform, position, descriptor_set = 0, binding = 0, flat, invariant, // param-only - | ^^^^^^^ + --> $DIR/invalid-target.rs:231:9 + | +231 | uniform, position, descriptor_set = 0, binding = 0, flat, invariant, // param-only + | ^^^^^^^ error: attribute is only valid on a function parameter, not on a provided trait method - --> $DIR/invalid-target.rs:231:18 - | -LL | uniform, position, descriptor_set = 0, binding = 0, flat, invariant, // param-only - | ^^^^^^^^ + --> $DIR/invalid-target.rs:231:18 + | +231 | uniform, position, descriptor_set = 0, binding = 0, flat, invariant, // param-only + | ^^^^^^^^ error: attribute is only valid on a function parameter, not on a provided trait method - --> $DIR/invalid-target.rs:231:28 - | -LL | uniform, position, descriptor_set = 0, binding = 0, flat, invariant, // param-only - | ^^^^^^^^^^^^^^^^^^ + --> $DIR/invalid-target.rs:231:28 + | +231 | uniform, position, descriptor_set = 0, binding = 0, flat, invariant, // param-only + | ^^^^^^^^^^^^^^^^^^ error: attribute is only valid on a function parameter, not on a provided trait method - --> $DIR/invalid-target.rs:231:48 - | -LL | uniform, position, descriptor_set = 0, binding = 0, flat, invariant, // param-only - | ^^^^^^^^^^^ + --> $DIR/invalid-target.rs:231:48 + | +231 | uniform, position, descriptor_set = 0, binding = 0, flat, invariant, // param-only + | ^^^^^^^^^^^ error: attribute is only valid on a function parameter, not on a provided trait method - --> $DIR/invalid-target.rs:231:61 - | -LL | uniform, position, descriptor_set = 0, binding = 0, flat, invariant, // param-only - | ^^^^ + --> $DIR/invalid-target.rs:231:61 + | +231 | uniform, position, descriptor_set = 0, binding = 0, flat, invariant, // param-only + | ^^^^ error: attribute is only valid on a function parameter, not on a provided trait method - --> $DIR/invalid-target.rs:231:67 - | -LL | uniform, position, descriptor_set = 0, binding = 0, flat, invariant, // param-only - | ^^^^^^^^^ + --> $DIR/invalid-target.rs:231:67 + | +231 | uniform, position, descriptor_set = 0, binding = 0, flat, invariant, // param-only + | ^^^^^^^^^ error: attribute is only valid on a struct, not on a associated const - --> $DIR/invalid-target.rs:182:9 - | -LL | sampler, block, sampled_image, generic_image_type, // struct-only - | ^^^^^^^ + --> $DIR/invalid-target.rs:182:9 + | +182 | sampler, block, sampled_image, generic_image_type, // struct-only + | ^^^^^^^ error: attribute is only valid on a struct, not on a associated const - --> $DIR/invalid-target.rs:182:18 - | -LL | sampler, block, sampled_image, generic_image_type, // struct-only - | ^^^^^ + --> $DIR/invalid-target.rs:182:18 + | +182 | sampler, block, sampled_image, generic_image_type, // struct-only + | ^^^^^ error: attribute is only valid on a struct, not on a associated const - --> $DIR/invalid-target.rs:182:25 - | -LL | sampler, block, sampled_image, generic_image_type, // struct-only - | ^^^^^^^^^^^^^ + --> $DIR/invalid-target.rs:182:25 + | +182 | sampler, block, sampled_image, generic_image_type, // struct-only + | ^^^^^^^^^^^^^ error: attribute is only valid on a struct, not on a associated const - --> $DIR/invalid-target.rs:182:40 - | -LL | sampler, block, sampled_image, generic_image_type, // struct-only - | ^^^^^^^^^^^^^^^^^^ + --> $DIR/invalid-target.rs:182:40 + | +182 | sampler, block, sampled_image, generic_image_type, // struct-only + | ^^^^^^^^^^^^^^^^^^ error: attribute is only valid on a function, not on a associated const - --> $DIR/invalid-target.rs:183:9 - | -LL | vertex, // fn-only - | ^^^^^^ + --> $DIR/invalid-target.rs:183:9 + | +183 | vertex, // fn-only + | ^^^^^^ error: attribute is only valid on a function parameter, not on a associated const - --> $DIR/invalid-target.rs:184:9 - | -LL | uniform, position, descriptor_set = 0, binding = 0, flat, invariant, // param-only - | ^^^^^^^ + --> $DIR/invalid-target.rs:184:9 + | +184 | uniform, position, descriptor_set = 0, binding = 0, flat, invariant, // param-only + | ^^^^^^^ error: attribute is only valid on a function parameter, not on a associated const - --> $DIR/invalid-target.rs:184:18 - | -LL | uniform, position, descriptor_set = 0, binding = 0, flat, invariant, // param-only - | ^^^^^^^^ + --> $DIR/invalid-target.rs:184:18 + | +184 | uniform, position, descriptor_set = 0, binding = 0, flat, invariant, // param-only + | ^^^^^^^^ error: attribute is only valid on a function parameter, not on a associated const - --> $DIR/invalid-target.rs:184:28 - | -LL | uniform, position, descriptor_set = 0, binding = 0, flat, invariant, // param-only - | ^^^^^^^^^^^^^^^^^^ + --> $DIR/invalid-target.rs:184:28 + | +184 | uniform, position, descriptor_set = 0, binding = 0, flat, invariant, // param-only + | ^^^^^^^^^^^^^^^^^^ error: attribute is only valid on a function parameter, not on a associated const - --> $DIR/invalid-target.rs:184:48 - | -LL | uniform, position, descriptor_set = 0, binding = 0, flat, invariant, // param-only - | ^^^^^^^^^^^ + --> $DIR/invalid-target.rs:184:48 + | +184 | uniform, position, descriptor_set = 0, binding = 0, flat, invariant, // param-only + | ^^^^^^^^^^^ error: attribute is only valid on a function parameter, not on a associated const - --> $DIR/invalid-target.rs:184:61 - | -LL | uniform, position, descriptor_set = 0, binding = 0, flat, invariant, // param-only - | ^^^^ + --> $DIR/invalid-target.rs:184:61 + | +184 | uniform, position, descriptor_set = 0, binding = 0, flat, invariant, // param-only + | ^^^^ error: attribute is only valid on a function parameter, not on a associated const - --> $DIR/invalid-target.rs:184:67 - | -LL | uniform, position, descriptor_set = 0, binding = 0, flat, invariant, // param-only - | ^^^^^^^^^ + --> $DIR/invalid-target.rs:184:67 + | +184 | uniform, position, descriptor_set = 0, binding = 0, flat, invariant, // param-only + | ^^^^^^^^^ error: attribute is only valid on a struct, not on a inherent method - --> $DIR/invalid-target.rs:189:9 - | -LL | sampler, block, sampled_image, generic_image_type, // struct-only - | ^^^^^^^ + --> $DIR/invalid-target.rs:189:9 + | +189 | sampler, block, sampled_image, generic_image_type, // struct-only + | ^^^^^^^ error: attribute is only valid on a struct, not on a inherent method - --> $DIR/invalid-target.rs:189:18 - | -LL | sampler, block, sampled_image, generic_image_type, // struct-only - | ^^^^^ + --> $DIR/invalid-target.rs:189:18 + | +189 | sampler, block, sampled_image, generic_image_type, // struct-only + | ^^^^^ error: attribute is only valid on a struct, not on a inherent method - --> $DIR/invalid-target.rs:189:25 - | -LL | sampler, block, sampled_image, generic_image_type, // struct-only - | ^^^^^^^^^^^^^ + --> $DIR/invalid-target.rs:189:25 + | +189 | sampler, block, sampled_image, generic_image_type, // struct-only + | ^^^^^^^^^^^^^ error: attribute is only valid on a struct, not on a inherent method - --> $DIR/invalid-target.rs:189:40 - | -LL | sampler, block, sampled_image, generic_image_type, // struct-only - | ^^^^^^^^^^^^^^^^^^ + --> $DIR/invalid-target.rs:189:40 + | +189 | sampler, block, sampled_image, generic_image_type, // struct-only + | ^^^^^^^^^^^^^^^^^^ error: attribute is only valid on a function parameter, not on a inherent method - --> $DIR/invalid-target.rs:190:9 - | -LL | uniform, position, descriptor_set = 0, binding = 0, flat, invariant, // param-only - | ^^^^^^^ + --> $DIR/invalid-target.rs:190:9 + | +190 | uniform, position, descriptor_set = 0, binding = 0, flat, invariant, // param-only + | ^^^^^^^ error: attribute is only valid on a function parameter, not on a inherent method - --> $DIR/invalid-target.rs:190:18 - | -LL | uniform, position, descriptor_set = 0, binding = 0, flat, invariant, // param-only - | ^^^^^^^^ + --> $DIR/invalid-target.rs:190:18 + | +190 | uniform, position, descriptor_set = 0, binding = 0, flat, invariant, // param-only + | ^^^^^^^^ error: attribute is only valid on a function parameter, not on a inherent method - --> $DIR/invalid-target.rs:190:28 - | -LL | uniform, position, descriptor_set = 0, binding = 0, flat, invariant, // param-only - | ^^^^^^^^^^^^^^^^^^ + --> $DIR/invalid-target.rs:190:28 + | +190 | uniform, position, descriptor_set = 0, binding = 0, flat, invariant, // param-only + | ^^^^^^^^^^^^^^^^^^ error: attribute is only valid on a function parameter, not on a inherent method - --> $DIR/invalid-target.rs:190:48 - | -LL | uniform, position, descriptor_set = 0, binding = 0, flat, invariant, // param-only - | ^^^^^^^^^^^ + --> $DIR/invalid-target.rs:190:48 + | +190 | uniform, position, descriptor_set = 0, binding = 0, flat, invariant, // param-only + | ^^^^^^^^^^^ error: attribute is only valid on a function parameter, not on a inherent method - --> $DIR/invalid-target.rs:190:61 - | -LL | uniform, position, descriptor_set = 0, binding = 0, flat, invariant, // param-only - | ^^^^ + --> $DIR/invalid-target.rs:190:61 + | +190 | uniform, position, descriptor_set = 0, binding = 0, flat, invariant, // param-only + | ^^^^ error: attribute is only valid on a function parameter, not on a inherent method - --> $DIR/invalid-target.rs:190:67 - | -LL | uniform, position, descriptor_set = 0, binding = 0, flat, invariant, // param-only - | ^^^^^^^^^ + --> $DIR/invalid-target.rs:190:67 + | +190 | uniform, position, descriptor_set = 0, binding = 0, flat, invariant, // param-only + | ^^^^^^^^^ error: attribute is only valid on a struct, not on a associated type - --> $DIR/invalid-target.rs:243:9 - | -LL | sampler, block, sampled_image, generic_image_type, // struct-only - | ^^^^^^^ + --> $DIR/invalid-target.rs:243:9 + | +243 | sampler, block, sampled_image, generic_image_type, // struct-only + | ^^^^^^^ error: attribute is only valid on a struct, not on a associated type - --> $DIR/invalid-target.rs:243:18 - | -LL | sampler, block, sampled_image, generic_image_type, // struct-only - | ^^^^^ + --> $DIR/invalid-target.rs:243:18 + | +243 | sampler, block, sampled_image, generic_image_type, // struct-only + | ^^^^^ error: attribute is only valid on a struct, not on a associated type - --> $DIR/invalid-target.rs:243:25 - | -LL | sampler, block, sampled_image, generic_image_type, // struct-only - | ^^^^^^^^^^^^^ + --> $DIR/invalid-target.rs:243:25 + | +243 | sampler, block, sampled_image, generic_image_type, // struct-only + | ^^^^^^^^^^^^^ error: attribute is only valid on a struct, not on a associated type - --> $DIR/invalid-target.rs:243:40 - | -LL | sampler, block, sampled_image, generic_image_type, // struct-only - | ^^^^^^^^^^^^^^^^^^ + --> $DIR/invalid-target.rs:243:40 + | +243 | sampler, block, sampled_image, generic_image_type, // struct-only + | ^^^^^^^^^^^^^^^^^^ error: attribute is only valid on a function, not on a associated type - --> $DIR/invalid-target.rs:244:9 - | -LL | vertex, // fn-only - | ^^^^^^ + --> $DIR/invalid-target.rs:244:9 + | +244 | vertex, // fn-only + | ^^^^^^ error: attribute is only valid on a function parameter, not on a associated type - --> $DIR/invalid-target.rs:245:9 - | -LL | uniform, position, descriptor_set = 0, binding = 0, flat, invariant, // param-only - | ^^^^^^^ + --> $DIR/invalid-target.rs:245:9 + | +245 | uniform, position, descriptor_set = 0, binding = 0, flat, invariant, // param-only + | ^^^^^^^ error: attribute is only valid on a function parameter, not on a associated type - --> $DIR/invalid-target.rs:245:18 - | -LL | uniform, position, descriptor_set = 0, binding = 0, flat, invariant, // param-only - | ^^^^^^^^ + --> $DIR/invalid-target.rs:245:18 + | +245 | uniform, position, descriptor_set = 0, binding = 0, flat, invariant, // param-only + | ^^^^^^^^ error: attribute is only valid on a function parameter, not on a associated type - --> $DIR/invalid-target.rs:245:28 - | -LL | uniform, position, descriptor_set = 0, binding = 0, flat, invariant, // param-only - | ^^^^^^^^^^^^^^^^^^ + --> $DIR/invalid-target.rs:245:28 + | +245 | uniform, position, descriptor_set = 0, binding = 0, flat, invariant, // param-only + | ^^^^^^^^^^^^^^^^^^ error: attribute is only valid on a function parameter, not on a associated type - --> $DIR/invalid-target.rs:245:48 - | -LL | uniform, position, descriptor_set = 0, binding = 0, flat, invariant, // param-only - | ^^^^^^^^^^^ + --> $DIR/invalid-target.rs:245:48 + | +245 | uniform, position, descriptor_set = 0, binding = 0, flat, invariant, // param-only + | ^^^^^^^^^^^ error: attribute is only valid on a function parameter, not on a associated type - --> $DIR/invalid-target.rs:245:61 - | -LL | uniform, position, descriptor_set = 0, binding = 0, flat, invariant, // param-only - | ^^^^ + --> $DIR/invalid-target.rs:245:61 + | +245 | uniform, position, descriptor_set = 0, binding = 0, flat, invariant, // param-only + | ^^^^ error: attribute is only valid on a function parameter, not on a associated type - --> $DIR/invalid-target.rs:245:67 - | -LL | uniform, position, descriptor_set = 0, binding = 0, flat, invariant, // param-only - | ^^^^^^^^^ + --> $DIR/invalid-target.rs:245:67 + | +245 | uniform, position, descriptor_set = 0, binding = 0, flat, invariant, // param-only + | ^^^^^^^^^ error: attribute is only valid on a struct, not on a associated const - --> $DIR/invalid-target.rs:250:9 - | -LL | sampler, block, sampled_image, generic_image_type, // struct-only - | ^^^^^^^ + --> $DIR/invalid-target.rs:250:9 + | +250 | sampler, block, sampled_image, generic_image_type, // struct-only + | ^^^^^^^ error: attribute is only valid on a struct, not on a associated const - --> $DIR/invalid-target.rs:250:18 - | -LL | sampler, block, sampled_image, generic_image_type, // struct-only - | ^^^^^ + --> $DIR/invalid-target.rs:250:18 + | +250 | sampler, block, sampled_image, generic_image_type, // struct-only + | ^^^^^ error: attribute is only valid on a struct, not on a associated const - --> $DIR/invalid-target.rs:250:25 - | -LL | sampler, block, sampled_image, generic_image_type, // struct-only - | ^^^^^^^^^^^^^ + --> $DIR/invalid-target.rs:250:25 + | +250 | sampler, block, sampled_image, generic_image_type, // struct-only + | ^^^^^^^^^^^^^ error: attribute is only valid on a struct, not on a associated const - --> $DIR/invalid-target.rs:250:40 - | -LL | sampler, block, sampled_image, generic_image_type, // struct-only - | ^^^^^^^^^^^^^^^^^^ + --> $DIR/invalid-target.rs:250:40 + | +250 | sampler, block, sampled_image, generic_image_type, // struct-only + | ^^^^^^^^^^^^^^^^^^ error: attribute is only valid on a function, not on a associated const - --> $DIR/invalid-target.rs:251:9 - | -LL | vertex, // fn-only - | ^^^^^^ + --> $DIR/invalid-target.rs:251:9 + | +251 | vertex, // fn-only + | ^^^^^^ error: attribute is only valid on a function parameter, not on a associated const - --> $DIR/invalid-target.rs:252:9 - | -LL | uniform, position, descriptor_set = 0, binding = 0, flat, invariant, // param-only - | ^^^^^^^ + --> $DIR/invalid-target.rs:252:9 + | +252 | uniform, position, descriptor_set = 0, binding = 0, flat, invariant, // param-only + | ^^^^^^^ error: attribute is only valid on a function parameter, not on a associated const - --> $DIR/invalid-target.rs:252:18 - | -LL | uniform, position, descriptor_set = 0, binding = 0, flat, invariant, // param-only - | ^^^^^^^^ + --> $DIR/invalid-target.rs:252:18 + | +252 | uniform, position, descriptor_set = 0, binding = 0, flat, invariant, // param-only + | ^^^^^^^^ error: attribute is only valid on a function parameter, not on a associated const - --> $DIR/invalid-target.rs:252:28 - | -LL | uniform, position, descriptor_set = 0, binding = 0, flat, invariant, // param-only - | ^^^^^^^^^^^^^^^^^^ + --> $DIR/invalid-target.rs:252:28 + | +252 | uniform, position, descriptor_set = 0, binding = 0, flat, invariant, // param-only + | ^^^^^^^^^^^^^^^^^^ error: attribute is only valid on a function parameter, not on a associated const - --> $DIR/invalid-target.rs:252:48 - | -LL | uniform, position, descriptor_set = 0, binding = 0, flat, invariant, // param-only - | ^^^^^^^^^^^ + --> $DIR/invalid-target.rs:252:48 + | +252 | uniform, position, descriptor_set = 0, binding = 0, flat, invariant, // param-only + | ^^^^^^^^^^^ error: attribute is only valid on a function parameter, not on a associated const - --> $DIR/invalid-target.rs:252:61 - | -LL | uniform, position, descriptor_set = 0, binding = 0, flat, invariant, // param-only - | ^^^^ + --> $DIR/invalid-target.rs:252:61 + | +252 | uniform, position, descriptor_set = 0, binding = 0, flat, invariant, // param-only + | ^^^^ error: attribute is only valid on a function parameter, not on a associated const - --> $DIR/invalid-target.rs:252:67 - | -LL | uniform, position, descriptor_set = 0, binding = 0, flat, invariant, // param-only - | ^^^^^^^^^ + --> $DIR/invalid-target.rs:252:67 + | +252 | uniform, position, descriptor_set = 0, binding = 0, flat, invariant, // param-only + | ^^^^^^^^^ error: attribute is only valid on a struct, not on a provided trait method - --> $DIR/invalid-target.rs:257:9 - | -LL | sampler, block, sampled_image, generic_image_type, // struct-only - | ^^^^^^^ + --> $DIR/invalid-target.rs:257:9 + | +257 | sampler, block, sampled_image, generic_image_type, // struct-only + | ^^^^^^^ error: attribute is only valid on a struct, not on a provided trait method - --> $DIR/invalid-target.rs:257:18 - | -LL | sampler, block, sampled_image, generic_image_type, // struct-only - | ^^^^^ + --> $DIR/invalid-target.rs:257:18 + | +257 | sampler, block, sampled_image, generic_image_type, // struct-only + | ^^^^^ error: attribute is only valid on a struct, not on a provided trait method - --> $DIR/invalid-target.rs:257:25 - | -LL | sampler, block, sampled_image, generic_image_type, // struct-only - | ^^^^^^^^^^^^^ + --> $DIR/invalid-target.rs:257:25 + | +257 | sampler, block, sampled_image, generic_image_type, // struct-only + | ^^^^^^^^^^^^^ error: attribute is only valid on a struct, not on a provided trait method - --> $DIR/invalid-target.rs:257:40 - | -LL | sampler, block, sampled_image, generic_image_type, // struct-only - | ^^^^^^^^^^^^^^^^^^ + --> $DIR/invalid-target.rs:257:40 + | +257 | sampler, block, sampled_image, generic_image_type, // struct-only + | ^^^^^^^^^^^^^^^^^^ error: attribute is only valid on a function parameter, not on a provided trait method - --> $DIR/invalid-target.rs:258:9 - | -LL | uniform, position, descriptor_set = 0, binding = 0, flat, invariant, // param-only - | ^^^^^^^ + --> $DIR/invalid-target.rs:258:9 + | +258 | uniform, position, descriptor_set = 0, binding = 0, flat, invariant, // param-only + | ^^^^^^^ error: attribute is only valid on a function parameter, not on a provided trait method - --> $DIR/invalid-target.rs:258:18 - | -LL | uniform, position, descriptor_set = 0, binding = 0, flat, invariant, // param-only - | ^^^^^^^^ + --> $DIR/invalid-target.rs:258:18 + | +258 | uniform, position, descriptor_set = 0, binding = 0, flat, invariant, // param-only + | ^^^^^^^^ error: attribute is only valid on a function parameter, not on a provided trait method - --> $DIR/invalid-target.rs:258:28 - | -LL | uniform, position, descriptor_set = 0, binding = 0, flat, invariant, // param-only - | ^^^^^^^^^^^^^^^^^^ + --> $DIR/invalid-target.rs:258:28 + | +258 | uniform, position, descriptor_set = 0, binding = 0, flat, invariant, // param-only + | ^^^^^^^^^^^^^^^^^^ error: attribute is only valid on a function parameter, not on a provided trait method - --> $DIR/invalid-target.rs:258:48 - | -LL | uniform, position, descriptor_set = 0, binding = 0, flat, invariant, // param-only - | ^^^^^^^^^^^ + --> $DIR/invalid-target.rs:258:48 + | +258 | uniform, position, descriptor_set = 0, binding = 0, flat, invariant, // param-only + | ^^^^^^^^^^^ error: attribute is only valid on a function parameter, not on a provided trait method - --> $DIR/invalid-target.rs:258:61 - | -LL | uniform, position, descriptor_set = 0, binding = 0, flat, invariant, // param-only - | ^^^^ + --> $DIR/invalid-target.rs:258:61 + | +258 | uniform, position, descriptor_set = 0, binding = 0, flat, invariant, // param-only + | ^^^^ error: attribute is only valid on a function parameter, not on a provided trait method - --> $DIR/invalid-target.rs:258:67 - | -LL | uniform, position, descriptor_set = 0, binding = 0, flat, invariant, // param-only - | ^^^^^^^^^ + --> $DIR/invalid-target.rs:258:67 + | +258 | uniform, position, descriptor_set = 0, binding = 0, flat, invariant, // param-only + | ^^^^^^^^^ error: attribute is only valid on a struct, not on a foreign type --> $DIR/invalid-target.rs:74:9 | -LL | sampler, block, sampled_image, generic_image_type, // struct-only +74 | sampler, block, sampled_image, generic_image_type, // struct-only | ^^^^^^^ error: attribute is only valid on a struct, not on a foreign type --> $DIR/invalid-target.rs:74:18 | -LL | sampler, block, sampled_image, generic_image_type, // struct-only +74 | sampler, block, sampled_image, generic_image_type, // struct-only | ^^^^^ error: attribute is only valid on a struct, not on a foreign type --> $DIR/invalid-target.rs:74:25 | -LL | sampler, block, sampled_image, generic_image_type, // struct-only +74 | sampler, block, sampled_image, generic_image_type, // struct-only | ^^^^^^^^^^^^^ error: attribute is only valid on a struct, not on a foreign type --> $DIR/invalid-target.rs:74:40 | -LL | sampler, block, sampled_image, generic_image_type, // struct-only +74 | sampler, block, sampled_image, generic_image_type, // struct-only | ^^^^^^^^^^^^^^^^^^ error: attribute is only valid on a function, not on a foreign type --> $DIR/invalid-target.rs:75:9 | -LL | vertex, // fn-only +75 | vertex, // fn-only | ^^^^^^ error: attribute is only valid on a function parameter, not on a foreign type --> $DIR/invalid-target.rs:76:9 | -LL | uniform, position, descriptor_set = 0, binding = 0, flat, invariant, // param-only +76 | uniform, position, descriptor_set = 0, binding = 0, flat, invariant, // param-only | ^^^^^^^ error: attribute is only valid on a function parameter, not on a foreign type --> $DIR/invalid-target.rs:76:18 | -LL | uniform, position, descriptor_set = 0, binding = 0, flat, invariant, // param-only +76 | uniform, position, descriptor_set = 0, binding = 0, flat, invariant, // param-only | ^^^^^^^^ error: attribute is only valid on a function parameter, not on a foreign type --> $DIR/invalid-target.rs:76:28 | -LL | uniform, position, descriptor_set = 0, binding = 0, flat, invariant, // param-only +76 | uniform, position, descriptor_set = 0, binding = 0, flat, invariant, // param-only | ^^^^^^^^^^^^^^^^^^ error: attribute is only valid on a function parameter, not on a foreign type --> $DIR/invalid-target.rs:76:48 | -LL | uniform, position, descriptor_set = 0, binding = 0, flat, invariant, // param-only +76 | uniform, position, descriptor_set = 0, binding = 0, flat, invariant, // param-only | ^^^^^^^^^^^ error: attribute is only valid on a function parameter, not on a foreign type --> $DIR/invalid-target.rs:76:61 | -LL | uniform, position, descriptor_set = 0, binding = 0, flat, invariant, // param-only +76 | uniform, position, descriptor_set = 0, binding = 0, flat, invariant, // param-only | ^^^^ error: attribute is only valid on a function parameter, not on a foreign type --> $DIR/invalid-target.rs:76:67 | -LL | uniform, position, descriptor_set = 0, binding = 0, flat, invariant, // param-only +76 | uniform, position, descriptor_set = 0, binding = 0, flat, invariant, // param-only | ^^^^^^^^^ error: attribute is only valid on a struct, not on a foreign static item --> $DIR/invalid-target.rs:81:9 | -LL | sampler, block, sampled_image, generic_image_type, // struct-only +81 | sampler, block, sampled_image, generic_image_type, // struct-only | ^^^^^^^ error: attribute is only valid on a struct, not on a foreign static item --> $DIR/invalid-target.rs:81:18 | -LL | sampler, block, sampled_image, generic_image_type, // struct-only +81 | sampler, block, sampled_image, generic_image_type, // struct-only | ^^^^^ error: attribute is only valid on a struct, not on a foreign static item --> $DIR/invalid-target.rs:81:25 | -LL | sampler, block, sampled_image, generic_image_type, // struct-only +81 | sampler, block, sampled_image, generic_image_type, // struct-only | ^^^^^^^^^^^^^ error: attribute is only valid on a struct, not on a foreign static item --> $DIR/invalid-target.rs:81:40 | -LL | sampler, block, sampled_image, generic_image_type, // struct-only +81 | sampler, block, sampled_image, generic_image_type, // struct-only | ^^^^^^^^^^^^^^^^^^ error: attribute is only valid on a function, not on a foreign static item --> $DIR/invalid-target.rs:82:9 | -LL | vertex, // fn-only +82 | vertex, // fn-only | ^^^^^^ error: attribute is only valid on a function parameter, not on a foreign static item --> $DIR/invalid-target.rs:83:9 | -LL | uniform, position, descriptor_set = 0, binding = 0, flat, invariant, // param-only +83 | uniform, position, descriptor_set = 0, binding = 0, flat, invariant, // param-only | ^^^^^^^ error: attribute is only valid on a function parameter, not on a foreign static item --> $DIR/invalid-target.rs:83:18 | -LL | uniform, position, descriptor_set = 0, binding = 0, flat, invariant, // param-only +83 | uniform, position, descriptor_set = 0, binding = 0, flat, invariant, // param-only | ^^^^^^^^ error: attribute is only valid on a function parameter, not on a foreign static item --> $DIR/invalid-target.rs:83:28 | -LL | uniform, position, descriptor_set = 0, binding = 0, flat, invariant, // param-only +83 | uniform, position, descriptor_set = 0, binding = 0, flat, invariant, // param-only | ^^^^^^^^^^^^^^^^^^ error: attribute is only valid on a function parameter, not on a foreign static item --> $DIR/invalid-target.rs:83:48 | -LL | uniform, position, descriptor_set = 0, binding = 0, flat, invariant, // param-only +83 | uniform, position, descriptor_set = 0, binding = 0, flat, invariant, // param-only | ^^^^^^^^^^^ error: attribute is only valid on a function parameter, not on a foreign static item --> $DIR/invalid-target.rs:83:61 | -LL | uniform, position, descriptor_set = 0, binding = 0, flat, invariant, // param-only +83 | uniform, position, descriptor_set = 0, binding = 0, flat, invariant, // param-only | ^^^^ error: attribute is only valid on a function parameter, not on a foreign static item --> $DIR/invalid-target.rs:83:67 | -LL | uniform, position, descriptor_set = 0, binding = 0, flat, invariant, // param-only +83 | uniform, position, descriptor_set = 0, binding = 0, flat, invariant, // param-only | ^^^^^^^^^ error: attribute is only valid on a struct, not on a foreign function --> $DIR/invalid-target.rs:88:9 | -LL | sampler, block, sampled_image, generic_image_type, // struct-only +88 | sampler, block, sampled_image, generic_image_type, // struct-only | ^^^^^^^ error: attribute is only valid on a struct, not on a foreign function --> $DIR/invalid-target.rs:88:18 | -LL | sampler, block, sampled_image, generic_image_type, // struct-only +88 | sampler, block, sampled_image, generic_image_type, // struct-only | ^^^^^ error: attribute is only valid on a struct, not on a foreign function --> $DIR/invalid-target.rs:88:25 | -LL | sampler, block, sampled_image, generic_image_type, // struct-only +88 | sampler, block, sampled_image, generic_image_type, // struct-only | ^^^^^^^^^^^^^ error: attribute is only valid on a struct, not on a foreign function --> $DIR/invalid-target.rs:88:40 | -LL | sampler, block, sampled_image, generic_image_type, // struct-only +88 | sampler, block, sampled_image, generic_image_type, // struct-only | ^^^^^^^^^^^^^^^^^^ error: attribute is only valid on a function, not on a foreign function --> $DIR/invalid-target.rs:89:9 | -LL | vertex, // fn-only +89 | vertex, // fn-only | ^^^^^^ error: attribute is only valid on a function parameter, not on a foreign function --> $DIR/invalid-target.rs:90:9 | -LL | uniform, position, descriptor_set = 0, binding = 0, flat, invariant, // param-only +90 | uniform, position, descriptor_set = 0, binding = 0, flat, invariant, // param-only | ^^^^^^^ error: attribute is only valid on a function parameter, not on a foreign function --> $DIR/invalid-target.rs:90:18 | -LL | uniform, position, descriptor_set = 0, binding = 0, flat, invariant, // param-only +90 | uniform, position, descriptor_set = 0, binding = 0, flat, invariant, // param-only | ^^^^^^^^ error: attribute is only valid on a function parameter, not on a foreign function --> $DIR/invalid-target.rs:90:28 | -LL | uniform, position, descriptor_set = 0, binding = 0, flat, invariant, // param-only +90 | uniform, position, descriptor_set = 0, binding = 0, flat, invariant, // param-only | ^^^^^^^^^^^^^^^^^^ error: attribute is only valid on a function parameter, not on a foreign function --> $DIR/invalid-target.rs:90:48 | -LL | uniform, position, descriptor_set = 0, binding = 0, flat, invariant, // param-only +90 | uniform, position, descriptor_set = 0, binding = 0, flat, invariant, // param-only | ^^^^^^^^^^^ error: attribute is only valid on a function parameter, not on a foreign function --> $DIR/invalid-target.rs:90:61 | -LL | uniform, position, descriptor_set = 0, binding = 0, flat, invariant, // param-only +90 | uniform, position, descriptor_set = 0, binding = 0, flat, invariant, // param-only | ^^^^ error: attribute is only valid on a function parameter, not on a foreign function --> $DIR/invalid-target.rs:90:67 | -LL | uniform, position, descriptor_set = 0, binding = 0, flat, invariant, // param-only +90 | uniform, position, descriptor_set = 0, binding = 0, flat, invariant, // param-only | ^^^^^^^^^ error: unconstrained opaque type - --> $DIR/invalid-target.rs:121:18 - | -LL | type _OpaqueTy = impl Copy; - | ^^^^^^^^^ - | - = note: `_OpaqueTy` must be used in combination with a concrete type within the same crate + --> $DIR/invalid-target.rs:121:18 + | +121 | type _OpaqueTy = impl Copy; + | ^^^^^^^^^ + | + = note: `_OpaqueTy` must be used in combination with a concrete type within the same crate error[E0308]: mismatched types - --> $DIR/invalid-target.rs:124:5 - | -LL | type _OpaqueTy = impl Copy; - | --------- the expected opaque type -LL | -LL | fn _opaque_ty_definer() -> _OpaqueTy { - | --------- expected `_OpaqueTy` because of return type -LL | () - | ^^ expected opaque type, found `()` - | - = note: expected opaque type `_OpaqueTy` - found unit type `()` + --> $DIR/invalid-target.rs:124:5 + | +121 | type _OpaqueTy = impl Copy; + | --------- the expected opaque type +122 | +123 | fn _opaque_ty_definer() -> _OpaqueTy { + | --------- expected `_OpaqueTy` because of return type +124 | () + | ^^ expected opaque type, found `()` + | + = note: expected opaque type `_OpaqueTy` + found unit type `()` note: this item must have a `#[define_opaque(_OpaqueTy)]` attribute to be able to define hidden types - --> $DIR/invalid-target.rs:123:4 - | -LL | fn _opaque_ty_definer() -> _OpaqueTy { - | ^^^^^^^^^^^^^^^^^^ + --> $DIR/invalid-target.rs:123:4 + | +123 | fn _opaque_ty_definer() -> _OpaqueTy { + | ^^^^^^^^^^^^^^^^^^ error: aborting due to 439 previous errors diff --git a/tests/compiletests/ui/spirv-attr/invariant-invalid.stderr b/tests/compiletests/ui/spirv-attr/invariant-invalid.stderr index f03d24d3e4..8db5f32424 100644 --- a/tests/compiletests/ui/spirv-attr/invariant-invalid.stderr +++ b/tests/compiletests/ui/spirv-attr/invariant-invalid.stderr @@ -1,8 +1,8 @@ error: `#[spirv(invariant)]` is only valid on Output variables - --> $DIR/invariant-invalid.rs:7:21 - | -LL | pub fn main(#[spirv(invariant)] input: f32) {} - | ^^^^^^^^^ + --> $DIR/invariant-invalid.rs:7:21 + | +7 | pub fn main(#[spirv(invariant)] input: f32) {} + | ^^^^^^^^^ error: aborting due to 1 previous error diff --git a/tests/compiletests/ui/spirv-attr/multiple.stderr b/tests/compiletests/ui/spirv-attr/multiple.stderr index a5fc424dc2..35811e8b7d 100644 --- a/tests/compiletests/ui/spirv-attr/multiple.stderr +++ b/tests/compiletests/ui/spirv-attr/multiple.stderr @@ -1,211 +1,211 @@ error: only one intrinsic type attribute is allowed on a struct - --> $DIR/multiple.rs:8:18 - | -LL | #[spirv(sampler, sampler)] - | ^^^^^^^ - | + --> $DIR/multiple.rs:8:18 + | +8 | #[spirv(sampler, sampler)] + | ^^^^^^^ + | note: previous intrinsic type attribute - --> $DIR/multiple.rs:8:9 - | -LL | #[spirv(sampler, sampler)] - | ^^^^^^^ + --> $DIR/multiple.rs:8:9 + | +8 | #[spirv(sampler, sampler)] + | ^^^^^^^ error: only one intrinsic type attribute is allowed on a struct --> $DIR/multiple.rs:11:17 | -LL | #[spirv(matrix, matrix)] +11 | #[spirv(matrix, matrix)] | ^^^^^^ | note: previous intrinsic type attribute --> $DIR/multiple.rs:11:9 | -LL | #[spirv(matrix, matrix)] +11 | #[spirv(matrix, matrix)] | ^^^^^^ error: only one intrinsic type attribute is allowed on a struct --> $DIR/multiple.rs:17:18 | -LL | #[spirv(sampler, generic_image_type)] +17 | #[spirv(sampler, generic_image_type)] | ^^^^^^^^^^^^^^^^^^ | note: previous intrinsic type attribute --> $DIR/multiple.rs:17:9 | -LL | #[spirv(sampler, generic_image_type)] +17 | #[spirv(sampler, generic_image_type)] | ^^^^^^^ error: only one intrinsic type attribute is allowed on a struct --> $DIR/multiple.rs:20:18 | -LL | #[spirv(sampler, matrix)] +20 | #[spirv(sampler, matrix)] | ^^^^^^ | note: previous intrinsic type attribute --> $DIR/multiple.rs:20:9 | -LL | #[spirv(sampler, matrix)] +20 | #[spirv(sampler, matrix)] | ^^^^^^^ error: only one #[spirv(block)] attribute is allowed on a struct --> $DIR/multiple.rs:26:16 | -LL | #[spirv(block, block)] +26 | #[spirv(block, block)] | ^^^^^ | note: previous #[spirv(block)] attribute --> $DIR/multiple.rs:26:9 | -LL | #[spirv(block, block)] +26 | #[spirv(block, block)] | ^^^^^ warning: #[spirv(block)] is no longer needed and should be removed --> $DIR/multiple.rs:26:9 | -LL | #[spirv(block, block)] +26 | #[spirv(block, block)] | ^^^^^ error: only one entry-point attribute is allowed on a function --> $DIR/multiple.rs:29:17 | -LL | #[spirv(vertex, vertex)] +29 | #[spirv(vertex, vertex)] | ^^^^^^ | note: previous entry-point attribute --> $DIR/multiple.rs:29:9 | -LL | #[spirv(vertex, vertex)] +29 | #[spirv(vertex, vertex)] | ^^^^^^ error: only one entry-point attribute is allowed on a function --> $DIR/multiple.rs:32:17 | -LL | #[spirv(vertex, fragment)] +32 | #[spirv(vertex, fragment)] | ^^^^^^^^ | note: previous entry-point attribute --> $DIR/multiple.rs:32:9 | -LL | #[spirv(vertex, fragment)] +32 | #[spirv(vertex, fragment)] | ^^^^^^ error: only one storage class attribute is allowed on a function param --> $DIR/multiple.rs:37:22 | -LL | #[spirv(uniform, uniform)] _same_storage_class: (), +37 | #[spirv(uniform, uniform)] _same_storage_class: (), | ^^^^^^^ | note: previous storage class attribute --> $DIR/multiple.rs:37:13 | -LL | #[spirv(uniform, uniform)] _same_storage_class: (), +37 | #[spirv(uniform, uniform)] _same_storage_class: (), | ^^^^^^^ error: only one storage class attribute is allowed on a function param --> $DIR/multiple.rs:38:22 | -LL | #[spirv(uniform, push_constant)] _diff_storage_class: (), +38 | #[spirv(uniform, push_constant)] _diff_storage_class: (), | ^^^^^^^^^^^^^ | note: previous storage class attribute --> $DIR/multiple.rs:38:13 | -LL | #[spirv(uniform, push_constant)] _diff_storage_class: (), +38 | #[spirv(uniform, push_constant)] _diff_storage_class: (), | ^^^^^^^ error: only one builtin attribute is allowed on a function param --> $DIR/multiple.rs:40:23 | -LL | #[spirv(position, position)] _same_builtin: (), +40 | #[spirv(position, position)] _same_builtin: (), | ^^^^^^^^ | note: previous builtin attribute --> $DIR/multiple.rs:40:13 | -LL | #[spirv(position, position)] _same_builtin: (), +40 | #[spirv(position, position)] _same_builtin: (), | ^^^^^^^^ error: only one builtin attribute is allowed on a function param --> $DIR/multiple.rs:41:23 | -LL | #[spirv(position, vertex_index)] _diff_builtin: (), +41 | #[spirv(position, vertex_index)] _diff_builtin: (), | ^^^^^^^^^^^^ | note: previous builtin attribute --> $DIR/multiple.rs:41:13 | -LL | #[spirv(position, vertex_index)] _diff_builtin: (), +41 | #[spirv(position, vertex_index)] _diff_builtin: (), | ^^^^^^^^ error: only one #[spirv(descriptor_set)] attribute is allowed on a function param --> $DIR/multiple.rs:43:33 | -LL | #[spirv(descriptor_set = 0, descriptor_set = 0)] _same_descriptor_set: (), +43 | #[spirv(descriptor_set = 0, descriptor_set = 0)] _same_descriptor_set: (), | ^^^^^^^^^^^^^^^^^^ | note: previous #[spirv(descriptor_set)] attribute --> $DIR/multiple.rs:43:13 | -LL | #[spirv(descriptor_set = 0, descriptor_set = 0)] _same_descriptor_set: (), +43 | #[spirv(descriptor_set = 0, descriptor_set = 0)] _same_descriptor_set: (), | ^^^^^^^^^^^^^^^^^^ error: only one #[spirv(descriptor_set)] attribute is allowed on a function param --> $DIR/multiple.rs:44:33 | -LL | #[spirv(descriptor_set = 0, descriptor_set = 1)] _diff_descriptor_set: (), +44 | #[spirv(descriptor_set = 0, descriptor_set = 1)] _diff_descriptor_set: (), | ^^^^^^^^^^^^^^^^^^ | note: previous #[spirv(descriptor_set)] attribute --> $DIR/multiple.rs:44:13 | -LL | #[spirv(descriptor_set = 0, descriptor_set = 1)] _diff_descriptor_set: (), +44 | #[spirv(descriptor_set = 0, descriptor_set = 1)] _diff_descriptor_set: (), | ^^^^^^^^^^^^^^^^^^ error: only one #[spirv(binding)] attribute is allowed on a function param --> $DIR/multiple.rs:46:26 | -LL | #[spirv(binding = 0, binding = 0)] _same_binding: (), +46 | #[spirv(binding = 0, binding = 0)] _same_binding: (), | ^^^^^^^^^^^ | note: previous #[spirv(binding)] attribute --> $DIR/multiple.rs:46:13 | -LL | #[spirv(binding = 0, binding = 0)] _same_binding: (), +46 | #[spirv(binding = 0, binding = 0)] _same_binding: (), | ^^^^^^^^^^^ error: only one #[spirv(binding)] attribute is allowed on a function param --> $DIR/multiple.rs:47:26 | -LL | #[spirv(binding = 0, binding = 1)] _diff_binding: (), +47 | #[spirv(binding = 0, binding = 1)] _diff_binding: (), | ^^^^^^^^^^^ | note: previous #[spirv(binding)] attribute --> $DIR/multiple.rs:47:13 | -LL | #[spirv(binding = 0, binding = 1)] _diff_binding: (), +47 | #[spirv(binding = 0, binding = 1)] _diff_binding: (), | ^^^^^^^^^^^ error: only one #[spirv(flat)] attribute is allowed on a function param --> $DIR/multiple.rs:49:19 | -LL | #[spirv(flat, flat)] _flat: (), +49 | #[spirv(flat, flat)] _flat: (), | ^^^^ | note: previous #[spirv(flat)] attribute --> $DIR/multiple.rs:49:13 | -LL | #[spirv(flat, flat)] _flat: (), +49 | #[spirv(flat, flat)] _flat: (), | ^^^^ error: only one #[spirv(invariant)] attribute is allowed on a function param --> $DIR/multiple.rs:51:24 | -LL | #[spirv(invariant, invariant)] _invariant: (), +51 | #[spirv(invariant, invariant)] _invariant: (), | ^^^^^^^^^ | note: previous #[spirv(invariant)] attribute --> $DIR/multiple.rs:51:13 | -LL | #[spirv(invariant, invariant)] _invariant: (), +51 | #[spirv(invariant, invariant)] _invariant: (), | ^^^^^^^^^ error: aborting due to 17 previous errors; 1 warning emitted diff --git a/tests/compiletests/ui/storage_class/mutability-errors.stderr b/tests/compiletests/ui/storage_class/mutability-errors.stderr index f975b46b74..dc0a1c17dc 100644 --- a/tests/compiletests/ui/storage_class/mutability-errors.stderr +++ b/tests/compiletests/ui/storage_class/mutability-errors.stderr @@ -1,79 +1,79 @@ error: entry-point requires a mutable reference... --> $DIR/mutability-errors.rs:10:78 | -LL | #[spirv(descriptor_set = 0, binding = 0)] implicit_uniform_constant_mut: &mut Image2d, +10 | #[spirv(descriptor_set = 0, binding = 0)] implicit_uniform_constant_mut: &mut Image2d, | ^^^^^^^^^^^^ | note: ...but storage class `UniformConstant` is read-only --> $DIR/mutability-errors.rs:10:78 | -LL | #[spirv(descriptor_set = 0, binding = 0)] implicit_uniform_constant_mut: &mut Image2d, +10 | #[spirv(descriptor_set = 0, binding = 0)] implicit_uniform_constant_mut: &mut Image2d, | ^^^^^^^^^^^^ `UniformConstant` deduced from type warning: redundant storage class attribute, storage class is deduced from type --> $DIR/mutability-errors.rs:11:13 | -LL | #[spirv(uniform_constant, descriptor_set = 0, binding = 0)] uniform_constant_mut: &mut Image2d, +11 | #[spirv(uniform_constant, descriptor_set = 0, binding = 0)] uniform_constant_mut: &mut Image2d, | ^^^^^^^^^^^^^^^^ error: entry-point requires a mutable reference... --> $DIR/mutability-errors.rs:11:87 | -LL | #[spirv(uniform_constant, descriptor_set = 0, binding = 0)] uniform_constant_mut: &mut Image2d, +11 | #[spirv(uniform_constant, descriptor_set = 0, binding = 0)] uniform_constant_mut: &mut Image2d, | ^^^^^^^^^^^^ | note: ...but storage class `UniformConstant` is read-only --> $DIR/mutability-errors.rs:11:13 | -LL | #[spirv(uniform_constant, descriptor_set = 0, binding = 0)] uniform_constant_mut: &mut Image2d, +11 | #[spirv(uniform_constant, descriptor_set = 0, binding = 0)] uniform_constant_mut: &mut Image2d, | ^^^^^^^^^^^^^^^^ `UniformConstant` specified in attribute error: entry-point requires a mutable reference... --> $DIR/mutability-errors.rs:12:69 | -LL | #[spirv(uniform, descriptor_set = 0, binding = 0)] uniform_mut: &mut u32, +12 | #[spirv(uniform, descriptor_set = 0, binding = 0)] uniform_mut: &mut u32, | ^^^^^^^^ | note: ...but storage class `Uniform` is read-only --> $DIR/mutability-errors.rs:12:13 | -LL | #[spirv(uniform, descriptor_set = 0, binding = 0)] uniform_mut: &mut u32, +12 | #[spirv(uniform, descriptor_set = 0, binding = 0)] uniform_mut: &mut u32, | ^^^^^^^ `Uniform` specified in attribute error: entry-point requires interior mutability... --> $DIR/mutability-errors.rs:13:78 | -LL | #[spirv(uniform, descriptor_set = 0, binding = 0)] uniform_interior_mut: &AtomicU32, +13 | #[spirv(uniform, descriptor_set = 0, binding = 0)] uniform_interior_mut: &AtomicU32, | ^^^^^^^^^^ | note: ...but storage class `Uniform` is read-only --> $DIR/mutability-errors.rs:13:13 | -LL | #[spirv(uniform, descriptor_set = 0, binding = 0)] uniform_interior_mut: &AtomicU32, +13 | #[spirv(uniform, descriptor_set = 0, binding = 0)] uniform_interior_mut: &AtomicU32, | ^^^^^^^ `Uniform` specified in attribute error: entry-point requires a mutable reference... --> $DIR/mutability-errors.rs:14:48 | -LL | #[spirv(push_constant)] push_constant_mut: &mut u32, +14 | #[spirv(push_constant)] push_constant_mut: &mut u32, | ^^^^^^^^ | note: ...but storage class `PushConstant` is read-only --> $DIR/mutability-errors.rs:14:13 | -LL | #[spirv(push_constant)] push_constant_mut: &mut u32, +14 | #[spirv(push_constant)] push_constant_mut: &mut u32, | ^^^^^^^^^^^^^ `PushConstant` specified in attribute error: entry-point requires interior mutability... --> $DIR/mutability-errors.rs:15:57 | -LL | #[spirv(push_constant)] push_constant_interior_mut: &AtomicU32, +15 | #[spirv(push_constant)] push_constant_interior_mut: &AtomicU32, | ^^^^^^^^^^ | note: ...but storage class `PushConstant` is read-only --> $DIR/mutability-errors.rs:15:13 | -LL | #[spirv(push_constant)] push_constant_interior_mut: &AtomicU32, +15 | #[spirv(push_constant)] push_constant_interior_mut: &AtomicU32, | ^^^^^^^^^^^^^ `PushConstant` specified in attribute error: aborting due to 6 previous errors; 1 warning emitted diff --git a/tests/compiletests/ui/storage_class/runtime_descriptor_array_error.stderr b/tests/compiletests/ui/storage_class/runtime_descriptor_array_error.stderr index d46fcdc9a8..a3c0d1b0b6 100644 --- a/tests/compiletests/ui/storage_class/runtime_descriptor_array_error.stderr +++ b/tests/compiletests/ui/storage_class/runtime_descriptor_array_error.stderr @@ -1,14 +1,14 @@ error: descriptor indexing must use &RuntimeArray, not &[T] - --> $DIR/runtime_descriptor_array_error.rs:7:52 - | -LL | #[spirv(descriptor_set = 0, binding = 0)] one: &[Image!(2D, type=f32, sampled)], - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + --> $DIR/runtime_descriptor_array_error.rs:7:52 + | +7 | #[spirv(descriptor_set = 0, binding = 0)] one: &[Image!(2D, type=f32, sampled)], + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ warning: use &[T] instead of &RuntimeArray - --> $DIR/runtime_descriptor_array_error.rs:8:61 - | -LL | #[spirv(uniform, descriptor_set = 0, binding = 0)] two: &RuntimeArray, - | ^^^^^^^^^^^^^^^^^^ + --> $DIR/runtime_descriptor_array_error.rs:8:61 + | +8 | #[spirv(uniform, descriptor_set = 0, binding = 0)] two: &RuntimeArray, + | ^^^^^^^^^^^^^^^^^^ error: aborting due to 1 previous error; 1 warning emitted From 3301291874aa4969d31c71374e5347517b2a7b15 Mon Sep 17 00:00:00 2001 From: David Palm Date: Thu, 6 Nov 2025 11:28:41 +0100 Subject: [PATCH 15/16] Fix test --- crates/rustc_codegen_spirv/src/linker/test.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/crates/rustc_codegen_spirv/src/linker/test.rs b/crates/rustc_codegen_spirv/src/linker/test.rs index 5dbfc9937a..4aa903c472 100644 --- a/crates/rustc_codegen_spirv/src/linker/test.rs +++ b/crates/rustc_codegen_spirv/src/linker/test.rs @@ -164,7 +164,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())); From c0c12b85091445d5e71307734f3cc4277c66300f Mon Sep 17 00:00:00 2001 From: David Palm Date: Thu, 6 Nov 2025 11:33:13 +0100 Subject: [PATCH 16/16] Undo noise --- crates/rustc_codegen_spirv/build.rs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/crates/rustc_codegen_spirv/build.rs b/crates/rustc_codegen_spirv/build.rs index 6aff010550..754e4f86ff 100644 --- a/crates/rustc_codegen_spirv/build.rs +++ b/crates/rustc_codegen_spirv/build.rs @@ -33,7 +33,7 @@ fn get_rustc_commit_hash() -> Result> { rustc_output("-vV")? .lines() .find_map(|l| l.strip_prefix("commit-hash: ")) - .map(|s| s.to_string()) + .map(ToString::to_string) .ok_or_else(|| "`commit-hash` not found in `rustc -vV` output".into()) } @@ -41,7 +41,7 @@ fn get_required_commit_hash() -> Result> { REQUIRED_RUST_TOOLCHAIN .lines() .find_map(|l| l.strip_prefix("# commit_hash = ")) - .map(|s| s.to_string()) + .map(ToString::to_string) .ok_or_else(|| "`commit_hash` not found in `rust-toolchain.toml`".into()) } @@ -77,11 +77,11 @@ fn check_toolchain_version() -> Result<(), Box> { .unwrap_or_default(); return Err(format!( - r#"error: wrong toolchain detected (found commit hash `{current_hash}`, expected `{required_hash}`). + "error: wrong toolchain detected (found commit hash `{current_hash}`, expected `{required_hash}`). Make sure your `rust-toolchain.toml` file contains the following: ------------- {stripped_toolchain} --------------"# +-------------" ).into()); } }