From f6ebf64e29189043f26cf755f325a473bb1c9309 Mon Sep 17 00:00:00 2001 From: Eduard-Mihai Burtescu Date: Mon, 22 Feb 2021 17:12:54 +0200 Subject: [PATCH 1/3] Replace spirv_std::storage_class::X with &T/&mut T and optionally #[spirv(x)]. --- README.md | 11 +- crates/rustc_codegen_spirv/src/abi.rs | 16 - crates/rustc_codegen_spirv/src/attr.rs | 17 +- .../src/codegen_cx/entry.rs | 92 +- crates/rustc_codegen_spirv/src/symbols.rs | 1 - crates/spirv-builder/src/test/basic.rs | 6 +- crates/spirv-builder/src/test/mod.rs | 8 +- crates/spirv-std/src/lib.rs | 1 - crates/spirv-std/src/storage_class.rs | 216 -- docs/src/attributes.md | 10 +- examples/shaders/mouse-shader/src/lib.rs | 12 +- examples/shaders/simplest-shader/src/lib.rs | 8 +- examples/shaders/sky-shader/src/lib.rs | 14 +- tests/ui/glam/mat3_vec3_multiply.rs | 4 +- tests/ui/image/fetch.rs | 4 +- tests/ui/image/read.rs | 8 +- tests/ui/image/sample.rs | 16 +- tests/ui/image/sample_gradient.rs | 16 +- tests/ui/image/sample_lod.rs | 16 +- tests/ui/image/write.rs | 4 +- tests/ui/lang/control_flow/defer.rs | 4 +- tests/ui/lang/control_flow/for_range.rs | 4 +- .../for_with_custom_range_iter.rs | 4 +- tests/ui/lang/control_flow/if.rs | 4 +- tests/ui/lang/control_flow/if_else.rs | 4 +- tests/ui/lang/control_flow/if_else_if_else.rs | 4 +- tests/ui/lang/control_flow/if_if.rs | 4 +- tests/ui/lang/control_flow/if_return_else.rs | 4 +- .../control_flow/if_return_else_return.rs | 4 +- tests/ui/lang/control_flow/if_while.rs | 4 +- tests/ui/lang/control_flow/ifx2.rs | 4 +- tests/ui/lang/control_flow/while.rs | 4 +- tests/ui/lang/control_flow/while_break.rs | 4 +- tests/ui/lang/control_flow/while_continue.rs | 4 +- tests/ui/lang/control_flow/while_if_break.rs | 4 +- .../control_flow/while_if_break_else_break.rs | 4 +- .../control_flow/while_if_break_if_break.rs | 4 +- .../ui/lang/control_flow/while_if_continue.rs | 4 +- .../while_if_continue_else_continue.rs | 4 +- tests/ui/lang/control_flow/while_return.rs | 4 +- tests/ui/lang/control_flow/while_while.rs | 4 +- .../ui/lang/control_flow/while_while_break.rs | 4 +- .../lang/control_flow/while_while_continue.rs | 4 +- .../lang/control_flow/while_while_if_break.rs | 4 +- .../control_flow/while_while_if_continue.rs | 4 +- tests/ui/lang/core/ops/logical_and.rs | 2 +- .../ui/lang/core/ptr/allocate_const_scalar.rs | 4 +- .../core/ptr/allocate_const_scalar.stderr | 2 +- tests/ui/lang/f32/signum.rs | 3 +- tests/ui/spirv-attr/invalid-target.rs | 168 +- tests/ui/spirv-attr/invalid-target.stderr | 1798 ++++++++--------- tests/ui/spirv-attr/multiple.rs | 9 +- tests/ui/spirv-attr/multiple.stderr | 152 +- tests/ui/storage_class/push_constant.rs | 6 +- 54 files changed, 1256 insertions(+), 1468 deletions(-) delete mode 100644 crates/spirv-std/src/storage_class.rs diff --git a/README.md b/README.md index 3fe37b4138..11051e10d8 100644 --- a/README.md +++ b/README.md @@ -19,12 +19,13 @@ However, many things aren't implemented yet: for example, loops and switches are ![Sky shader](docs/assets/sky.jpg) ```rust -use spirv_std::{glam::{Vec3, Vec4, vec2, vec3}, storage_class::{Input, Output}}; +use glam::{Vec3, Vec4, vec2, vec3}; #[spirv(fragment)] pub fn main( - #[spirv(frag_coord)] in_frag_coord: Input, - mut output: Output, + #[spirv(frag_coord)] in_frag_coord: &Vec4, + #[spirv(push_constant)] constants: &ShaderConstants, + output: &mut Vec4, ) { let frag_coord = vec2(in_frag_coord.x, in_frag_coord.y); let mut uv = (frag_coord - 0.5 * vec2(constants.width as f32, constants.height as f32)) @@ -61,7 +62,7 @@ Our hope with this project is that we push the industry forward by bringing an e ### Why Embark? -At Embark, we've been building our own new game engine from the ground up in Rust. We have previous experience in-house developing the [RLSL](https://github.com/MaikKlein/rlsl) prototype, and we have a team of excellent rendering engineers that are familiar with the problems in current shading languages both from games, game engines and other industries. So, we believe we are uniquely positioned to attempt solving this problem. +At Embark, we've been building our own new game engine from the ground up in Rust. We have previous experience in-house developing the [RLSL](https://github.com/MaikKlein/rlsl) prototype, and we have a team of excellent rendering engineers that are familiar with the problems in current shading languages both from games, game engines and other industries. So, we believe we are uniquely positioned to attempt solving this problem. We want to streamline our own internal development with a single great language, build an open source graphics ecosystem and community, facilitate code-sharing between GPU and CPU, and most importantly: to enable our (future) users, and fellow developers, to more rapidly build great looking and engaging experiences. @@ -71,7 +72,7 @@ If we do this project right, one wouldn't necessarily need an entire team of ren The scope of this overall project is quite broad, but is in multiple stages -- `rustc` compiler backend to generate [SPIR-V], plugging in via `-Z codegen-backend`. +- `rustc` compiler backend to generate [SPIR-V], plugging in via `-Z codegen-backend`. - This is the same mechanism that [rustc_codegen_cranelift](https://github.com/bjorn3/rustc_codegen_cranelift) and [rustc_codegen_gcc](https://github.com/antoyo/rustc_codegen_gcc) use. - Currently only [SPIR-V] support is planned, [Vulkan](https://en.wikipedia.org/wiki/Vulkan_(API))'s open compiler target - Possible a future version could support [DXIL](https://github.com/microsoft/DirectXShaderCompiler/blob/master/docs/DXIL.rst) (the target for DirectX) or [WGSL](https://github.com/gpuweb/gpuweb/tree/main/wgsl) (the WebGPU shading language that's bijective with SPIR-V) diff --git a/crates/rustc_codegen_spirv/src/abi.rs b/crates/rustc_codegen_spirv/src/abi.rs index d0420531f6..3c1e26061f 100644 --- a/crates/rustc_codegen_spirv/src/abi.rs +++ b/crates/rustc_codegen_spirv/src/abi.rs @@ -585,22 +585,6 @@ fn dig_scalar_pointee_adt<'tcx>( } } -/// Handles `#[spirv(storage_class="blah")]`. Note this is only called in the entry interface variables code, because this is only -/// used for spooky builtin stuff, and we pinky promise to never have more than one pointer field in one of these. -// TODO: Enforce this is only used in spirv-std. -pub(crate) fn get_storage_class<'tcx>( - cx: &CodegenCx<'tcx>, - ty: TyAndLayout<'tcx>, -) -> Option { - if let TyKind::Adt(adt, _substs) = ty.ty.kind() { - AggregatedSpirvAttributes::parse(cx, cx.tcx.get_attrs(adt.did)) - .storage_class - .map(|attr| attr.value) - } else { - None - } -} - fn trans_aggregate<'tcx>(cx: &CodegenCx<'tcx>, span: Span, ty: TyAndLayout<'tcx>) -> Word { match ty.fields { FieldsShape::Primitive => cx.tcx.sess.fatal(&format!( diff --git a/crates/rustc_codegen_spirv/src/attr.rs b/crates/rustc_codegen_spirv/src/attr.rs index 7bd98e1a23..49c5494ff0 100644 --- a/crates/rustc_codegen_spirv/src/attr.rs +++ b/crates/rustc_codegen_spirv/src/attr.rs @@ -79,7 +79,6 @@ pub enum IntrinsicType { #[derive(Debug, Clone)] pub enum SpirvAttribute { // `struct` attributes: - StorageClass(StorageClass), IntrinsicType(IntrinsicType), Block, @@ -87,6 +86,7 @@ pub enum SpirvAttribute { Entry(Entry), // (entry) `fn` parameter attributes: + StorageClass(StorageClass), Builtin(BuiltIn), DescriptorSet(u32), Binding(u32), @@ -110,7 +110,6 @@ pub struct Spanned { #[derive(Default)] pub struct AggregatedSpirvAttributes { // `struct` attributes: - pub storage_class: Option>, pub intrinsic_type: Option>, pub block: Option>, @@ -118,6 +117,7 @@ pub struct AggregatedSpirvAttributes { pub entry: Option>, // (entry) `fn` parameter attributes: + pub storage_class: Option>, pub builtin: Option>, pub descriptor_set: Option>, pub binding: Option>, @@ -187,14 +187,14 @@ impl AggregatedSpirvAttributes { use SpirvAttribute::*; match attr { - StorageClass(value) => { - try_insert(&mut self.storage_class, value, span, "storage class") - } IntrinsicType(value) => { try_insert(&mut self.intrinsic_type, value, span, "intrinsic type") } Block => try_insert(&mut self.block, (), span, "#[spirv(block)]"), Entry(value) => try_insert(&mut self.entry, value, span, "entry-point"), + StorageClass(value) => { + try_insert(&mut self.storage_class, value, span, "storage class") + } Builtin(value) => try_insert(&mut self.builtin, value, span, "builtin"), DescriptorSet(value) => try_insert( &mut self.descriptor_set, @@ -259,9 +259,7 @@ impl CheckSpirvAttrVisitor<'_> { struct Expected(T); let valid_target = match parsed_attr { - SpirvAttribute::StorageClass(_) - | SpirvAttribute::IntrinsicType(_) - | SpirvAttribute::Block => match target { + SpirvAttribute::IntrinsicType(_) | SpirvAttribute::Block => match target { Target::Struct => { // FIXME(eddyb) further check type attribute validity, // e.g. layout, generics, other attributes, etc. @@ -283,7 +281,8 @@ impl CheckSpirvAttrVisitor<'_> { _ => Err(Expected("function")), }, - SpirvAttribute::Builtin(_) + SpirvAttribute::StorageClass(_) + | SpirvAttribute::Builtin(_) | SpirvAttribute::DescriptorSet(_) | SpirvAttribute::Binding(_) | SpirvAttribute::Flat => match target { diff --git a/crates/rustc_codegen_spirv/src/codegen_cx/entry.rs b/crates/rustc_codegen_spirv/src/codegen_cx/entry.rs index 00ee986432..78cfe8c074 100644 --- a/crates/rustc_codegen_spirv/src/codegen_cx/entry.rs +++ b/crates/rustc_codegen_spirv/src/codegen_cx/entry.rs @@ -7,7 +7,7 @@ use rspirv::dr::Operand; use rspirv::spirv::{Decoration, ExecutionModel, FunctionControl, StorageClass, Word}; use rustc_hir as hir; use rustc_middle::ty::layout::TyAndLayout; -use rustc_middle::ty::{Instance, Ty}; +use rustc_middle::ty::{Instance, Ty, TyKind}; use rustc_span::Span; use rustc_target::abi::call::{FnAbi, PassMode}; use std::collections::HashMap; @@ -148,33 +148,38 @@ impl<'tcx> CodegenCx<'tcx> { hir_param: &hir::Param<'tcx>, decoration_locations: &mut HashMap, ) -> (Word, StorageClass) { - let storage_class = crate::abi::get_storage_class(self, layout).unwrap_or_else(|| { - self.tcx.sess.span_fatal( + let writable = match layout.ty.kind() { + // FIXME(eddyb) also take into account `&T` interior mutability, + // i.e. it's only immutable if `T: Freeze`, which we should check. + // FIXME(eddyb) also check the type for compatibility with being + // part of the interface, including potentially `Sync`ness etc. + TyKind::Ref(_, _, m) => *m == hir::Mutability::Mut, + + _ => self.tcx.sess.span_fatal( hir_param.span, - &format!("invalid entry param type `{}`", layout.ty), - ); - }); - let mut has_location = matches!( - storage_class, - StorageClass::Input | StorageClass::Output | StorageClass::UniformConstant - ); - // Note: this *declares* the variable too. - let spirv_type = layout.spirv_type(hir_param.span, self); - let variable = self - .emit_global() - .variable(spirv_type, None, storage_class, None); + &format!( + "invalid entry param type `{}` (expected `&T` or `&mut T`)", + layout.ty + ), + ), + }; + + // Pre-allocate the module-scoped `OpVariable`'s *Result* ID. + let variable = self.emit_global().id(); + if let hir::PatKind::Binding(_, _, ident, _) = &hir_param.pat.kind { self.emit_global().name(variable, ident.to_string()); } let attrs = AggregatedSpirvAttributes::parse(self, self.tcx.hir().attrs(hir_param.hir_id)); + let mut decoration_supersedes_location = false; if let Some(builtin) = attrs.builtin.map(|attr| attr.value) { self.emit_global().decorate( variable, Decoration::BuiltIn, std::iter::once(Operand::BuiltIn(builtin)), ); - has_location = false; + decoration_supersedes_location = true; } if let Some(index) = attrs.descriptor_set.map(|attr| attr.value) { self.emit_global().decorate( @@ -182,7 +187,7 @@ impl<'tcx> CodegenCx<'tcx> { Decoration::DescriptorSet, std::iter::once(Operand::LiteralInt32(index)), ); - has_location = false; + decoration_supersedes_location = true; } if let Some(index) = attrs.binding.map(|attr| attr.value) { self.emit_global().decorate( @@ -190,17 +195,62 @@ impl<'tcx> CodegenCx<'tcx> { Decoration::Binding, std::iter::once(Operand::LiteralInt32(index)), ); - has_location = false; + decoration_supersedes_location = true; } if attrs.flat.is_some() { self.emit_global() .decorate(variable, Decoration::Flat, std::iter::empty()); } + let storage_class = if let Some(storage_class_attr) = attrs.storage_class { + // FIXME(eddyb) attribute validation should be done ahead of time. + let valid = match storage_class_attr.value { + StorageClass::UniformConstant + | StorageClass::Input + | StorageClass::PushConstant + if writable => + { + Err("can only be used with immutable references") + } + + StorageClass::Input | StorageClass::Output => { + Err("is the default and should not be explicitly specified") + } + + StorageClass::Private | StorageClass::Function | StorageClass::Generic => { + Err("can not be used as part of an entry's interface") + } + + _ => Ok(()), + }; + + if let Err(msg) = valid { + self.tcx.sess.span_err( + storage_class_attr.span, + &format!("`{:?}` storage class {}", storage_class_attr.value, msg), + ); + } + + storage_class_attr.value + } else if writable { + StorageClass::Output + } else { + StorageClass::Input + }; + + // FIXME(eddyb) check whether the storage class is compatible with the + // specific shader stage of this entry-point, and any decorations + // (e.g. Vulkan has specific rules for builtin storage classes). + // Assign locations from left to right, incrementing each storage class // individually. // TODO: Is this right for UniformConstant? Do they share locations with // input/outpus? + let has_location = !decoration_supersedes_location + && matches!( + storage_class, + StorageClass::Input | StorageClass::Output | StorageClass::UniformConstant + ); if has_location { let location = decoration_locations .entry(storage_class) @@ -212,6 +262,12 @@ impl<'tcx> CodegenCx<'tcx> { ); *location += 1; } + + // Emit the `OpVariable` with its *Result* ID set to `variable`. + let spirv_type = layout.spirv_type(hir_param.span, self); + self.emit_global() + .variable(spirv_type, Some(variable), storage_class, None); + (variable, storage_class) } diff --git a/crates/rustc_codegen_spirv/src/symbols.rs b/crates/rustc_codegen_spirv/src/symbols.rs index 6033f6efbb..135f3f6b54 100644 --- a/crates/rustc_codegen_spirv/src/symbols.rs +++ b/crates/rustc_codegen_spirv/src/symbols.rs @@ -153,7 +153,6 @@ const BUILTINS: &[(&str, BuiltIn)] = { const STORAGE_CLASSES: &[(&str, StorageClass)] = { use StorageClass::*; - // make sure these strings stay synced with spirv-std's pointer types &[ ("uniform_constant", UniformConstant), ("input", Input), diff --git a/crates/spirv-builder/src/test/basic.rs b/crates/spirv-builder/src/test/basic.rs index fd32fa61c3..2e7e9ee2bb 100644 --- a/crates/spirv-builder/src/test/basic.rs +++ b/crates/spirv-builder/src/test/basic.rs @@ -216,7 +216,7 @@ pub struct ShaderConstants { } #[spirv(fragment)] -pub fn main(constants: PushConstant) { +pub fn main(#[spirv(push_constant)] constants: &ShaderConstants) { let _constants = *constants; } "#, @@ -371,8 +371,8 @@ macro_rules! test_copy_via_raw_ptr { } } #[spirv(fragment)] - pub fn main(i: Input, mut o: Output) { - copy_via_raw_ptr(&i, &mut o); + pub fn main(i: &f32, o: &mut f32) { + copy_via_raw_ptr(i, o); // FIXME(eddyb) above call results in inlining `copy_via_raw_ptr`, // due to the to `Input`/`Output` storage classes, so to get the // disassembled function we also need `Function`-local pointers: diff --git a/crates/spirv-builder/src/test/mod.rs b/crates/spirv-builder/src/test/mod.rs index 0dc909ae0a..52570a37f9 100644 --- a/crates/spirv-builder/src/test/mod.rs +++ b/crates/spirv-builder/src/test/mod.rs @@ -58,10 +58,10 @@ path="../../crates/spirv-std" static SRC_PREFIX: &str = r#"#![no_std] #![feature(register_attr, asm, ptr_internals)] #![register_attr(spirv)] -#![allow(unused_imports)] -use spirv_std::*; -use spirv_std::storage_class::*; -use spirv_std::num_traits::Float; +#![deny(warnings)] + +#[allow(unused_imports)] +use spirv_std::{*, num_traits::Float as _ }; "#; fn setup(src: &str) -> Result> { diff --git a/crates/spirv-std/src/lib.rs b/crates/spirv-std/src/lib.rs index 7ee0191e63..ed904e8555 100644 --- a/crates/spirv-std/src/lib.rs +++ b/crates/spirv-std/src/lib.rs @@ -74,7 +74,6 @@ pub mod float; pub mod integer; pub mod scalar; pub(crate) mod sealed; -pub mod storage_class; mod textures; pub mod vector; diff --git a/crates/spirv-std/src/storage_class.rs b/crates/spirv-std/src/storage_class.rs deleted file mode 100644 index ebb6b066b5..0000000000 --- a/crates/spirv-std/src/storage_class.rs +++ /dev/null @@ -1,216 +0,0 @@ -//! # Storage Classes -//! -//! Class of storage for declared variables. These types act as pointers to -//! values either contained in the GPU's memory. For example; `Input` points to a -//! `f32` that was provided as input from the pipeline, and `Private` -//! points to a `f32` in the GPU's global memory. Intermediate values do not -//! form a storage class, and unless stated otherwise, storage class-based -//! restrictions are not restrictions on intermediate objects and their types. - -use core::ops::{Deref, DerefMut}; - -macro_rules! storage_class { - ($(#[$($meta:meta)+])* storage_class $name:ident ; $($tt:tt)*) => { - $(#[$($meta)+])* - pub struct $name<'value, T: ?Sized> { - reference: &'value mut T, - } - - impl Deref for $name<'_, T> { - type Target = T; - fn deref(&self) -> &T { - self.reference - } - } - - impl $name<'_, T> { - /// Load the value into memory. - #[deprecated(note = "storage_class::Foo types now implement Deref, and can be used like &T")] - pub fn load(&self) -> T { - **self - } - } - - storage_class!($($tt)*); - }; - - // Methods available on writeable storage classes. - ($(#[$($meta:meta)+])* writeable storage_class $name:ident $($tt:tt)+) => { - storage_class!($(#[$($meta)+])* storage_class $name $($tt)+); - - impl DerefMut for $name<'_, T> { - fn deref_mut(&mut self) -> &mut T { - self.reference - } - } - - impl $name<'_, T> { - /// Store the value in storage. - #[deprecated(note = "storage_class::Foo types now implement DerefMut, and can be used like &mut T")] - pub fn store(&mut self, v: T) { - **self = v - } - - /// A convenience function to load a value into memory and store it. - #[deprecated(note = "storage_class::Foo types now implement DerefMut, and can be used like &mut T")] - pub fn then(&mut self, f: impl FnOnce(T) -> T) { - **self = f(**self); - } - } - }; - - (;) => {}; - () => {}; -} - -// Make sure the `#[spirv()]` strings stay synced with symbols.rs -// in `rustc_codegen_spirv`. -storage_class! { - /// Graphics uniform memory. OpenCL constant memory. - /// - /// Shared externally, visible across all functions in all invocations in - /// all work groups. Variables declared with this storage class are - /// read-only. They may have initializers, as allowed by the client API. - #[spirv(uniform_constant)] storage_class UniformConstant; - - /// Input from pipeline. - /// - /// Visible across all functions in the current invocation. Variables - /// declared with this storage class are read-only, and must not - /// have initializers. - #[spirv(input)] storage_class Input; - - /// Graphics uniform blocks and buffer blocks. - /// - /// Shared externally, visible across all functions in all invocations in - /// all work groups. Requires "Shader" capability. - #[spirv(uniform)] writeable storage_class Uniform; - - /// Output to pipeline. - /// - /// Visible across all functions in the current invocation. - #[spirv(output)] writeable storage_class Output; - - /// The OpenGL "shared" storage qualifier. OpenCL local memory. - /// - /// Shared across all invocations within a work group. Visible across - /// all functions. - #[spirv(workgroup)] writeable storage_class Workgroup; - - /// OpenCL global memory. - /// - /// Visible across all functions of all invocations of all work groups. - #[spirv(cross_workgroup)] writeable storage_class CrossWorkgroup; - - /// Regular global memory. - /// - /// Visible to all functions in the current invocation. Requires - /// "Shader" capability. - #[spirv(private)] writeable storage_class Private; - - /// Regular function memory. - /// - /// Visible only within the declaring function of the current invocation. - #[spirv(function)] writeable storage_class Function; - - /// For generic pointers, which overload the [`Function`], [`Workgroup`], - /// and [`CrossWorkgroup`] Storage Classes. - #[spirv(generic)] writeable storage_class Generic; - - /// Push-constant memory. - /// - /// Visible across all functions in all invocations in all work groups. - /// Intended to contain a small bank of values pushed from the client API. - /// Variables declared with this storage class are read-only, and must not - /// have initializers. - #[spirv(push_constant)] storage_class PushConstant; - - /// Atomic counter-specific memory. - /// - /// For holding atomic counters. Visible across all functions of the - /// current invocation. - #[spirv(atomic_counter)] writeable storage_class AtomicCounter; - - /// Image memory. - /// - /// Holds a pointer to a single texel, obtained via OpImageTexelPointer. Use of a pointer - /// obtained via OpImageTexelPointer is limited to atomic operations. - /// - /// If you're looking to create a pointer to an entire image instead of a texel, you probably - /// want UniformConstant instead. - #[spirv(image)] writeable storage_class Image; - - /// Graphics storage buffers (buffer blocks). - /// - /// Shared externally, readable and writable, visible across all functions - /// in all invocations in all work groups. - #[spirv(storage_buffer)] writeable storage_class StorageBuffer; - - /// Used for storing arbitrary data associated with a ray to pass - /// to callables. (Requires `SPV_KHR_ray_tracing` extension) - /// - /// Visible across all functions in the current invocation. Not shared - /// externally. Variables declared with this storage class can be both read - /// and written to. Only allowed in `RayGenerationKHR`, `ClosestHitKHR`, - /// `CallableKHR`, and `MissKHR` execution models. - #[spirv(callable_data_khr)] writeable storage_class CallableDataKHR; - - /// Used for storing arbitrary data from parent sent to current callable - /// stage invoked from an `executeCallable` call. (Requires - /// `SPV_KHR_ray_tracing` extension) - /// - /// Visible across all functions in current invocation. Not shared - /// externally. Variables declared with the storage class are allowed only - /// in `CallableKHR` execution models. Can be both read and written to in - /// above execution models. - #[spirv(incoming_callable_data_khr)] writeable storage_class IncomingCallableDataKHR; - - /// Used for storing payload data associated with a ray. (Requires - /// `SPV_KHR_ray_tracing` extension) - /// - /// Visible across all functions in the current invocation. Not shared - /// externally. Variables declared with this storage class can be both read - /// and written to. Only allowed in `RayGenerationKHR`, `AnyHitKHR`, - /// `ClosestHitKHR` and `MissKHR` execution models. - #[spirv(ray_payload_khr)] writeable storage_class RayPayloadKHR; - - - /// Used for storing attributes of geometry intersected by a ray. (Requires - /// `SPV_KHR_ray_tracing` extension) - /// - /// Visible across all functions in the current invocation. Not shared - /// externally. Variables declared with this storage class are allowed only - /// in `IntersectionKHR`, `AnyHitKHR` and `ClosestHitKHR` execution models. - /// They can be written to only in `IntersectionKHR` execution model and read - /// from only in `AnyHitKHR` and `ClosestHitKHR` execution models. - #[spirv(hit_attribute_khr)] writeable storage_class HitAttributeKHR; - - - /// Used for storing attributes of geometry intersected by a ray. (Requires - /// `SPV_KHR_ray_tracing` extension) - /// - /// Visible across all functions in the current invocation. Not shared - /// externally. Variables declared with this storage class are allowed only - /// in `IntersectionKHR`, `AnyHitKHR` and `ClosestHitKHR` execution models. - /// They can be written to only in `IntersectionKHR` execution model and - /// read from only in `AnyHitKHR` and `ClosestHitKHR` execution models. They - /// cannot have initializers. - #[spirv(incoming_ray_payload_khr)] writeable storage_class IncomingRayPayloadKHR; - - /// Used for storing data in shader record associated with each unique - /// shader in ray_tracing pipeline. (Requires - /// `SPV_KHR_ray_tracing` extension) - /// - /// Visible across all functions in current invocation. Can be initialized - /// externally via API. Variables declared with this storage class are - /// allowed in RayGenerationKHR, IntersectionKHR, AnyHitKHR, ClosestHitKHR, - /// MissKHR and CallableKHR execution models, are read-only, and cannot have - /// initializers. Refer to the client API for details on shader records. - #[spirv(shader_record_buffer_khr)] writeable storage_class ShaderRecordBufferKHR; - - /// Graphics storage buffers using physical addressing. (SPIR-V 1.5+) - /// - /// Shared externally, readable and writable, visible across all functions - /// in all invocations in all work groups. - #[spirv(physical_storage_buffer)] writeable storage_class PhysicalStorageBuffer; -} diff --git a/docs/src/attributes.md b/docs/src/attributes.md index 13922ea8cd..67819909bd 100644 --- a/docs/src/attributes.md +++ b/docs/src/attributes.md @@ -45,9 +45,9 @@ When declaring inputs and outputs, sometimes you want to declare it as a "builti Example: ```rust -#[spirv(fragment)] +#[spirv(vertex)] fn main( - #[spirv(position)] mut out_pos: Output, + #[spirv(position)] out_pos: &mut Vec4, ) { } ``` @@ -62,7 +62,7 @@ Example: ```rust #[spirv(fragment)] fn main( - #[spirv(descriptor_set = 2, binding = 5)] mut var: Uniform, + #[spirv(uniform, descriptor_set = 2, binding = 5)] var: &mut Vec4, ) { } ``` @@ -83,7 +83,7 @@ struct Thing { } #[spirv(fragment)] -fn main(obj: PushConstant) { } +fn main(#[spirv(push_constant)] obj: &ShaderConstants) { } ``` ## Flat @@ -94,5 +94,5 @@ Example: ```rust #[spirv(fragment)] -fn main(#[spirv(flat)] obj: Input) { } +fn main(#[spirv(flat)] obj: &u32) { } ``` diff --git a/examples/shaders/mouse-shader/src/lib.rs b/examples/shaders/mouse-shader/src/lib.rs index a0e53ef2d4..27cb55f80f 100644 --- a/examples/shaders/mouse-shader/src/lib.rs +++ b/examples/shaders/mouse-shader/src/lib.rs @@ -10,7 +10,6 @@ use core::f32::consts::PI; use glam::{const_vec4, vec2, vec3, Mat2, Vec2, Vec3, Vec4, Vec4Swizzles}; use shared::*; -use spirv_std::storage_class::{Input, Output, PushConstant}; // Note: This cfg is incorrect on its surface, it really should be "are we compiling with std", but // we tie #[no_std] above to the same condition, so it's fine. @@ -144,9 +143,9 @@ impl Painter { #[spirv(fragment)] pub fn main_fs( - #[spirv(frag_coord)] in_frag_coord: Input, - constants: PushConstant, - mut output: Output, + #[spirv(frag_coord)] in_frag_coord: &Vec4, + #[spirv(push_constant)] constants: &ShaderConstants, + output: &mut Vec4, ) { let frag_coord = vec2(in_frag_coord.x, in_frag_coord.y); @@ -252,10 +251,7 @@ pub fn main_fs( } #[spirv(vertex)] -pub fn main_vs( - #[spirv(vertex_index)] vert_idx: Input, - #[spirv(position)] mut builtin_pos: Output, -) { +pub fn main_vs(#[spirv(vertex_index)] vert_idx: &i32, #[spirv(position)] builtin_pos: &mut Vec4) { let vert_idx = *vert_idx; // Create a "full screen triangle" by mapping the vertex index. diff --git a/examples/shaders/simplest-shader/src/lib.rs b/examples/shaders/simplest-shader/src/lib.rs index 454abff5ad..8d59bd5f63 100644 --- a/examples/shaders/simplest-shader/src/lib.rs +++ b/examples/shaders/simplest-shader/src/lib.rs @@ -11,18 +11,14 @@ #[macro_use] pub extern crate spirv_std_macros; use shared::glam::{vec4, Vec4}; -use spirv_std::storage_class::{Input, Output}; #[spirv(fragment)] -pub fn main_fs(mut output: Output) { +pub fn main_fs(output: &mut Vec4) { *output = vec4(1.0, 0.0, 0.0, 1.0); } #[spirv(vertex)] -pub fn main_vs( - #[spirv(vertex_index)] vert_id: Input, - #[spirv(position)] mut out_pos: Output, -) { +pub fn main_vs(#[spirv(vertex_index)] vert_id: &i32, #[spirv(position)] out_pos: &mut Vec4) { let vert_id = *vert_id; *out_pos = vec4( (vert_id - 1) as f32, diff --git a/examples/shaders/sky-shader/src/lib.rs b/examples/shaders/sky-shader/src/lib.rs index e3db4eca74..7a57408e79 100644 --- a/examples/shaders/sky-shader/src/lib.rs +++ b/examples/shaders/sky-shader/src/lib.rs @@ -16,7 +16,6 @@ pub extern crate spirv_std_macros; use core::f32::consts::PI; use glam::{const_vec3, vec2, vec3, Vec2, Vec3, Vec4}; use shared::*; -use spirv_std::storage_class::{Input, Output, PushConstant}; // Note: This cfg is incorrect on its surface, it really should be "are we compiling with std", but // we tie #[no_std] above to the same condition, so it's fine. @@ -160,19 +159,16 @@ pub fn fs(constants: &ShaderConstants, frag_coord: Vec2) -> Vec4 { #[spirv(fragment)] pub fn main_fs( - #[spirv(frag_coord)] in_frag_coord: Input, - constants: PushConstant, - mut output: Output, + #[spirv(frag_coord)] in_frag_coord: &Vec4, + #[spirv(push_constant)] constants: &ShaderConstants, + output: &mut Vec4, ) { let frag_coord = vec2(in_frag_coord.x, in_frag_coord.y); - *output = fs(&constants, frag_coord); + *output = fs(constants, frag_coord); } #[spirv(vertex)] -pub fn main_vs( - #[spirv(vertex_index)] vert_idx: Input, - #[spirv(position)] mut builtin_pos: Output, -) { +pub fn main_vs(#[spirv(vertex_index)] vert_idx: &i32, #[spirv(position)] builtin_pos: &mut Vec4) { let vert_idx = *vert_idx; // Create a "full screen triangle" by mapping the vertex index. diff --git a/tests/ui/glam/mat3_vec3_multiply.rs b/tests/ui/glam/mat3_vec3_multiply.rs index cf2db69979..1bbf198a48 100644 --- a/tests/ui/glam/mat3_vec3_multiply.rs +++ b/tests/ui/glam/mat3_vec3_multiply.rs @@ -1,10 +1,10 @@ // Tests muiltplying a `Mat3` by a `Vec3`. // build-pass -use spirv_std::storage_class::{Input, Output}; +use spirv_std as _; #[spirv(fragment)] -pub fn main(input: Input, mut output: Output) { +pub fn main(input: &glam::Mat3, output: &mut glam::Vec3) { let input = *input; let vector = input * glam::Vec3::new(1.0, 2.0, 3.0); *output = vector; diff --git a/tests/ui/image/fetch.rs b/tests/ui/image/fetch.rs index 6243462f56..cd83fa85ba 100644 --- a/tests/ui/image/fetch.rs +++ b/tests/ui/image/fetch.rs @@ -1,9 +1,9 @@ // build-pass -use spirv_std::{arch, storage_class::{Output, UniformConstant}, Image2d}; +use spirv_std::{arch, Image2d}; #[spirv(fragment)] -pub fn main(image: UniformConstant, mut output: Output) { +pub fn main(#[spirv(uniform_constant)] image: &Image2d, output: &mut glam::Vec4) { let texel = image.fetch(glam::IVec2::new(0, 1)); *output = texel; } diff --git a/tests/ui/image/read.rs b/tests/ui/image/read.rs index 986cacd44e..849f5fd2f1 100644 --- a/tests/ui/image/read.rs +++ b/tests/ui/image/read.rs @@ -1,14 +1,10 @@ // Test `OpImageRead` // build-pass -use spirv_std::{ - arch, - storage_class::{Output, UniformConstant}, - StorageImage2d, -}; +use spirv_std::{arch, StorageImage2d}; #[spirv(fragment)] -pub fn main(image: UniformConstant, mut output: Output) { +pub fn main(#[spirv(uniform_constant)] image: &StorageImage2d, output: &mut glam::Vec2) { let coords = image.read(glam::IVec2::new(0, 1)); *output = coords; } diff --git a/tests/ui/image/sample.rs b/tests/ui/image/sample.rs index e90c2dce4d..176ec08492 100644 --- a/tests/ui/image/sample.rs +++ b/tests/ui/image/sample.rs @@ -1,19 +1,15 @@ // Test `OpImageSampleImplicitLod` // build-pass -use spirv_std::{ - arch, - storage_class::{Output, UniformConstant}, - Cubemap, Image2d, Image2dArray, Sampler, -}; +use spirv_std::{arch, Cubemap, Image2d, Image2dArray, Sampler}; #[spirv(fragment)] pub fn main( - image2d: UniformConstant, - image2d_array: UniformConstant, - cubemap: UniformConstant, - sampler: UniformConstant, - mut output: Output, + #[spirv(uniform_constant)] image2d: &Image2d, + #[spirv(uniform_constant)] image2d_array: &Image2dArray, + #[spirv(uniform_constant)] cubemap: &Cubemap, + #[spirv(uniform_constant)] sampler: &Sampler, + output: &mut glam::Vec4, ) { let v2 = glam::Vec2::new(0.0, 1.0); let v3 = glam::Vec3::new(0.0, 1.0, 0.5); diff --git a/tests/ui/image/sample_gradient.rs b/tests/ui/image/sample_gradient.rs index 9ba2bc5b8c..24e20a2bec 100644 --- a/tests/ui/image/sample_gradient.rs +++ b/tests/ui/image/sample_gradient.rs @@ -1,19 +1,15 @@ // Test `OpImageSampleExplicitLod` Grad // build-pass -use spirv_std::{ - arch, - storage_class::{Output, UniformConstant}, - Cubemap, Image2d, Image2dArray, Sampler, -}; +use spirv_std::{arch, Cubemap, Image2d, Image2dArray, Sampler}; #[spirv(fragment)] pub fn main( - image2d: UniformConstant, - image2d_array: UniformConstant, - cubemap: UniformConstant, - sampler: UniformConstant, - mut output: Output, + #[spirv(uniform_constant)] image2d: &Image2d, + #[spirv(uniform_constant)] image2d_array: &Image2dArray, + #[spirv(uniform_constant)] cubemap: &Cubemap, + #[spirv(uniform_constant)] sampler: &Sampler, + output: &mut glam::Vec4, ) { let v2 = glam::Vec2::new(0.0, 1.0); let v3 = glam::Vec3::new(0.0, 1.0, 0.5); diff --git a/tests/ui/image/sample_lod.rs b/tests/ui/image/sample_lod.rs index 78d3f4d0f2..a547d5e370 100644 --- a/tests/ui/image/sample_lod.rs +++ b/tests/ui/image/sample_lod.rs @@ -1,19 +1,15 @@ // Test `OpImageSampleExplicitLod` Lod // build-pass -use spirv_std::{ - arch, - storage_class::{Output, UniformConstant}, - Cubemap, Image2d, Image2dArray, Sampler, -}; +use spirv_std::{arch, Cubemap, Image2d, Image2dArray, Sampler}; #[spirv(fragment)] pub fn main( - image2d: UniformConstant, - image2d_array: UniformConstant, - cubemap: UniformConstant, - sampler: UniformConstant, - mut output: Output, + #[spirv(uniform_constant)] image2d: &Image2d, + #[spirv(uniform_constant)] image2d_array: &Image2dArray, + #[spirv(uniform_constant)] cubemap: &Cubemap, + #[spirv(uniform_constant)] sampler: &Sampler, + output: &mut glam::Vec4, ) { let v2 = glam::Vec2::new(0.0, 1.0); let v3 = glam::Vec3::new(0.0, 1.0, 0.5); diff --git a/tests/ui/image/write.rs b/tests/ui/image/write.rs index 703392a520..ad2bf39f75 100644 --- a/tests/ui/image/write.rs +++ b/tests/ui/image/write.rs @@ -1,10 +1,10 @@ // Test `OpImageWrite` // build-pass -use spirv_std::{arch, storage_class::{Input, Output, UniformConstant}, StorageImage2d}; +use spirv_std::{arch, StorageImage2d}; #[spirv(fragment)] -pub fn main(input: Input, image: UniformConstant) { +pub fn main(input: &glam::Vec2, #[spirv(uniform_constant)] image: &StorageImage2d) { let texels = *input; unsafe { image.write(glam::UVec2::new(0, 1), texels); diff --git a/tests/ui/lang/control_flow/defer.rs b/tests/ui/lang/control_flow/defer.rs index e1f38b3356..bc5c257ab5 100644 --- a/tests/ui/lang/control_flow/defer.rs +++ b/tests/ui/lang/control_flow/defer.rs @@ -1,9 +1,9 @@ // build-pass -use spirv_std::storage_class::Input; +use spirv_std as _; #[spirv(fragment)] -pub fn main(i: Input) { +pub fn main(i: &i32) { while *i < 32 { let current_position = 0; if *i < current_position { diff --git a/tests/ui/lang/control_flow/for_range.rs b/tests/ui/lang/control_flow/for_range.rs index 90518fb169..2121fa316c 100644 --- a/tests/ui/lang/control_flow/for_range.rs +++ b/tests/ui/lang/control_flow/for_range.rs @@ -1,9 +1,9 @@ // build-pass -use spirv_std::storage_class::Input; +use spirv_std as _; #[spirv(fragment)] -pub fn main(i: Input) { +pub fn main(i: &i32) { for _ in 0..*i { } } diff --git a/tests/ui/lang/control_flow/for_with_custom_range_iter.rs b/tests/ui/lang/control_flow/for_with_custom_range_iter.rs index 6b0b9bbb6b..1e7df3de39 100644 --- a/tests/ui/lang/control_flow/for_with_custom_range_iter.rs +++ b/tests/ui/lang/control_flow/for_with_custom_range_iter.rs @@ -6,7 +6,7 @@ // build-pass -use spirv_std::{num_traits::Num, storage_class::Input}; +use spirv_std::num_traits::Num; use core::ops::Range; struct RangeIter(Range); @@ -25,7 +25,7 @@ impl Iterator for RangeIter { } #[spirv(fragment)] -pub fn main(i: Input) { +pub fn main(i: &i32) { for _ in RangeIter(0..*i) { } } diff --git a/tests/ui/lang/control_flow/if.rs b/tests/ui/lang/control_flow/if.rs index bc9d966dfb..8604fb8602 100644 --- a/tests/ui/lang/control_flow/if.rs +++ b/tests/ui/lang/control_flow/if.rs @@ -1,9 +1,9 @@ // build-pass -use spirv_std::storage_class::Input; +use spirv_std as _; #[spirv(fragment)] -pub fn main(i: Input) { +pub fn main(i: &i32) { if *i > 0 { } diff --git a/tests/ui/lang/control_flow/if_else.rs b/tests/ui/lang/control_flow/if_else.rs index 51aaf34935..7c2cc47ba7 100644 --- a/tests/ui/lang/control_flow/if_else.rs +++ b/tests/ui/lang/control_flow/if_else.rs @@ -1,9 +1,9 @@ // build-pass -use spirv_std::storage_class::Input; +use spirv_std as _; #[spirv(fragment)] -pub fn main(i: Input) { +pub fn main(i: &i32) { if *i > 0 { } else { diff --git a/tests/ui/lang/control_flow/if_else_if_else.rs b/tests/ui/lang/control_flow/if_else_if_else.rs index 27f5fe0c7b..0d058c9055 100644 --- a/tests/ui/lang/control_flow/if_else_if_else.rs +++ b/tests/ui/lang/control_flow/if_else_if_else.rs @@ -1,9 +1,9 @@ // build-pass -use spirv_std::storage_class::Input; +use spirv_std as _; #[spirv(fragment)] -pub fn main(i: Input) { +pub fn main(i: &i32) { if *i > 0 { } else if *i < 0 { diff --git a/tests/ui/lang/control_flow/if_if.rs b/tests/ui/lang/control_flow/if_if.rs index e1983f5616..ee171f6602 100644 --- a/tests/ui/lang/control_flow/if_if.rs +++ b/tests/ui/lang/control_flow/if_if.rs @@ -1,9 +1,9 @@ // build-pass -use spirv_std::storage_class::Input; +use spirv_std as _; #[spirv(fragment)] -pub fn main(i: Input) { +pub fn main(i: &i32) { if *i > 0 { if *i < 10 { diff --git a/tests/ui/lang/control_flow/if_return_else.rs b/tests/ui/lang/control_flow/if_return_else.rs index c121e162b5..ae5bda31e1 100644 --- a/tests/ui/lang/control_flow/if_return_else.rs +++ b/tests/ui/lang/control_flow/if_return_else.rs @@ -1,9 +1,9 @@ // build-pass -use spirv_std::storage_class::Input; +use spirv_std as _; #[spirv(fragment)] -pub fn main(i: Input) { +pub fn main(i: &i32) { if *i < 10 { return; } else { diff --git a/tests/ui/lang/control_flow/if_return_else_return.rs b/tests/ui/lang/control_flow/if_return_else_return.rs index ef04abcb94..77aee56de8 100644 --- a/tests/ui/lang/control_flow/if_return_else_return.rs +++ b/tests/ui/lang/control_flow/if_return_else_return.rs @@ -1,9 +1,9 @@ // build-pass -use spirv_std::storage_class::Input; +use spirv_std as _; #[spirv(fragment)] -pub fn main(i: Input) { +pub fn main(i: &i32) { if *i < 10 { return; } else { diff --git a/tests/ui/lang/control_flow/if_while.rs b/tests/ui/lang/control_flow/if_while.rs index 131f895d03..b988ed228e 100644 --- a/tests/ui/lang/control_flow/if_while.rs +++ b/tests/ui/lang/control_flow/if_while.rs @@ -1,9 +1,9 @@ // build-pass -use spirv_std::storage_class::Input; +use spirv_std as _; #[spirv(fragment)] -pub fn main(i: Input) { +pub fn main(i: &i32) { if *i == 0 { while *i < 10 { } diff --git a/tests/ui/lang/control_flow/ifx2.rs b/tests/ui/lang/control_flow/ifx2.rs index 9c7832dc83..c3ebc6ce0c 100644 --- a/tests/ui/lang/control_flow/ifx2.rs +++ b/tests/ui/lang/control_flow/ifx2.rs @@ -1,9 +1,9 @@ // build-pass -use spirv_std::storage_class::Input; +use spirv_std as _; #[spirv(fragment)] -pub fn main(i: Input) { +pub fn main(i: &i32) { if *i > 0 { } diff --git a/tests/ui/lang/control_flow/while.rs b/tests/ui/lang/control_flow/while.rs index 442e13e29c..d4a1f0d5e7 100644 --- a/tests/ui/lang/control_flow/while.rs +++ b/tests/ui/lang/control_flow/while.rs @@ -1,9 +1,9 @@ // build-pass -use spirv_std::storage_class::Input; +use spirv_std as _; #[spirv(fragment)] -pub fn main(i: Input) { +pub fn main(i: &i32) { while *i < 10 { } } diff --git a/tests/ui/lang/control_flow/while_break.rs b/tests/ui/lang/control_flow/while_break.rs index 166047817e..613d6f8f46 100644 --- a/tests/ui/lang/control_flow/while_break.rs +++ b/tests/ui/lang/control_flow/while_break.rs @@ -1,9 +1,9 @@ // build-pass -use spirv_std::storage_class::Input; +use spirv_std as _; #[spirv(fragment)] -pub fn main(i: Input) { +pub fn main(i: &i32) { while *i < 10 { break; } diff --git a/tests/ui/lang/control_flow/while_continue.rs b/tests/ui/lang/control_flow/while_continue.rs index b1a8bcd708..0d7ba44097 100644 --- a/tests/ui/lang/control_flow/while_continue.rs +++ b/tests/ui/lang/control_flow/while_continue.rs @@ -1,9 +1,9 @@ // build-pass -use spirv_std::storage_class::Input; +use spirv_std as _; #[spirv(fragment)] -pub fn main(i: Input) { +pub fn main(i: &i32) { while *i < 10 { continue; } diff --git a/tests/ui/lang/control_flow/while_if_break.rs b/tests/ui/lang/control_flow/while_if_break.rs index 5f01f6f132..b2cd368223 100644 --- a/tests/ui/lang/control_flow/while_if_break.rs +++ b/tests/ui/lang/control_flow/while_if_break.rs @@ -1,9 +1,9 @@ // build-pass -use spirv_std::storage_class::Input; +use spirv_std as _; #[spirv(fragment)] -pub fn main(i: Input) { +pub fn main(i: &i32) { while *i < 10 { if *i == 0 { break; diff --git a/tests/ui/lang/control_flow/while_if_break_else_break.rs b/tests/ui/lang/control_flow/while_if_break_else_break.rs index 378c39b7b8..21e75a4c9e 100644 --- a/tests/ui/lang/control_flow/while_if_break_else_break.rs +++ b/tests/ui/lang/control_flow/while_if_break_else_break.rs @@ -1,9 +1,9 @@ // build-pass -use spirv_std::storage_class::Input; +use spirv_std as _; #[spirv(fragment)] -pub fn main(i: Input) { +pub fn main(i: &i32) { while *i < 10 { if *i == 0 { break; diff --git a/tests/ui/lang/control_flow/while_if_break_if_break.rs b/tests/ui/lang/control_flow/while_if_break_if_break.rs index 61ad54f5ba..72e73e6c51 100644 --- a/tests/ui/lang/control_flow/while_if_break_if_break.rs +++ b/tests/ui/lang/control_flow/while_if_break_if_break.rs @@ -1,9 +1,9 @@ // build-pass -use spirv_std::storage_class::Input; +use spirv_std as _; #[spirv(fragment)] -pub fn main(i: Input) { +pub fn main(i: &i32) { while *i < 10 { if *i == 0 { break; diff --git a/tests/ui/lang/control_flow/while_if_continue.rs b/tests/ui/lang/control_flow/while_if_continue.rs index 714f924886..d8cffa46cf 100644 --- a/tests/ui/lang/control_flow/while_if_continue.rs +++ b/tests/ui/lang/control_flow/while_if_continue.rs @@ -1,9 +1,9 @@ // build-pass -use spirv_std::storage_class::Input; +use spirv_std as _; #[spirv(fragment)] -pub fn main(i: Input) { +pub fn main(i: &i32) { while *i < 10 { if *i == 0 { continue; diff --git a/tests/ui/lang/control_flow/while_if_continue_else_continue.rs b/tests/ui/lang/control_flow/while_if_continue_else_continue.rs index ddcdd731a4..4b88512fd1 100644 --- a/tests/ui/lang/control_flow/while_if_continue_else_continue.rs +++ b/tests/ui/lang/control_flow/while_if_continue_else_continue.rs @@ -1,9 +1,9 @@ // build-pass -use spirv_std::storage_class::Input; +use spirv_std as _; #[spirv(fragment)] -pub fn main(i: Input) { +pub fn main(i: &i32) { while *i < 10 { if *i == 0 { continue; diff --git a/tests/ui/lang/control_flow/while_return.rs b/tests/ui/lang/control_flow/while_return.rs index f30fdd7a72..7f6e1c46bb 100644 --- a/tests/ui/lang/control_flow/while_return.rs +++ b/tests/ui/lang/control_flow/while_return.rs @@ -1,9 +1,9 @@ // build-pass -use spirv_std::storage_class::Input; +use spirv_std as _; #[spirv(fragment)] -pub fn main(i: Input) { +pub fn main(i: &i32) { while *i < 10 { return; } diff --git a/tests/ui/lang/control_flow/while_while.rs b/tests/ui/lang/control_flow/while_while.rs index 24ece06d2d..8613660642 100644 --- a/tests/ui/lang/control_flow/while_while.rs +++ b/tests/ui/lang/control_flow/while_while.rs @@ -1,9 +1,9 @@ // build-pass -use spirv_std::storage_class::Input; +use spirv_std as _; #[spirv(fragment)] -pub fn main(i: Input) { +pub fn main(i: &i32) { while *i < 20 { while *i < 10 { } diff --git a/tests/ui/lang/control_flow/while_while_break.rs b/tests/ui/lang/control_flow/while_while_break.rs index 758e450e95..a136bfd80f 100644 --- a/tests/ui/lang/control_flow/while_while_break.rs +++ b/tests/ui/lang/control_flow/while_while_break.rs @@ -1,9 +1,9 @@ // build-pass -use spirv_std::storage_class::Input; +use spirv_std as _; #[spirv(fragment)] -pub fn main(i: Input) { +pub fn main(i: &i32) { while *i < 20 { while *i < 10 { break; diff --git a/tests/ui/lang/control_flow/while_while_continue.rs b/tests/ui/lang/control_flow/while_while_continue.rs index dfb2e57d46..5ed39146af 100644 --- a/tests/ui/lang/control_flow/while_while_continue.rs +++ b/tests/ui/lang/control_flow/while_while_continue.rs @@ -1,9 +1,9 @@ // build-pass -use spirv_std::storage_class::Input; +use spirv_std as _; #[spirv(fragment)] -pub fn main(i: Input) { +pub fn main(i: &i32) { while *i < 20 { while *i < 10 { continue; diff --git a/tests/ui/lang/control_flow/while_while_if_break.rs b/tests/ui/lang/control_flow/while_while_if_break.rs index 0f4a47b5ee..fc6fb00845 100644 --- a/tests/ui/lang/control_flow/while_while_if_break.rs +++ b/tests/ui/lang/control_flow/while_while_if_break.rs @@ -1,9 +1,9 @@ // build-pass -use spirv_std::storage_class::Input; +use spirv_std as _; #[spirv(fragment)] -pub fn main(i: Input) { +pub fn main(i: &i32) { while *i < 20 { while *i < 10 { if *i > 10 { diff --git a/tests/ui/lang/control_flow/while_while_if_continue.rs b/tests/ui/lang/control_flow/while_while_if_continue.rs index b9c4341478..b968534440 100644 --- a/tests/ui/lang/control_flow/while_while_if_continue.rs +++ b/tests/ui/lang/control_flow/while_while_if_continue.rs @@ -1,9 +1,9 @@ // build-pass -use spirv_std::storage_class::Input; +use spirv_std as _; #[spirv(fragment)] -pub fn main(i: Input) { +pub fn main(i: &i32) { while *i < 20 { while *i < 10 { if *i > 5 { diff --git a/tests/ui/lang/core/ops/logical_and.rs b/tests/ui/lang/core/ops/logical_and.rs index 158845dccb..2e710c073f 100644 --- a/tests/ui/lang/core/ops/logical_and.rs +++ b/tests/ui/lang/core/ops/logical_and.rs @@ -1,7 +1,7 @@ // Test using `&&` operator. // build-pass -extern crate spirv_std; +use spirv_std as _; fn f(x: bool, y: bool) -> bool { x && y diff --git a/tests/ui/lang/core/ptr/allocate_const_scalar.rs b/tests/ui/lang/core/ptr/allocate_const_scalar.rs index d5981fe4fe..7d0c28e89f 100644 --- a/tests/ui/lang/core/ptr/allocate_const_scalar.rs +++ b/tests/ui/lang/core/ptr/allocate_const_scalar.rs @@ -5,12 +5,12 @@ #![feature(ptr_internals)] -use spirv_std::storage_class::Output; +use spirv_std as _; use core::ptr::Unique; const POINTER: Unique<[u8;4]> = Unique::<[u8; 4]>::dangling(); #[spirv(fragment)] -pub fn main(mut output: Output) { +pub fn main() { let _pointer = POINTER; } diff --git a/tests/ui/lang/core/ptr/allocate_const_scalar.stderr b/tests/ui/lang/core/ptr/allocate_const_scalar.stderr index 8b5ffc3f75..1bc13a388c 100644 --- a/tests/ui/lang/core/ptr/allocate_const_scalar.stderr +++ b/tests/ui/lang/core/ptr/allocate_const_scalar.stderr @@ -2,7 +2,7 @@ error: pointer has non-null integer address | = note: Stack: allocate_const_scalar::main - Unnamed function ID %9 + Unnamed function ID %4 error: invalid binary:0:0 - No OpEntryPoint instruction was found. This is only allowed if the Linkage capability is being used. | diff --git a/tests/ui/lang/f32/signum.rs b/tests/ui/lang/f32/signum.rs index 5825026132..b62e9cb132 100644 --- a/tests/ui/lang/f32/signum.rs +++ b/tests/ui/lang/f32/signum.rs @@ -1,10 +1,9 @@ // Test that `signum` works. // build-pass -use spirv_std::storage_class::{Input, Output}; use spirv_std::num_traits::Float; #[spirv(fragment)] -pub fn main(i: Input, mut o: Output) { +pub fn main(i: &f32, o: &mut f32) { *o = (*i).signum(); } diff --git a/tests/ui/spirv-attr/invalid-target.rs b/tests/ui/spirv-attr/invalid-target.rs index ff0a2ce837..c5a034da27 100644 --- a/tests/ui/spirv-attr/invalid-target.rs +++ b/tests/ui/spirv-attr/invalid-target.rs @@ -7,29 +7,29 @@ // NOTE(eddyb) in the interest of keeping this test manageable, only one of // each of the following categories of `#[spirv(...)]` attributes is used: -// * builtin: `position` -// * storage class: `uniform` // * entry: `vertex` +// * storage class: `uniform` +// * builtin: `position` // NOTE(eddyb) accounting for the number of errors this test actually produces: // * 422 "attribute is only valid on" errors (see `invalid-target.stderr`) // * 40 `#[spirv(...)]` (excluding `macro_rules!`, which doesn't get the above error) // * at most 11 attributes per `#[spirv(...)]`, so an upper bound of `40*11 = 440` // * the difference between 440 and 422 is 18, i.e. valid attributes, made up of: -// * 5 on `_Struct` +// * 4 on `_Struct` // * 8 on functions, i.e. 2 on each of: // * `_inherent_method` // * `_trait_method_with_default`, // * `_trait_method` (in `impl _Trait for ()`) // * `_fn` -// * 4 on `_entry_param` +// * 5 on `_entry_param` // * 1 on `_closure` #[spirv( - uniform, sampler, block, sampled_image, // struct-only (incl. `image_type`) + sampler, block, sampled_image, // struct-only (incl. `image_type`) image_type(dim = "Dim2D", depth = 0, arrayed = 0, multisampled = 0, sampled = 1, image_format = "Unknown"), vertex, // fn-only - position, descriptor_set = 0, binding = 0, flat, // param-only + uniform, position, descriptor_set = 0, binding = 0, flat, // param-only unroll_loops, // fn/closure-only )] macro_rules! _macro { @@ -37,100 +37,100 @@ macro_rules! _macro { } #[spirv( - uniform, sampler, block, sampled_image, // struct-only (incl. `image_type`) + sampler, block, sampled_image, // struct-only (incl. `image_type`) image_type(dim = "Dim2D", depth = 0, arrayed = 0, multisampled = 0, sampled = 1, image_format = "Unknown"), vertex, // fn-only - position, descriptor_set = 0, binding = 0, flat, // param-only + uniform, position, descriptor_set = 0, binding = 0, flat, // param-only unroll_loops, // fn/closure-only )] extern crate spirv_std as _; #[spirv( - uniform, sampler, block, sampled_image, // struct-only (incl. `image_type`) + sampler, block, sampled_image, // struct-only (incl. `image_type`) image_type(dim = "Dim2D", depth = 0, arrayed = 0, multisampled = 0, sampled = 1, image_format = "Unknown"), vertex, // fn-only - position, descriptor_set = 0, binding = 0, flat, // param-only + uniform, position, descriptor_set = 0, binding = 0, flat, // param-only unroll_loops, // fn/closure-only )] use spirv_std as _; #[spirv( - uniform, sampler, block, sampled_image, // struct-only (incl. `image_type`) + sampler, block, sampled_image, // struct-only (incl. `image_type`) image_type(dim = "Dim2D", depth = 0, arrayed = 0, multisampled = 0, sampled = 1, image_format = "Unknown"), vertex, // fn-only - position, descriptor_set = 0, binding = 0, flat, // param-only + uniform, position, descriptor_set = 0, binding = 0, flat, // param-only unroll_loops, // fn/closure-only )] mod _mod {} #[spirv( - uniform, sampler, block, sampled_image, // struct-only (incl. `image_type`) + sampler, block, sampled_image, // struct-only (incl. `image_type`) image_type(dim = "Dim2D", depth = 0, arrayed = 0, multisampled = 0, sampled = 1, image_format = "Unknown"), vertex, // fn-only - position, descriptor_set = 0, binding = 0, flat, // param-only + uniform, position, descriptor_set = 0, binding = 0, flat, // param-only unroll_loops, // fn/closure-only )] extern "C" { #[spirv( - uniform, sampler, block, sampled_image, // struct-only (incl. `image_type`) + sampler, block, sampled_image, // struct-only (incl. `image_type`) image_type(dim = "Dim2D", depth = 0, arrayed = 0, multisampled = 0, sampled = 1, image_format = "Unknown"), vertex, // fn-only - position, descriptor_set = 0, binding = 0, flat, // param-only + uniform, position, descriptor_set = 0, binding = 0, flat, // param-only unroll_loops, // fn/closure-only )] type _ForeignTy; #[spirv( - uniform, sampler, block, sampled_image, // struct-only (incl. `image_type`) + sampler, block, sampled_image, // struct-only (incl. `image_type`) image_type(dim = "Dim2D", depth = 0, arrayed = 0, multisampled = 0, sampled = 1, image_format = "Unknown"), vertex, // fn-only - position, descriptor_set = 0, binding = 0, flat, // param-only + uniform, position, descriptor_set = 0, binding = 0, flat, // param-only unroll_loops, // fn/closure-only )] static _FOREIGN_STATIC: (); #[spirv( - uniform, sampler, block, sampled_image, // struct-only (incl. `image_type`) + sampler, block, sampled_image, // struct-only (incl. `image_type`) image_type(dim = "Dim2D", depth = 0, arrayed = 0, multisampled = 0, sampled = 1, image_format = "Unknown"), vertex, // fn-only - position, descriptor_set = 0, binding = 0, flat, // param-only + uniform, position, descriptor_set = 0, binding = 0, flat, // param-only unroll_loops, // fn/closure-only )] fn _foreign_fn(); } #[spirv( - uniform, sampler, block, sampled_image, // struct-only (incl. `image_type`) + sampler, block, sampled_image, // struct-only (incl. `image_type`) image_type(dim = "Dim2D", depth = 0, arrayed = 0, multisampled = 0, sampled = 1, image_format = "Unknown"), vertex, // fn-only - position, descriptor_set = 0, binding = 0, flat, // param-only + uniform, position, descriptor_set = 0, binding = 0, flat, // param-only unroll_loops, // fn/closure-only )] static _STATIC: () = (); #[spirv( - uniform, sampler, block, sampled_image, // struct-only (incl. `image_type`) + sampler, block, sampled_image, // struct-only (incl. `image_type`) image_type(dim = "Dim2D", depth = 0, arrayed = 0, multisampled = 0, sampled = 1, image_format = "Unknown"), vertex, // fn-only - position, descriptor_set = 0, binding = 0, flat, // param-only + uniform, position, descriptor_set = 0, binding = 0, flat, // param-only unroll_loops, // fn/closure-only )] const _CONST: () = (); #[spirv( - uniform, sampler, block, sampled_image, // struct-only (incl. `image_type`) + sampler, block, sampled_image, // struct-only (incl. `image_type`) image_type(dim = "Dim2D", depth = 0, arrayed = 0, multisampled = 0, sampled = 1, image_format = "Unknown"), vertex, // fn-only - position, descriptor_set = 0, binding = 0, flat, // param-only + uniform, position, descriptor_set = 0, binding = 0, flat, // param-only unroll_loops, // fn/closure-only )] type _TyAlias = (); #[spirv( - uniform, sampler, block, sampled_image, // struct-only (incl. `image_type`) + sampler, block, sampled_image, // struct-only (incl. `image_type`) image_type(dim = "Dim2D", depth = 0, arrayed = 0, multisampled = 0, sampled = 1, image_format = "Unknown"), vertex, // fn-only - position, descriptor_set = 0, binding = 0, flat, // param-only + uniform, position, descriptor_set = 0, binding = 0, flat, // param-only unroll_loops, // fn/closure-only )] type _OpaqueTy = impl Copy; @@ -138,26 +138,26 @@ type _OpaqueTy = impl Copy; fn _opaque_ty_definer() -> _OpaqueTy { () } #[spirv( - uniform, sampler, block, sampled_image, // struct-only (incl. `image_type`) + sampler, block, sampled_image, // struct-only (incl. `image_type`) image_type(dim = "Dim2D", depth = 0, arrayed = 0, multisampled = 0, sampled = 1, image_format = "Unknown"), vertex, // fn-only - position, descriptor_set = 0, binding = 0, flat, // param-only + uniform, position, descriptor_set = 0, binding = 0, flat, // param-only unroll_loops, // fn/closure-only )] enum _Enum { #[spirv( - uniform, sampler, block, sampled_image, // struct-only (incl. `image_type`) + sampler, block, sampled_image, // struct-only (incl. `image_type`) image_type(dim = "Dim2D", depth = 0, arrayed = 0, multisampled = 0, sampled = 1, image_format = "Unknown"), vertex, // fn-only - position, descriptor_set = 0, binding = 0, flat, // param-only + uniform, position, descriptor_set = 0, binding = 0, flat, // param-only unroll_loops, // fn/closure-only )] _Variant { #[spirv( - uniform, sampler, block, sampled_image, // struct-only (incl. `image_type`) + sampler, block, sampled_image, // struct-only (incl. `image_type`) image_type(dim = "Dim2D", depth = 0, arrayed = 0, multisampled = 0, sampled = 1, image_format = "Unknown"), vertex, // fn-only - position, descriptor_set = 0, binding = 0, flat, // param-only + uniform, position, descriptor_set = 0, binding = 0, flat, // param-only unroll_loops, // fn/closure-only )] _field: () @@ -165,18 +165,18 @@ enum _Enum { } #[spirv( - uniform, sampler, block, sampled_image, // struct-only (incl. `image_type`) + sampler, block, sampled_image, // struct-only (incl. `image_type`) image_type(dim = "Dim2D", depth = 0, arrayed = 0, multisampled = 0, sampled = 1, image_format = "Unknown"), vertex, // fn-only - position, descriptor_set = 0, binding = 0, flat, // param-only + uniform, position, descriptor_set = 0, binding = 0, flat, // param-only unroll_loops, // fn/closure-only )] union _Union { #[spirv( - uniform, sampler, block, sampled_image, // struct-only (incl. `image_type`) + sampler, block, sampled_image, // struct-only (incl. `image_type`) image_type(dim = "Dim2D", depth = 0, arrayed = 0, multisampled = 0, sampled = 1, image_format = "Unknown"), vertex, // fn-only - position, descriptor_set = 0, binding = 0, flat, // param-only + uniform, position, descriptor_set = 0, binding = 0, flat, // param-only unroll_loops, // fn/closure-only )] _field: () @@ -184,139 +184,139 @@ union _Union { #[spirv( vertex, // fn-only - position, descriptor_set = 0, binding = 0, flat, // param-only + uniform, position, descriptor_set = 0, binding = 0, flat, // param-only unroll_loops, // fn/closure-only )] struct _Struct { #[spirv( - uniform, sampler, block, sampled_image, // struct-only (incl. `image_type`) + sampler, block, sampled_image, // struct-only (incl. `image_type`) image_type(dim = "Dim2D", depth = 0, arrayed = 0, multisampled = 0, sampled = 1, image_format = "Unknown"), vertex, // fn-only - position, descriptor_set = 0, binding = 0, flat, // param-only + uniform, position, descriptor_set = 0, binding = 0, flat, // param-only unroll_loops, // fn/closure-only )] _field: () } #[spirv( - uniform, sampler, block, sampled_image, // struct-only (incl. `image_type`) + sampler, block, sampled_image, // struct-only (incl. `image_type`) image_type(dim = "Dim2D", depth = 0, arrayed = 0, multisampled = 0, sampled = 1, image_format = "Unknown"), vertex, // fn-only - position, descriptor_set = 0, binding = 0, flat, // param-only + uniform, position, descriptor_set = 0, binding = 0, flat, // param-only unroll_loops, // fn/closure-only )] impl _Struct { #[spirv( - uniform, sampler, block, sampled_image, // struct-only (incl. `image_type`) + sampler, block, sampled_image, // struct-only (incl. `image_type`) image_type(dim = "Dim2D", depth = 0, arrayed = 0, multisampled = 0, sampled = 1, image_format = "Unknown"), vertex, // fn-only - position, descriptor_set = 0, binding = 0, flat, // param-only + uniform, position, descriptor_set = 0, binding = 0, flat, // param-only unroll_loops, // fn/closure-only )] const _INHERENT_ASSOC_CONST: () = (); #[spirv( - uniform, sampler, block, sampled_image, // struct-only (incl. `image_type`) + sampler, block, sampled_image, // struct-only (incl. `image_type`) image_type(dim = "Dim2D", depth = 0, arrayed = 0, multisampled = 0, sampled = 1, image_format = "Unknown"), - position, descriptor_set = 0, binding = 0, flat, // param-only + uniform, position, descriptor_set = 0, binding = 0, flat, // param-only )] fn _inherent_method() {} } #[spirv( - uniform, sampler, block, sampled_image, // struct-only (incl. `image_type`) + sampler, block, sampled_image, // struct-only (incl. `image_type`) image_type(dim = "Dim2D", depth = 0, arrayed = 0, multisampled = 0, sampled = 1, image_format = "Unknown"), vertex, // fn-only - position, descriptor_set = 0, binding = 0, flat, // param-only + uniform, position, descriptor_set = 0, binding = 0, flat, // param-only unroll_loops, // fn/closure-only )] trait _TraitAlias = Copy; #[spirv( - uniform, sampler, block, sampled_image, // struct-only (incl. `image_type`) + sampler, block, sampled_image, // struct-only (incl. `image_type`) image_type(dim = "Dim2D", depth = 0, arrayed = 0, multisampled = 0, sampled = 1, image_format = "Unknown"), vertex, // fn-only - position, descriptor_set = 0, binding = 0, flat, // param-only + uniform, position, descriptor_set = 0, binding = 0, flat, // param-only unroll_loops, // fn/closure-only )] trait _Trait { #[spirv( - uniform, sampler, block, sampled_image, // struct-only (incl. `image_type`) + sampler, block, sampled_image, // struct-only (incl. `image_type`) image_type(dim = "Dim2D", depth = 0, arrayed = 0, multisampled = 0, sampled = 1, image_format = "Unknown"), vertex, // fn-only - position, descriptor_set = 0, binding = 0, flat, // param-only + uniform, position, descriptor_set = 0, binding = 0, flat, // param-only unroll_loops, // fn/closure-only )] type _AssocTy; #[spirv( - uniform, sampler, block, sampled_image, // struct-only (incl. `image_type`) + sampler, block, sampled_image, // struct-only (incl. `image_type`) image_type(dim = "Dim2D", depth = 0, arrayed = 0, multisampled = 0, sampled = 1, image_format = "Unknown"), vertex, // fn-only - position, descriptor_set = 0, binding = 0, flat, // param-only + uniform, position, descriptor_set = 0, binding = 0, flat, // param-only unroll_loops, // fn/closure-only )] const _TRAIT_ASSOC_CONST: (); #[spirv( - uniform, sampler, block, sampled_image, // struct-only (incl. `image_type`) + sampler, block, sampled_image, // struct-only (incl. `image_type`) image_type(dim = "Dim2D", depth = 0, arrayed = 0, multisampled = 0, sampled = 1, image_format = "Unknown"), vertex, // fn-only - position, descriptor_set = 0, binding = 0, flat, // param-only + uniform, position, descriptor_set = 0, binding = 0, flat, // param-only unroll_loops, // fn/closure-only )] fn _trait_method(); #[spirv( - uniform, sampler, block, sampled_image, // struct-only (incl. `image_type`) + sampler, block, sampled_image, // struct-only (incl. `image_type`) image_type(dim = "Dim2D", depth = 0, arrayed = 0, multisampled = 0, sampled = 1, image_format = "Unknown"), - position, descriptor_set = 0, binding = 0, flat, // param-only + uniform, position, descriptor_set = 0, binding = 0, flat, // param-only )] fn _trait_method_with_default() {} } #[spirv( - uniform, sampler, block, sampled_image, // struct-only (incl. `image_type`) + sampler, block, sampled_image, // struct-only (incl. `image_type`) image_type(dim = "Dim2D", depth = 0, arrayed = 0, multisampled = 0, sampled = 1, image_format = "Unknown"), vertex, // fn-only - position, descriptor_set = 0, binding = 0, flat, // param-only + uniform, position, descriptor_set = 0, binding = 0, flat, // param-only unroll_loops, // fn/closure-only )] impl _Trait for () { #[spirv( - uniform, sampler, block, sampled_image, // struct-only (incl. `image_type`) + sampler, block, sampled_image, // struct-only (incl. `image_type`) image_type(dim = "Dim2D", depth = 0, arrayed = 0, multisampled = 0, sampled = 1, image_format = "Unknown"), vertex, // fn-only - position, descriptor_set = 0, binding = 0, flat, // param-only + uniform, position, descriptor_set = 0, binding = 0, flat, // param-only unroll_loops, // fn/closure-only )] type _AssocTy = (); #[spirv( - uniform, sampler, block, sampled_image, // struct-only (incl. `image_type`) + sampler, block, sampled_image, // struct-only (incl. `image_type`) image_type(dim = "Dim2D", depth = 0, arrayed = 0, multisampled = 0, sampled = 1, image_format = "Unknown"), vertex, // fn-only - position, descriptor_set = 0, binding = 0, flat, // param-only + uniform, position, descriptor_set = 0, binding = 0, flat, // param-only unroll_loops, // fn/closure-only )] const _TRAIT_ASSOC_CONST: () = (); #[spirv( - uniform, sampler, block, sampled_image, // struct-only (incl. `image_type`) + sampler, block, sampled_image, // struct-only (incl. `image_type`) image_type(dim = "Dim2D", depth = 0, arrayed = 0, multisampled = 0, sampled = 1, image_format = "Unknown"), - position, descriptor_set = 0, binding = 0, flat, // param-only + uniform, position, descriptor_set = 0, binding = 0, flat, // param-only )] fn _trait_method() {} } #[spirv( - uniform, sampler, block, sampled_image, // struct-only (incl. `image_type`) + sampler, block, sampled_image, // struct-only (incl. `image_type`) image_type(dim = "Dim2D", depth = 0, arrayed = 0, multisampled = 0, sampled = 1, image_format = "Unknown"), - position, descriptor_set = 0, binding = 0, flat, // param-only + uniform, position, descriptor_set = 0, binding = 0, flat, // param-only )] fn _fn( #[spirv( - uniform, sampler, block, sampled_image, // struct-only (incl. `image_type`) + sampler, block, sampled_image, // struct-only (incl. `image_type`) image_type(dim = "Dim2D", depth = 0, arrayed = 0, multisampled = 0, sampled = 1, image_format = "Unknown"), vertex, // fn-only unroll_loops, // fn/closure-only @@ -324,29 +324,29 @@ fn _fn( _entry_param: () ) { #[spirv( - uniform, sampler, block, sampled_image, // struct-only (incl. `image_type`) + sampler, block, sampled_image, // struct-only (incl. `image_type`) image_type(dim = "Dim2D", depth = 0, arrayed = 0, multisampled = 0, sampled = 1, image_format = "Unknown"), vertex, // fn-only - position, descriptor_set = 0, binding = 0, flat, // param-only + uniform, position, descriptor_set = 0, binding = 0, flat, // param-only unroll_loops, // fn/closure-only )] let _statement = (); let _closure = #[spirv( - uniform, sampler, block, sampled_image, // struct-only (incl. `image_type`) + sampler, block, sampled_image, // struct-only (incl. `image_type`) image_type(dim = "Dim2D", depth = 0, arrayed = 0, multisampled = 0, sampled = 1, image_format = "Unknown"), vertex, // fn-only - position, descriptor_set = 0, binding = 0, flat, // param-only + uniform, position, descriptor_set = 0, binding = 0, flat, // param-only )] || {}; ( #[spirv( - uniform, sampler, block, sampled_image, // struct-only (incl. `image_type`) + sampler, block, sampled_image, // struct-only (incl. `image_type`) image_type(dim = "Dim2D", depth = 0, arrayed = 0, multisampled = 0, sampled = 1, image_format = "Unknown"), vertex, // fn-only - position, descriptor_set = 0, binding = 0, flat, // param-only + uniform, position, descriptor_set = 0, binding = 0, flat, // param-only unroll_loops, // fn/closure-only )] (1, 2, 3) // expression @@ -354,10 +354,10 @@ fn _fn( match () { #[spirv( - uniform, sampler, block, sampled_image, // struct-only (incl. `image_type`) + sampler, block, sampled_image, // struct-only (incl. `image_type`) image_type(dim = "Dim2D", depth = 0, arrayed = 0, multisampled = 0, sampled = 1, image_format = "Unknown"), vertex, // fn-only - position, descriptor_set = 0, binding = 0, flat, // param-only + uniform, position, descriptor_set = 0, binding = 0, flat, // param-only unroll_loops, // fn/closure-only )] _arm => {} @@ -366,28 +366,28 @@ fn _fn( fn _fn_with_generics< #[spirv( - uniform, sampler, block, sampled_image, // struct-only (incl. `image_type`) + sampler, block, sampled_image, // struct-only (incl. `image_type`) image_type(dim = "Dim2D", depth = 0, arrayed = 0, multisampled = 0, sampled = 1, image_format = "Unknown"), vertex, // fn-only - position, descriptor_set = 0, binding = 0, flat, // param-only + uniform, position, descriptor_set = 0, binding = 0, flat, // param-only unroll_loops, // fn/closure-only )] '_lifetime_param, #[spirv( - uniform, sampler, block, sampled_image, // struct-only (incl. `image_type`) + sampler, block, sampled_image, // struct-only (incl. `image_type`) image_type(dim = "Dim2D", depth = 0, arrayed = 0, multisampled = 0, sampled = 1, image_format = "Unknown"), vertex, // fn-only - position, descriptor_set = 0, binding = 0, flat, // param-only + uniform, position, descriptor_set = 0, binding = 0, flat, // param-only unroll_loops, // fn/closure-only )] _TyParam, #[spirv( - uniform, sampler, block, sampled_image, // struct-only (incl. `image_type`) + sampler, block, sampled_image, // struct-only (incl. `image_type`) image_type(dim = "Dim2D", depth = 0, arrayed = 0, multisampled = 0, sampled = 1, image_format = "Unknown"), vertex, // fn-only - position, descriptor_set = 0, binding = 0, flat, // param-only + uniform, position, descriptor_set = 0, binding = 0, flat, // param-only unroll_loops, // fn/closure-only )] const _CONST_PARAM: usize diff --git a/tests/ui/spirv-attr/invalid-target.stderr b/tests/ui/spirv-attr/invalid-target.stderr index 0bffbcb779..5b5075a89d 100644 --- a/tests/ui/spirv-attr/invalid-target.stderr +++ b/tests/ui/spirv-attr/invalid-target.stderr @@ -1,26 +1,20 @@ error: attribute is only valid on a struct, not on a lifetime parameter --> $DIR/invalid-target.rs:369:9 | -369 | uniform, sampler, block, sampled_image, // struct-only (incl. `image_type`) +369 | sampler, block, sampled_image, // struct-only (incl. `image_type`) | ^^^^^^^ error: attribute is only valid on a struct, not on a lifetime parameter --> $DIR/invalid-target.rs:369:18 | -369 | uniform, sampler, block, sampled_image, // struct-only (incl. `image_type`) - | ^^^^^^^ +369 | sampler, block, sampled_image, // struct-only (incl. `image_type`) + | ^^^^^ error: attribute is only valid on a struct, not on a lifetime parameter - --> $DIR/invalid-target.rs:369:27 + --> $DIR/invalid-target.rs:369:25 | -369 | uniform, sampler, block, sampled_image, // struct-only (incl. `image_type`) - | ^^^^^ - -error: attribute is only valid on a struct, not on a lifetime parameter - --> $DIR/invalid-target.rs:369:34 - | -369 | uniform, sampler, block, sampled_image, // struct-only (incl. `image_type`) - | ^^^^^^^^^^^^^ +369 | sampler, block, sampled_image, // struct-only (incl. `image_type`) + | ^^^^^^^^^^^^^ error: attribute is only valid on a struct, not on a lifetime parameter --> $DIR/invalid-target.rs:370:9 @@ -37,26 +31,32 @@ error: attribute is only valid on a function, not on a lifetime parameter error: attribute is only valid on a function parameter, not on a lifetime parameter --> $DIR/invalid-target.rs:372:9 | -372 | position, descriptor_set = 0, binding = 0, flat, // param-only - | ^^^^^^^^ +372 | uniform, position, descriptor_set = 0, binding = 0, flat, // param-only + | ^^^^^^^ error: attribute is only valid on a function parameter, not on a lifetime parameter - --> $DIR/invalid-target.rs:372:19 + --> $DIR/invalid-target.rs:372:18 | -372 | position, descriptor_set = 0, binding = 0, flat, // param-only - | ^^^^^^^^^^^^^^^^^^ +372 | uniform, position, descriptor_set = 0, binding = 0, flat, // param-only + | ^^^^^^^^ error: attribute is only valid on a function parameter, not on a lifetime parameter - --> $DIR/invalid-target.rs:372:39 + --> $DIR/invalid-target.rs:372:28 | -372 | position, descriptor_set = 0, binding = 0, flat, // param-only - | ^^^^^^^^^^^ +372 | uniform, position, descriptor_set = 0, binding = 0, flat, // param-only + | ^^^^^^^^^^^^^^^^^^ error: attribute is only valid on a function parameter, not on a lifetime parameter - --> $DIR/invalid-target.rs:372:52 + --> $DIR/invalid-target.rs:372:48 | -372 | position, descriptor_set = 0, binding = 0, flat, // param-only - | ^^^^ +372 | uniform, position, descriptor_set = 0, binding = 0, flat, // param-only + | ^^^^^^^^^^^ + +error: attribute is only valid on a function parameter, not on a lifetime parameter + --> $DIR/invalid-target.rs:372:61 + | +372 | uniform, position, descriptor_set = 0, binding = 0, flat, // param-only + | ^^^^ error: attribute is only valid on a function or closure, not on a lifetime parameter --> $DIR/invalid-target.rs:373:9 @@ -67,26 +67,20 @@ error: attribute is only valid on a function or closure, not on a lifetime param error: attribute is only valid on a struct, not on a type parameter --> $DIR/invalid-target.rs:378:9 | -378 | uniform, sampler, block, sampled_image, // struct-only (incl. `image_type`) +378 | sampler, block, sampled_image, // struct-only (incl. `image_type`) | ^^^^^^^ error: attribute is only valid on a struct, not on a type parameter --> $DIR/invalid-target.rs:378:18 | -378 | uniform, sampler, block, sampled_image, // struct-only (incl. `image_type`) - | ^^^^^^^ - -error: attribute is only valid on a struct, not on a type parameter - --> $DIR/invalid-target.rs:378:27 - | -378 | uniform, sampler, block, sampled_image, // struct-only (incl. `image_type`) - | ^^^^^ +378 | sampler, block, sampled_image, // struct-only (incl. `image_type`) + | ^^^^^ error: attribute is only valid on a struct, not on a type parameter - --> $DIR/invalid-target.rs:378:34 + --> $DIR/invalid-target.rs:378:25 | -378 | uniform, sampler, block, sampled_image, // struct-only (incl. `image_type`) - | ^^^^^^^^^^^^^ +378 | sampler, block, sampled_image, // struct-only (incl. `image_type`) + | ^^^^^^^^^^^^^ error: attribute is only valid on a struct, not on a type parameter --> $DIR/invalid-target.rs:379:9 @@ -103,26 +97,32 @@ error: attribute is only valid on a function, not on a type parameter error: attribute is only valid on a function parameter, not on a type parameter --> $DIR/invalid-target.rs:381:9 | -381 | position, descriptor_set = 0, binding = 0, flat, // param-only - | ^^^^^^^^ +381 | uniform, position, descriptor_set = 0, binding = 0, flat, // param-only + | ^^^^^^^ + +error: attribute is only valid on a function parameter, not on a type parameter + --> $DIR/invalid-target.rs:381:18 + | +381 | uniform, position, descriptor_set = 0, binding = 0, flat, // param-only + | ^^^^^^^^ error: attribute is only valid on a function parameter, not on a type parameter - --> $DIR/invalid-target.rs:381:19 + --> $DIR/invalid-target.rs:381:28 | -381 | position, descriptor_set = 0, binding = 0, flat, // param-only - | ^^^^^^^^^^^^^^^^^^ +381 | uniform, position, descriptor_set = 0, binding = 0, flat, // param-only + | ^^^^^^^^^^^^^^^^^^ error: attribute is only valid on a function parameter, not on a type parameter - --> $DIR/invalid-target.rs:381:39 + --> $DIR/invalid-target.rs:381:48 | -381 | position, descriptor_set = 0, binding = 0, flat, // param-only - | ^^^^^^^^^^^ +381 | uniform, position, descriptor_set = 0, binding = 0, flat, // param-only + | ^^^^^^^^^^^ error: attribute is only valid on a function parameter, not on a type parameter - --> $DIR/invalid-target.rs:381:52 + --> $DIR/invalid-target.rs:381:61 | -381 | position, descriptor_set = 0, binding = 0, flat, // param-only - | ^^^^ +381 | uniform, position, descriptor_set = 0, binding = 0, flat, // param-only + | ^^^^ error: attribute is only valid on a function or closure, not on a type parameter --> $DIR/invalid-target.rs:382:9 @@ -133,26 +133,20 @@ error: attribute is only valid on a function or closure, not on a type parameter error: attribute is only valid on a struct, not on a const parameter --> $DIR/invalid-target.rs:387:9 | -387 | uniform, sampler, block, sampled_image, // struct-only (incl. `image_type`) +387 | sampler, block, sampled_image, // struct-only (incl. `image_type`) | ^^^^^^^ error: attribute is only valid on a struct, not on a const parameter --> $DIR/invalid-target.rs:387:18 | -387 | uniform, sampler, block, sampled_image, // struct-only (incl. `image_type`) - | ^^^^^^^ +387 | sampler, block, sampled_image, // struct-only (incl. `image_type`) + | ^^^^^ error: attribute is only valid on a struct, not on a const parameter - --> $DIR/invalid-target.rs:387:27 + --> $DIR/invalid-target.rs:387:25 | -387 | uniform, sampler, block, sampled_image, // struct-only (incl. `image_type`) - | ^^^^^ - -error: attribute is only valid on a struct, not on a const parameter - --> $DIR/invalid-target.rs:387:34 - | -387 | uniform, sampler, block, sampled_image, // struct-only (incl. `image_type`) - | ^^^^^^^^^^^^^ +387 | sampler, block, sampled_image, // struct-only (incl. `image_type`) + | ^^^^^^^^^^^^^ error: attribute is only valid on a struct, not on a const parameter --> $DIR/invalid-target.rs:388:9 @@ -169,26 +163,32 @@ error: attribute is only valid on a function, not on a const parameter error: attribute is only valid on a function parameter, not on a const parameter --> $DIR/invalid-target.rs:390:9 | -390 | position, descriptor_set = 0, binding = 0, flat, // param-only - | ^^^^^^^^ +390 | uniform, position, descriptor_set = 0, binding = 0, flat, // param-only + | ^^^^^^^ error: attribute is only valid on a function parameter, not on a const parameter - --> $DIR/invalid-target.rs:390:19 + --> $DIR/invalid-target.rs:390:18 | -390 | position, descriptor_set = 0, binding = 0, flat, // param-only - | ^^^^^^^^^^^^^^^^^^ +390 | uniform, position, descriptor_set = 0, binding = 0, flat, // param-only + | ^^^^^^^^ error: attribute is only valid on a function parameter, not on a const parameter - --> $DIR/invalid-target.rs:390:39 + --> $DIR/invalid-target.rs:390:28 | -390 | position, descriptor_set = 0, binding = 0, flat, // param-only - | ^^^^^^^^^^^ +390 | uniform, position, descriptor_set = 0, binding = 0, flat, // param-only + | ^^^^^^^^^^^^^^^^^^ error: attribute is only valid on a function parameter, not on a const parameter - --> $DIR/invalid-target.rs:390:52 + --> $DIR/invalid-target.rs:390:48 | -390 | position, descriptor_set = 0, binding = 0, flat, // param-only - | ^^^^ +390 | uniform, position, descriptor_set = 0, binding = 0, flat, // param-only + | ^^^^^^^^^^^ + +error: attribute is only valid on a function parameter, not on a const parameter + --> $DIR/invalid-target.rs:390:61 + | +390 | uniform, position, descriptor_set = 0, binding = 0, flat, // param-only + | ^^^^ error: attribute is only valid on a function or closure, not on a const parameter --> $DIR/invalid-target.rs:391:9 @@ -199,26 +199,20 @@ error: attribute is only valid on a function or closure, not on a const paramete error: attribute is only valid on a struct, not on a extern crate --> $DIR/invalid-target.rs:40:5 | -40 | uniform, sampler, block, sampled_image, // struct-only (incl. `image_type`) +40 | sampler, block, sampled_image, // struct-only (incl. `image_type`) | ^^^^^^^ error: attribute is only valid on a struct, not on a extern crate --> $DIR/invalid-target.rs:40:14 | -40 | uniform, sampler, block, sampled_image, // struct-only (incl. `image_type`) - | ^^^^^^^ +40 | sampler, block, sampled_image, // struct-only (incl. `image_type`) + | ^^^^^ error: attribute is only valid on a struct, not on a extern crate - --> $DIR/invalid-target.rs:40:23 + --> $DIR/invalid-target.rs:40:21 | -40 | uniform, sampler, block, sampled_image, // struct-only (incl. `image_type`) - | ^^^^^ - -error: attribute is only valid on a struct, not on a extern crate - --> $DIR/invalid-target.rs:40:30 - | -40 | uniform, sampler, block, sampled_image, // struct-only (incl. `image_type`) - | ^^^^^^^^^^^^^ +40 | sampler, block, sampled_image, // struct-only (incl. `image_type`) + | ^^^^^^^^^^^^^ error: attribute is only valid on a struct, not on a extern crate --> $DIR/invalid-target.rs:41:5 @@ -235,26 +229,32 @@ error: attribute is only valid on a function, not on a extern crate error: attribute is only valid on a function parameter, not on a extern crate --> $DIR/invalid-target.rs:43:5 | -43 | position, descriptor_set = 0, binding = 0, flat, // param-only - | ^^^^^^^^ +43 | uniform, position, descriptor_set = 0, binding = 0, flat, // param-only + | ^^^^^^^ error: attribute is only valid on a function parameter, not on a extern crate - --> $DIR/invalid-target.rs:43:15 + --> $DIR/invalid-target.rs:43:14 | -43 | position, descriptor_set = 0, binding = 0, flat, // param-only - | ^^^^^^^^^^^^^^^^^^ +43 | uniform, position, descriptor_set = 0, binding = 0, flat, // param-only + | ^^^^^^^^ error: attribute is only valid on a function parameter, not on a extern crate - --> $DIR/invalid-target.rs:43:35 + --> $DIR/invalid-target.rs:43:24 | -43 | position, descriptor_set = 0, binding = 0, flat, // param-only - | ^^^^^^^^^^^ +43 | uniform, position, descriptor_set = 0, binding = 0, flat, // param-only + | ^^^^^^^^^^^^^^^^^^ error: attribute is only valid on a function parameter, not on a extern crate - --> $DIR/invalid-target.rs:43:48 + --> $DIR/invalid-target.rs:43:44 | -43 | position, descriptor_set = 0, binding = 0, flat, // param-only - | ^^^^ +43 | uniform, position, descriptor_set = 0, binding = 0, flat, // param-only + | ^^^^^^^^^^^ + +error: attribute is only valid on a function parameter, not on a extern crate + --> $DIR/invalid-target.rs:43:57 + | +43 | uniform, position, descriptor_set = 0, binding = 0, flat, // param-only + | ^^^^ error: attribute is only valid on a function or closure, not on a extern crate --> $DIR/invalid-target.rs:44:5 @@ -265,26 +265,20 @@ error: attribute is only valid on a function or closure, not on a extern crate error: attribute is only valid on a struct, not on a use --> $DIR/invalid-target.rs:49:5 | -49 | uniform, sampler, block, sampled_image, // struct-only (incl. `image_type`) +49 | sampler, block, sampled_image, // struct-only (incl. `image_type`) | ^^^^^^^ error: attribute is only valid on a struct, not on a use --> $DIR/invalid-target.rs:49:14 | -49 | uniform, sampler, block, sampled_image, // struct-only (incl. `image_type`) - | ^^^^^^^ - -error: attribute is only valid on a struct, not on a use - --> $DIR/invalid-target.rs:49:23 - | -49 | uniform, sampler, block, sampled_image, // struct-only (incl. `image_type`) - | ^^^^^ +49 | sampler, block, sampled_image, // struct-only (incl. `image_type`) + | ^^^^^ error: attribute is only valid on a struct, not on a use - --> $DIR/invalid-target.rs:49:30 + --> $DIR/invalid-target.rs:49:21 | -49 | uniform, sampler, block, sampled_image, // struct-only (incl. `image_type`) - | ^^^^^^^^^^^^^ +49 | sampler, block, sampled_image, // struct-only (incl. `image_type`) + | ^^^^^^^^^^^^^ error: attribute is only valid on a struct, not on a use --> $DIR/invalid-target.rs:50:5 @@ -301,26 +295,32 @@ error: attribute is only valid on a function, not on a use error: attribute is only valid on a function parameter, not on a use --> $DIR/invalid-target.rs:52:5 | -52 | position, descriptor_set = 0, binding = 0, flat, // param-only - | ^^^^^^^^ +52 | uniform, position, descriptor_set = 0, binding = 0, flat, // param-only + | ^^^^^^^ + +error: attribute is only valid on a function parameter, not on a use + --> $DIR/invalid-target.rs:52:14 + | +52 | uniform, position, descriptor_set = 0, binding = 0, flat, // param-only + | ^^^^^^^^ error: attribute is only valid on a function parameter, not on a use - --> $DIR/invalid-target.rs:52:15 + --> $DIR/invalid-target.rs:52:24 | -52 | position, descriptor_set = 0, binding = 0, flat, // param-only - | ^^^^^^^^^^^^^^^^^^ +52 | uniform, position, descriptor_set = 0, binding = 0, flat, // param-only + | ^^^^^^^^^^^^^^^^^^ error: attribute is only valid on a function parameter, not on a use - --> $DIR/invalid-target.rs:52:35 + --> $DIR/invalid-target.rs:52:44 | -52 | position, descriptor_set = 0, binding = 0, flat, // param-only - | ^^^^^^^^^^^ +52 | uniform, position, descriptor_set = 0, binding = 0, flat, // param-only + | ^^^^^^^^^^^ error: attribute is only valid on a function parameter, not on a use - --> $DIR/invalid-target.rs:52:48 + --> $DIR/invalid-target.rs:52:57 | -52 | position, descriptor_set = 0, binding = 0, flat, // param-only - | ^^^^ +52 | uniform, position, descriptor_set = 0, binding = 0, flat, // param-only + | ^^^^ error: attribute is only valid on a function or closure, not on a use --> $DIR/invalid-target.rs:53:5 @@ -331,26 +331,20 @@ error: attribute is only valid on a function or closure, not on a use error: attribute is only valid on a struct, not on a module --> $DIR/invalid-target.rs:58:5 | -58 | uniform, sampler, block, sampled_image, // struct-only (incl. `image_type`) +58 | sampler, block, sampled_image, // struct-only (incl. `image_type`) | ^^^^^^^ error: attribute is only valid on a struct, not on a module --> $DIR/invalid-target.rs:58:14 | -58 | uniform, sampler, block, sampled_image, // struct-only (incl. `image_type`) - | ^^^^^^^ +58 | sampler, block, sampled_image, // struct-only (incl. `image_type`) + | ^^^^^ error: attribute is only valid on a struct, not on a module - --> $DIR/invalid-target.rs:58:23 + --> $DIR/invalid-target.rs:58:21 | -58 | uniform, sampler, block, sampled_image, // struct-only (incl. `image_type`) - | ^^^^^ - -error: attribute is only valid on a struct, not on a module - --> $DIR/invalid-target.rs:58:30 - | -58 | uniform, sampler, block, sampled_image, // struct-only (incl. `image_type`) - | ^^^^^^^^^^^^^ +58 | sampler, block, sampled_image, // struct-only (incl. `image_type`) + | ^^^^^^^^^^^^^ error: attribute is only valid on a struct, not on a module --> $DIR/invalid-target.rs:59:5 @@ -367,26 +361,32 @@ error: attribute is only valid on a function, not on a module error: attribute is only valid on a function parameter, not on a module --> $DIR/invalid-target.rs:61:5 | -61 | position, descriptor_set = 0, binding = 0, flat, // param-only - | ^^^^^^^^ +61 | uniform, position, descriptor_set = 0, binding = 0, flat, // param-only + | ^^^^^^^ error: attribute is only valid on a function parameter, not on a module - --> $DIR/invalid-target.rs:61:15 + --> $DIR/invalid-target.rs:61:14 | -61 | position, descriptor_set = 0, binding = 0, flat, // param-only - | ^^^^^^^^^^^^^^^^^^ +61 | uniform, position, descriptor_set = 0, binding = 0, flat, // param-only + | ^^^^^^^^ error: attribute is only valid on a function parameter, not on a module - --> $DIR/invalid-target.rs:61:35 + --> $DIR/invalid-target.rs:61:24 | -61 | position, descriptor_set = 0, binding = 0, flat, // param-only - | ^^^^^^^^^^^ +61 | uniform, position, descriptor_set = 0, binding = 0, flat, // param-only + | ^^^^^^^^^^^^^^^^^^ error: attribute is only valid on a function parameter, not on a module - --> $DIR/invalid-target.rs:61:48 + --> $DIR/invalid-target.rs:61:44 | -61 | position, descriptor_set = 0, binding = 0, flat, // param-only - | ^^^^ +61 | uniform, position, descriptor_set = 0, binding = 0, flat, // param-only + | ^^^^^^^^^^^ + +error: attribute is only valid on a function parameter, not on a module + --> $DIR/invalid-target.rs:61:57 + | +61 | uniform, position, descriptor_set = 0, binding = 0, flat, // param-only + | ^^^^ error: attribute is only valid on a function or closure, not on a module --> $DIR/invalid-target.rs:62:5 @@ -397,26 +397,20 @@ error: attribute is only valid on a function or closure, not on a module error: attribute is only valid on a struct, not on a foreign module --> $DIR/invalid-target.rs:67:5 | -67 | uniform, sampler, block, sampled_image, // struct-only (incl. `image_type`) +67 | sampler, block, sampled_image, // struct-only (incl. `image_type`) | ^^^^^^^ error: attribute is only valid on a struct, not on a foreign module --> $DIR/invalid-target.rs:67:14 | -67 | uniform, sampler, block, sampled_image, // struct-only (incl. `image_type`) - | ^^^^^^^ +67 | sampler, block, sampled_image, // struct-only (incl. `image_type`) + | ^^^^^ error: attribute is only valid on a struct, not on a foreign module - --> $DIR/invalid-target.rs:67:23 + --> $DIR/invalid-target.rs:67:21 | -67 | uniform, sampler, block, sampled_image, // struct-only (incl. `image_type`) - | ^^^^^ - -error: attribute is only valid on a struct, not on a foreign module - --> $DIR/invalid-target.rs:67:30 - | -67 | uniform, sampler, block, sampled_image, // struct-only (incl. `image_type`) - | ^^^^^^^^^^^^^ +67 | sampler, block, sampled_image, // struct-only (incl. `image_type`) + | ^^^^^^^^^^^^^ error: attribute is only valid on a struct, not on a foreign module --> $DIR/invalid-target.rs:68:5 @@ -433,26 +427,32 @@ error: attribute is only valid on a function, not on a foreign module error: attribute is only valid on a function parameter, not on a foreign module --> $DIR/invalid-target.rs:70:5 | -70 | position, descriptor_set = 0, binding = 0, flat, // param-only - | ^^^^^^^^ +70 | uniform, position, descriptor_set = 0, binding = 0, flat, // param-only + | ^^^^^^^ + +error: attribute is only valid on a function parameter, not on a foreign module + --> $DIR/invalid-target.rs:70:14 + | +70 | uniform, position, descriptor_set = 0, binding = 0, flat, // param-only + | ^^^^^^^^ error: attribute is only valid on a function parameter, not on a foreign module - --> $DIR/invalid-target.rs:70:15 + --> $DIR/invalid-target.rs:70:24 | -70 | position, descriptor_set = 0, binding = 0, flat, // param-only - | ^^^^^^^^^^^^^^^^^^ +70 | uniform, position, descriptor_set = 0, binding = 0, flat, // param-only + | ^^^^^^^^^^^^^^^^^^ error: attribute is only valid on a function parameter, not on a foreign module - --> $DIR/invalid-target.rs:70:35 + --> $DIR/invalid-target.rs:70:44 | -70 | position, descriptor_set = 0, binding = 0, flat, // param-only - | ^^^^^^^^^^^ +70 | uniform, position, descriptor_set = 0, binding = 0, flat, // param-only + | ^^^^^^^^^^^ error: attribute is only valid on a function parameter, not on a foreign module - --> $DIR/invalid-target.rs:70:48 + --> $DIR/invalid-target.rs:70:57 | -70 | position, descriptor_set = 0, binding = 0, flat, // param-only - | ^^^^ +70 | uniform, position, descriptor_set = 0, binding = 0, flat, // param-only + | ^^^^ error: attribute is only valid on a function or closure, not on a foreign module --> $DIR/invalid-target.rs:71:5 @@ -463,26 +463,20 @@ error: attribute is only valid on a function or closure, not on a foreign module error: attribute is only valid on a struct, not on a static item --> $DIR/invalid-target.rs:103:5 | -103 | uniform, sampler, block, sampled_image, // struct-only (incl. `image_type`) +103 | sampler, block, sampled_image, // struct-only (incl. `image_type`) | ^^^^^^^ error: attribute is only valid on a struct, not on a static item --> $DIR/invalid-target.rs:103:14 | -103 | uniform, sampler, block, sampled_image, // struct-only (incl. `image_type`) - | ^^^^^^^ - -error: attribute is only valid on a struct, not on a static item - --> $DIR/invalid-target.rs:103:23 - | -103 | uniform, sampler, block, sampled_image, // struct-only (incl. `image_type`) - | ^^^^^ +103 | sampler, block, sampled_image, // struct-only (incl. `image_type`) + | ^^^^^ error: attribute is only valid on a struct, not on a static item - --> $DIR/invalid-target.rs:103:30 + --> $DIR/invalid-target.rs:103:21 | -103 | uniform, sampler, block, sampled_image, // struct-only (incl. `image_type`) - | ^^^^^^^^^^^^^ +103 | sampler, block, sampled_image, // struct-only (incl. `image_type`) + | ^^^^^^^^^^^^^ error: attribute is only valid on a struct, not on a static item --> $DIR/invalid-target.rs:104:5 @@ -499,26 +493,32 @@ error: attribute is only valid on a function, not on a static item error: attribute is only valid on a function parameter, not on a static item --> $DIR/invalid-target.rs:106:5 | -106 | position, descriptor_set = 0, binding = 0, flat, // param-only - | ^^^^^^^^ +106 | uniform, position, descriptor_set = 0, binding = 0, flat, // param-only + | ^^^^^^^ error: attribute is only valid on a function parameter, not on a static item - --> $DIR/invalid-target.rs:106:15 + --> $DIR/invalid-target.rs:106:14 | -106 | position, descriptor_set = 0, binding = 0, flat, // param-only - | ^^^^^^^^^^^^^^^^^^ +106 | uniform, position, descriptor_set = 0, binding = 0, flat, // param-only + | ^^^^^^^^ error: attribute is only valid on a function parameter, not on a static item - --> $DIR/invalid-target.rs:106:35 + --> $DIR/invalid-target.rs:106:24 | -106 | position, descriptor_set = 0, binding = 0, flat, // param-only - | ^^^^^^^^^^^ +106 | uniform, position, descriptor_set = 0, binding = 0, flat, // param-only + | ^^^^^^^^^^^^^^^^^^ error: attribute is only valid on a function parameter, not on a static item - --> $DIR/invalid-target.rs:106:48 + --> $DIR/invalid-target.rs:106:44 | -106 | position, descriptor_set = 0, binding = 0, flat, // param-only - | ^^^^ +106 | uniform, position, descriptor_set = 0, binding = 0, flat, // param-only + | ^^^^^^^^^^^ + +error: attribute is only valid on a function parameter, not on a static item + --> $DIR/invalid-target.rs:106:57 + | +106 | uniform, position, descriptor_set = 0, binding = 0, flat, // param-only + | ^^^^ error: attribute is only valid on a function or closure, not on a static item --> $DIR/invalid-target.rs:107:5 @@ -529,26 +529,20 @@ error: attribute is only valid on a function or closure, not on a static item error: attribute is only valid on a struct, not on a constant item --> $DIR/invalid-target.rs:112:5 | -112 | uniform, sampler, block, sampled_image, // struct-only (incl. `image_type`) +112 | sampler, block, sampled_image, // struct-only (incl. `image_type`) | ^^^^^^^ error: attribute is only valid on a struct, not on a constant item --> $DIR/invalid-target.rs:112:14 | -112 | uniform, sampler, block, sampled_image, // struct-only (incl. `image_type`) - | ^^^^^^^ +112 | sampler, block, sampled_image, // struct-only (incl. `image_type`) + | ^^^^^ error: attribute is only valid on a struct, not on a constant item - --> $DIR/invalid-target.rs:112:23 + --> $DIR/invalid-target.rs:112:21 | -112 | uniform, sampler, block, sampled_image, // struct-only (incl. `image_type`) - | ^^^^^ - -error: attribute is only valid on a struct, not on a constant item - --> $DIR/invalid-target.rs:112:30 - | -112 | uniform, sampler, block, sampled_image, // struct-only (incl. `image_type`) - | ^^^^^^^^^^^^^ +112 | sampler, block, sampled_image, // struct-only (incl. `image_type`) + | ^^^^^^^^^^^^^ error: attribute is only valid on a struct, not on a constant item --> $DIR/invalid-target.rs:113:5 @@ -565,26 +559,32 @@ error: attribute is only valid on a function, not on a constant item error: attribute is only valid on a function parameter, not on a constant item --> $DIR/invalid-target.rs:115:5 | -115 | position, descriptor_set = 0, binding = 0, flat, // param-only - | ^^^^^^^^ +115 | uniform, position, descriptor_set = 0, binding = 0, flat, // param-only + | ^^^^^^^ error: attribute is only valid on a function parameter, not on a constant item - --> $DIR/invalid-target.rs:115:15 + --> $DIR/invalid-target.rs:115:14 | -115 | position, descriptor_set = 0, binding = 0, flat, // param-only - | ^^^^^^^^^^^^^^^^^^ +115 | uniform, position, descriptor_set = 0, binding = 0, flat, // param-only + | ^^^^^^^^ error: attribute is only valid on a function parameter, not on a constant item - --> $DIR/invalid-target.rs:115:35 + --> $DIR/invalid-target.rs:115:24 | -115 | position, descriptor_set = 0, binding = 0, flat, // param-only - | ^^^^^^^^^^^ +115 | uniform, position, descriptor_set = 0, binding = 0, flat, // param-only + | ^^^^^^^^^^^^^^^^^^ error: attribute is only valid on a function parameter, not on a constant item - --> $DIR/invalid-target.rs:115:48 + --> $DIR/invalid-target.rs:115:44 | -115 | position, descriptor_set = 0, binding = 0, flat, // param-only - | ^^^^ +115 | uniform, position, descriptor_set = 0, binding = 0, flat, // param-only + | ^^^^^^^^^^^ + +error: attribute is only valid on a function parameter, not on a constant item + --> $DIR/invalid-target.rs:115:57 + | +115 | uniform, position, descriptor_set = 0, binding = 0, flat, // param-only + | ^^^^ error: attribute is only valid on a function or closure, not on a constant item --> $DIR/invalid-target.rs:116:5 @@ -595,26 +595,20 @@ error: attribute is only valid on a function or closure, not on a constant item error: attribute is only valid on a struct, not on a type alias --> $DIR/invalid-target.rs:121:5 | -121 | uniform, sampler, block, sampled_image, // struct-only (incl. `image_type`) +121 | sampler, block, sampled_image, // struct-only (incl. `image_type`) | ^^^^^^^ error: attribute is only valid on a struct, not on a type alias --> $DIR/invalid-target.rs:121:14 | -121 | uniform, sampler, block, sampled_image, // struct-only (incl. `image_type`) - | ^^^^^^^ - -error: attribute is only valid on a struct, not on a type alias - --> $DIR/invalid-target.rs:121:23 - | -121 | uniform, sampler, block, sampled_image, // struct-only (incl. `image_type`) - | ^^^^^ +121 | sampler, block, sampled_image, // struct-only (incl. `image_type`) + | ^^^^^ error: attribute is only valid on a struct, not on a type alias - --> $DIR/invalid-target.rs:121:30 + --> $DIR/invalid-target.rs:121:21 | -121 | uniform, sampler, block, sampled_image, // struct-only (incl. `image_type`) - | ^^^^^^^^^^^^^ +121 | sampler, block, sampled_image, // struct-only (incl. `image_type`) + | ^^^^^^^^^^^^^ error: attribute is only valid on a struct, not on a type alias --> $DIR/invalid-target.rs:122:5 @@ -631,26 +625,32 @@ error: attribute is only valid on a function, not on a type alias error: attribute is only valid on a function parameter, not on a type alias --> $DIR/invalid-target.rs:124:5 | -124 | position, descriptor_set = 0, binding = 0, flat, // param-only - | ^^^^^^^^ +124 | uniform, position, descriptor_set = 0, binding = 0, flat, // param-only + | ^^^^^^^ error: attribute is only valid on a function parameter, not on a type alias - --> $DIR/invalid-target.rs:124:15 + --> $DIR/invalid-target.rs:124:14 | -124 | position, descriptor_set = 0, binding = 0, flat, // param-only - | ^^^^^^^^^^^^^^^^^^ +124 | uniform, position, descriptor_set = 0, binding = 0, flat, // param-only + | ^^^^^^^^ error: attribute is only valid on a function parameter, not on a type alias - --> $DIR/invalid-target.rs:124:35 + --> $DIR/invalid-target.rs:124:24 | -124 | position, descriptor_set = 0, binding = 0, flat, // param-only - | ^^^^^^^^^^^ +124 | uniform, position, descriptor_set = 0, binding = 0, flat, // param-only + | ^^^^^^^^^^^^^^^^^^ error: attribute is only valid on a function parameter, not on a type alias - --> $DIR/invalid-target.rs:124:48 + --> $DIR/invalid-target.rs:124:44 | -124 | position, descriptor_set = 0, binding = 0, flat, // param-only - | ^^^^ +124 | uniform, position, descriptor_set = 0, binding = 0, flat, // param-only + | ^^^^^^^^^^^ + +error: attribute is only valid on a function parameter, not on a type alias + --> $DIR/invalid-target.rs:124:57 + | +124 | uniform, position, descriptor_set = 0, binding = 0, flat, // param-only + | ^^^^ error: attribute is only valid on a function or closure, not on a type alias --> $DIR/invalid-target.rs:125:5 @@ -661,26 +661,20 @@ error: attribute is only valid on a function or closure, not on a type alias error: attribute is only valid on a struct, not on a type alias --> $DIR/invalid-target.rs:130:5 | -130 | uniform, sampler, block, sampled_image, // struct-only (incl. `image_type`) +130 | sampler, block, sampled_image, // struct-only (incl. `image_type`) | ^^^^^^^ error: attribute is only valid on a struct, not on a type alias --> $DIR/invalid-target.rs:130:14 | -130 | uniform, sampler, block, sampled_image, // struct-only (incl. `image_type`) - | ^^^^^^^ +130 | sampler, block, sampled_image, // struct-only (incl. `image_type`) + | ^^^^^ error: attribute is only valid on a struct, not on a type alias - --> $DIR/invalid-target.rs:130:23 + --> $DIR/invalid-target.rs:130:21 | -130 | uniform, sampler, block, sampled_image, // struct-only (incl. `image_type`) - | ^^^^^ - -error: attribute is only valid on a struct, not on a type alias - --> $DIR/invalid-target.rs:130:30 - | -130 | uniform, sampler, block, sampled_image, // struct-only (incl. `image_type`) - | ^^^^^^^^^^^^^ +130 | sampler, block, sampled_image, // struct-only (incl. `image_type`) + | ^^^^^^^^^^^^^ error: attribute is only valid on a struct, not on a type alias --> $DIR/invalid-target.rs:131:5 @@ -697,26 +691,32 @@ error: attribute is only valid on a function, not on a type alias error: attribute is only valid on a function parameter, not on a type alias --> $DIR/invalid-target.rs:133:5 | -133 | position, descriptor_set = 0, binding = 0, flat, // param-only - | ^^^^^^^^ +133 | uniform, position, descriptor_set = 0, binding = 0, flat, // param-only + | ^^^^^^^ error: attribute is only valid on a function parameter, not on a type alias - --> $DIR/invalid-target.rs:133:15 + --> $DIR/invalid-target.rs:133:14 | -133 | position, descriptor_set = 0, binding = 0, flat, // param-only - | ^^^^^^^^^^^^^^^^^^ +133 | uniform, position, descriptor_set = 0, binding = 0, flat, // param-only + | ^^^^^^^^ error: attribute is only valid on a function parameter, not on a type alias - --> $DIR/invalid-target.rs:133:35 + --> $DIR/invalid-target.rs:133:24 | -133 | position, descriptor_set = 0, binding = 0, flat, // param-only - | ^^^^^^^^^^^ +133 | uniform, position, descriptor_set = 0, binding = 0, flat, // param-only + | ^^^^^^^^^^^^^^^^^^ error: attribute is only valid on a function parameter, not on a type alias - --> $DIR/invalid-target.rs:133:48 + --> $DIR/invalid-target.rs:133:44 | -133 | position, descriptor_set = 0, binding = 0, flat, // param-only - | ^^^^ +133 | uniform, position, descriptor_set = 0, binding = 0, flat, // param-only + | ^^^^^^^^^^^ + +error: attribute is only valid on a function parameter, not on a type alias + --> $DIR/invalid-target.rs:133:57 + | +133 | uniform, position, descriptor_set = 0, binding = 0, flat, // param-only + | ^^^^ error: attribute is only valid on a function or closure, not on a type alias --> $DIR/invalid-target.rs:134:5 @@ -727,26 +727,20 @@ error: attribute is only valid on a function or closure, not on a type alias error: attribute is only valid on a struct, not on a enum --> $DIR/invalid-target.rs:141:5 | -141 | uniform, sampler, block, sampled_image, // struct-only (incl. `image_type`) +141 | sampler, block, sampled_image, // struct-only (incl. `image_type`) | ^^^^^^^ error: attribute is only valid on a struct, not on a enum --> $DIR/invalid-target.rs:141:14 | -141 | uniform, sampler, block, sampled_image, // struct-only (incl. `image_type`) - | ^^^^^^^ +141 | sampler, block, sampled_image, // struct-only (incl. `image_type`) + | ^^^^^ error: attribute is only valid on a struct, not on a enum - --> $DIR/invalid-target.rs:141:23 + --> $DIR/invalid-target.rs:141:21 | -141 | uniform, sampler, block, sampled_image, // struct-only (incl. `image_type`) - | ^^^^^ - -error: attribute is only valid on a struct, not on a enum - --> $DIR/invalid-target.rs:141:30 - | -141 | uniform, sampler, block, sampled_image, // struct-only (incl. `image_type`) - | ^^^^^^^^^^^^^ +141 | sampler, block, sampled_image, // struct-only (incl. `image_type`) + | ^^^^^^^^^^^^^ error: attribute is only valid on a struct, not on a enum --> $DIR/invalid-target.rs:142:5 @@ -763,26 +757,32 @@ error: attribute is only valid on a function, not on a enum error: attribute is only valid on a function parameter, not on a enum --> $DIR/invalid-target.rs:144:5 | -144 | position, descriptor_set = 0, binding = 0, flat, // param-only - | ^^^^^^^^ +144 | uniform, position, descriptor_set = 0, binding = 0, flat, // param-only + | ^^^^^^^ + +error: attribute is only valid on a function parameter, not on a enum + --> $DIR/invalid-target.rs:144:14 + | +144 | uniform, position, descriptor_set = 0, binding = 0, flat, // param-only + | ^^^^^^^^ error: attribute is only valid on a function parameter, not on a enum - --> $DIR/invalid-target.rs:144:15 + --> $DIR/invalid-target.rs:144:24 | -144 | position, descriptor_set = 0, binding = 0, flat, // param-only - | ^^^^^^^^^^^^^^^^^^ +144 | uniform, position, descriptor_set = 0, binding = 0, flat, // param-only + | ^^^^^^^^^^^^^^^^^^ error: attribute is only valid on a function parameter, not on a enum - --> $DIR/invalid-target.rs:144:35 + --> $DIR/invalid-target.rs:144:44 | -144 | position, descriptor_set = 0, binding = 0, flat, // param-only - | ^^^^^^^^^^^ +144 | uniform, position, descriptor_set = 0, binding = 0, flat, // param-only + | ^^^^^^^^^^^ error: attribute is only valid on a function parameter, not on a enum - --> $DIR/invalid-target.rs:144:48 + --> $DIR/invalid-target.rs:144:57 | -144 | position, descriptor_set = 0, binding = 0, flat, // param-only - | ^^^^ +144 | uniform, position, descriptor_set = 0, binding = 0, flat, // param-only + | ^^^^ error: attribute is only valid on a function or closure, not on a enum --> $DIR/invalid-target.rs:145:5 @@ -793,26 +793,20 @@ error: attribute is only valid on a function or closure, not on a enum error: attribute is only valid on a struct, not on a enum variant --> $DIR/invalid-target.rs:149:9 | -149 | uniform, sampler, block, sampled_image, // struct-only (incl. `image_type`) +149 | sampler, block, sampled_image, // struct-only (incl. `image_type`) | ^^^^^^^ error: attribute is only valid on a struct, not on a enum variant --> $DIR/invalid-target.rs:149:18 | -149 | uniform, sampler, block, sampled_image, // struct-only (incl. `image_type`) - | ^^^^^^^ - -error: attribute is only valid on a struct, not on a enum variant - --> $DIR/invalid-target.rs:149:27 - | -149 | uniform, sampler, block, sampled_image, // struct-only (incl. `image_type`) - | ^^^^^ +149 | sampler, block, sampled_image, // struct-only (incl. `image_type`) + | ^^^^^ error: attribute is only valid on a struct, not on a enum variant - --> $DIR/invalid-target.rs:149:34 + --> $DIR/invalid-target.rs:149:25 | -149 | uniform, sampler, block, sampled_image, // struct-only (incl. `image_type`) - | ^^^^^^^^^^^^^ +149 | sampler, block, sampled_image, // struct-only (incl. `image_type`) + | ^^^^^^^^^^^^^ error: attribute is only valid on a struct, not on a enum variant --> $DIR/invalid-target.rs:150:9 @@ -829,26 +823,32 @@ error: attribute is only valid on a function, not on a enum variant error: attribute is only valid on a function parameter, not on a enum variant --> $DIR/invalid-target.rs:152:9 | -152 | position, descriptor_set = 0, binding = 0, flat, // param-only - | ^^^^^^^^ +152 | uniform, position, descriptor_set = 0, binding = 0, flat, // param-only + | ^^^^^^^ + +error: attribute is only valid on a function parameter, not on a enum variant + --> $DIR/invalid-target.rs:152:18 + | +152 | uniform, position, descriptor_set = 0, binding = 0, flat, // param-only + | ^^^^^^^^ error: attribute is only valid on a function parameter, not on a enum variant - --> $DIR/invalid-target.rs:152:19 + --> $DIR/invalid-target.rs:152:28 | -152 | position, descriptor_set = 0, binding = 0, flat, // param-only - | ^^^^^^^^^^^^^^^^^^ +152 | uniform, position, descriptor_set = 0, binding = 0, flat, // param-only + | ^^^^^^^^^^^^^^^^^^ error: attribute is only valid on a function parameter, not on a enum variant - --> $DIR/invalid-target.rs:152:39 + --> $DIR/invalid-target.rs:152:48 | -152 | position, descriptor_set = 0, binding = 0, flat, // param-only - | ^^^^^^^^^^^ +152 | uniform, position, descriptor_set = 0, binding = 0, flat, // param-only + | ^^^^^^^^^^^ error: attribute is only valid on a function parameter, not on a enum variant - --> $DIR/invalid-target.rs:152:52 + --> $DIR/invalid-target.rs:152:61 | -152 | position, descriptor_set = 0, binding = 0, flat, // param-only - | ^^^^ +152 | uniform, position, descriptor_set = 0, binding = 0, flat, // param-only + | ^^^^ error: attribute is only valid on a function or closure, not on a enum variant --> $DIR/invalid-target.rs:153:9 @@ -859,26 +859,20 @@ error: attribute is only valid on a function or closure, not on a enum variant error: attribute is only valid on a struct, not on a struct field --> $DIR/invalid-target.rs:157:13 | -157 | uniform, sampler, block, sampled_image, // struct-only (incl. `image_type`) +157 | sampler, block, sampled_image, // struct-only (incl. `image_type`) | ^^^^^^^ error: attribute is only valid on a struct, not on a struct field --> $DIR/invalid-target.rs:157:22 | -157 | uniform, sampler, block, sampled_image, // struct-only (incl. `image_type`) - | ^^^^^^^ +157 | sampler, block, sampled_image, // struct-only (incl. `image_type`) + | ^^^^^ error: attribute is only valid on a struct, not on a struct field - --> $DIR/invalid-target.rs:157:31 + --> $DIR/invalid-target.rs:157:29 | -157 | uniform, sampler, block, sampled_image, // struct-only (incl. `image_type`) - | ^^^^^ - -error: attribute is only valid on a struct, not on a struct field - --> $DIR/invalid-target.rs:157:38 - | -157 | uniform, sampler, block, sampled_image, // struct-only (incl. `image_type`) - | ^^^^^^^^^^^^^ +157 | sampler, block, sampled_image, // struct-only (incl. `image_type`) + | ^^^^^^^^^^^^^ error: attribute is only valid on a struct, not on a struct field --> $DIR/invalid-target.rs:158:13 @@ -895,26 +889,32 @@ error: attribute is only valid on a function, not on a struct field error: attribute is only valid on a function parameter, not on a struct field --> $DIR/invalid-target.rs:160:13 | -160 | position, descriptor_set = 0, binding = 0, flat, // param-only - | ^^^^^^^^ +160 | uniform, position, descriptor_set = 0, binding = 0, flat, // param-only + | ^^^^^^^ error: attribute is only valid on a function parameter, not on a struct field - --> $DIR/invalid-target.rs:160:23 + --> $DIR/invalid-target.rs:160:22 | -160 | position, descriptor_set = 0, binding = 0, flat, // param-only - | ^^^^^^^^^^^^^^^^^^ +160 | uniform, position, descriptor_set = 0, binding = 0, flat, // param-only + | ^^^^^^^^ error: attribute is only valid on a function parameter, not on a struct field - --> $DIR/invalid-target.rs:160:43 + --> $DIR/invalid-target.rs:160:32 | -160 | position, descriptor_set = 0, binding = 0, flat, // param-only - | ^^^^^^^^^^^ +160 | uniform, position, descriptor_set = 0, binding = 0, flat, // param-only + | ^^^^^^^^^^^^^^^^^^ error: attribute is only valid on a function parameter, not on a struct field - --> $DIR/invalid-target.rs:160:56 + --> $DIR/invalid-target.rs:160:52 | -160 | position, descriptor_set = 0, binding = 0, flat, // param-only - | ^^^^ +160 | uniform, position, descriptor_set = 0, binding = 0, flat, // param-only + | ^^^^^^^^^^^ + +error: attribute is only valid on a function parameter, not on a struct field + --> $DIR/invalid-target.rs:160:65 + | +160 | uniform, position, descriptor_set = 0, binding = 0, flat, // param-only + | ^^^^ error: attribute is only valid on a function or closure, not on a struct field --> $DIR/invalid-target.rs:161:13 @@ -925,26 +925,20 @@ error: attribute is only valid on a function or closure, not on a struct field error: attribute is only valid on a struct, not on a union --> $DIR/invalid-target.rs:168:5 | -168 | uniform, sampler, block, sampled_image, // struct-only (incl. `image_type`) +168 | sampler, block, sampled_image, // struct-only (incl. `image_type`) | ^^^^^^^ error: attribute is only valid on a struct, not on a union --> $DIR/invalid-target.rs:168:14 | -168 | uniform, sampler, block, sampled_image, // struct-only (incl. `image_type`) - | ^^^^^^^ - -error: attribute is only valid on a struct, not on a union - --> $DIR/invalid-target.rs:168:23 - | -168 | uniform, sampler, block, sampled_image, // struct-only (incl. `image_type`) - | ^^^^^ +168 | sampler, block, sampled_image, // struct-only (incl. `image_type`) + | ^^^^^ error: attribute is only valid on a struct, not on a union - --> $DIR/invalid-target.rs:168:30 + --> $DIR/invalid-target.rs:168:21 | -168 | uniform, sampler, block, sampled_image, // struct-only (incl. `image_type`) - | ^^^^^^^^^^^^^ +168 | sampler, block, sampled_image, // struct-only (incl. `image_type`) + | ^^^^^^^^^^^^^ error: attribute is only valid on a struct, not on a union --> $DIR/invalid-target.rs:169:5 @@ -961,26 +955,32 @@ error: attribute is only valid on a function, not on a union error: attribute is only valid on a function parameter, not on a union --> $DIR/invalid-target.rs:171:5 | -171 | position, descriptor_set = 0, binding = 0, flat, // param-only - | ^^^^^^^^ +171 | uniform, position, descriptor_set = 0, binding = 0, flat, // param-only + | ^^^^^^^ + +error: attribute is only valid on a function parameter, not on a union + --> $DIR/invalid-target.rs:171:14 + | +171 | uniform, position, descriptor_set = 0, binding = 0, flat, // param-only + | ^^^^^^^^ error: attribute is only valid on a function parameter, not on a union - --> $DIR/invalid-target.rs:171:15 + --> $DIR/invalid-target.rs:171:24 | -171 | position, descriptor_set = 0, binding = 0, flat, // param-only - | ^^^^^^^^^^^^^^^^^^ +171 | uniform, position, descriptor_set = 0, binding = 0, flat, // param-only + | ^^^^^^^^^^^^^^^^^^ error: attribute is only valid on a function parameter, not on a union - --> $DIR/invalid-target.rs:171:35 + --> $DIR/invalid-target.rs:171:44 | -171 | position, descriptor_set = 0, binding = 0, flat, // param-only - | ^^^^^^^^^^^ +171 | uniform, position, descriptor_set = 0, binding = 0, flat, // param-only + | ^^^^^^^^^^^ error: attribute is only valid on a function parameter, not on a union - --> $DIR/invalid-target.rs:171:48 + --> $DIR/invalid-target.rs:171:57 | -171 | position, descriptor_set = 0, binding = 0, flat, // param-only - | ^^^^ +171 | uniform, position, descriptor_set = 0, binding = 0, flat, // param-only + | ^^^^ error: attribute is only valid on a function or closure, not on a union --> $DIR/invalid-target.rs:172:5 @@ -991,26 +991,20 @@ error: attribute is only valid on a function or closure, not on a union error: attribute is only valid on a struct, not on a struct field --> $DIR/invalid-target.rs:176:9 | -176 | uniform, sampler, block, sampled_image, // struct-only (incl. `image_type`) +176 | sampler, block, sampled_image, // struct-only (incl. `image_type`) | ^^^^^^^ error: attribute is only valid on a struct, not on a struct field --> $DIR/invalid-target.rs:176:18 | -176 | uniform, sampler, block, sampled_image, // struct-only (incl. `image_type`) - | ^^^^^^^ - -error: attribute is only valid on a struct, not on a struct field - --> $DIR/invalid-target.rs:176:27 - | -176 | uniform, sampler, block, sampled_image, // struct-only (incl. `image_type`) - | ^^^^^ +176 | sampler, block, sampled_image, // struct-only (incl. `image_type`) + | ^^^^^ error: attribute is only valid on a struct, not on a struct field - --> $DIR/invalid-target.rs:176:34 + --> $DIR/invalid-target.rs:176:25 | -176 | uniform, sampler, block, sampled_image, // struct-only (incl. `image_type`) - | ^^^^^^^^^^^^^ +176 | sampler, block, sampled_image, // struct-only (incl. `image_type`) + | ^^^^^^^^^^^^^ error: attribute is only valid on a struct, not on a struct field --> $DIR/invalid-target.rs:177:9 @@ -1027,26 +1021,32 @@ error: attribute is only valid on a function, not on a struct field error: attribute is only valid on a function parameter, not on a struct field --> $DIR/invalid-target.rs:179:9 | -179 | position, descriptor_set = 0, binding = 0, flat, // param-only - | ^^^^^^^^ +179 | uniform, position, descriptor_set = 0, binding = 0, flat, // param-only + | ^^^^^^^ + +error: attribute is only valid on a function parameter, not on a struct field + --> $DIR/invalid-target.rs:179:18 + | +179 | uniform, position, descriptor_set = 0, binding = 0, flat, // param-only + | ^^^^^^^^ error: attribute is only valid on a function parameter, not on a struct field - --> $DIR/invalid-target.rs:179:19 + --> $DIR/invalid-target.rs:179:28 | -179 | position, descriptor_set = 0, binding = 0, flat, // param-only - | ^^^^^^^^^^^^^^^^^^ +179 | uniform, position, descriptor_set = 0, binding = 0, flat, // param-only + | ^^^^^^^^^^^^^^^^^^ error: attribute is only valid on a function parameter, not on a struct field - --> $DIR/invalid-target.rs:179:39 + --> $DIR/invalid-target.rs:179:48 | -179 | position, descriptor_set = 0, binding = 0, flat, // param-only - | ^^^^^^^^^^^ +179 | uniform, position, descriptor_set = 0, binding = 0, flat, // param-only + | ^^^^^^^^^^^ error: attribute is only valid on a function parameter, not on a struct field - --> $DIR/invalid-target.rs:179:52 + --> $DIR/invalid-target.rs:179:61 | -179 | position, descriptor_set = 0, binding = 0, flat, // param-only - | ^^^^ +179 | uniform, position, descriptor_set = 0, binding = 0, flat, // param-only + | ^^^^ error: attribute is only valid on a function or closure, not on a struct field --> $DIR/invalid-target.rs:180:9 @@ -1063,26 +1063,32 @@ error: attribute is only valid on a function, not on a struct error: attribute is only valid on a function parameter, not on a struct --> $DIR/invalid-target.rs:187:5 | -187 | position, descriptor_set = 0, binding = 0, flat, // param-only - | ^^^^^^^^ +187 | uniform, position, descriptor_set = 0, binding = 0, flat, // param-only + | ^^^^^^^ + +error: attribute is only valid on a function parameter, not on a struct + --> $DIR/invalid-target.rs:187:14 + | +187 | uniform, position, descriptor_set = 0, binding = 0, flat, // param-only + | ^^^^^^^^ error: attribute is only valid on a function parameter, not on a struct - --> $DIR/invalid-target.rs:187:15 + --> $DIR/invalid-target.rs:187:24 | -187 | position, descriptor_set = 0, binding = 0, flat, // param-only - | ^^^^^^^^^^^^^^^^^^ +187 | uniform, position, descriptor_set = 0, binding = 0, flat, // param-only + | ^^^^^^^^^^^^^^^^^^ error: attribute is only valid on a function parameter, not on a struct - --> $DIR/invalid-target.rs:187:35 + --> $DIR/invalid-target.rs:187:44 | -187 | position, descriptor_set = 0, binding = 0, flat, // param-only - | ^^^^^^^^^^^ +187 | uniform, position, descriptor_set = 0, binding = 0, flat, // param-only + | ^^^^^^^^^^^ error: attribute is only valid on a function parameter, not on a struct - --> $DIR/invalid-target.rs:187:48 + --> $DIR/invalid-target.rs:187:57 | -187 | position, descriptor_set = 0, binding = 0, flat, // param-only - | ^^^^ +187 | uniform, position, descriptor_set = 0, binding = 0, flat, // param-only + | ^^^^ error: attribute is only valid on a function or closure, not on a struct --> $DIR/invalid-target.rs:188:5 @@ -1093,26 +1099,20 @@ error: attribute is only valid on a function or closure, not on a struct error: attribute is only valid on a struct, not on a struct field --> $DIR/invalid-target.rs:192:9 | -192 | uniform, sampler, block, sampled_image, // struct-only (incl. `image_type`) +192 | sampler, block, sampled_image, // struct-only (incl. `image_type`) | ^^^^^^^ error: attribute is only valid on a struct, not on a struct field --> $DIR/invalid-target.rs:192:18 | -192 | uniform, sampler, block, sampled_image, // struct-only (incl. `image_type`) - | ^^^^^^^ +192 | sampler, block, sampled_image, // struct-only (incl. `image_type`) + | ^^^^^ error: attribute is only valid on a struct, not on a struct field - --> $DIR/invalid-target.rs:192:27 + --> $DIR/invalid-target.rs:192:25 | -192 | uniform, sampler, block, sampled_image, // struct-only (incl. `image_type`) - | ^^^^^ - -error: attribute is only valid on a struct, not on a struct field - --> $DIR/invalid-target.rs:192:34 - | -192 | uniform, sampler, block, sampled_image, // struct-only (incl. `image_type`) - | ^^^^^^^^^^^^^ +192 | sampler, block, sampled_image, // struct-only (incl. `image_type`) + | ^^^^^^^^^^^^^ error: attribute is only valid on a struct, not on a struct field --> $DIR/invalid-target.rs:193:9 @@ -1129,26 +1129,32 @@ error: attribute is only valid on a function, not on a struct field error: attribute is only valid on a function parameter, not on a struct field --> $DIR/invalid-target.rs:195:9 | -195 | position, descriptor_set = 0, binding = 0, flat, // param-only - | ^^^^^^^^ +195 | uniform, position, descriptor_set = 0, binding = 0, flat, // param-only + | ^^^^^^^ + +error: attribute is only valid on a function parameter, not on a struct field + --> $DIR/invalid-target.rs:195:18 + | +195 | uniform, position, descriptor_set = 0, binding = 0, flat, // param-only + | ^^^^^^^^ error: attribute is only valid on a function parameter, not on a struct field - --> $DIR/invalid-target.rs:195:19 + --> $DIR/invalid-target.rs:195:28 | -195 | position, descriptor_set = 0, binding = 0, flat, // param-only - | ^^^^^^^^^^^^^^^^^^ +195 | uniform, position, descriptor_set = 0, binding = 0, flat, // param-only + | ^^^^^^^^^^^^^^^^^^ error: attribute is only valid on a function parameter, not on a struct field - --> $DIR/invalid-target.rs:195:39 + --> $DIR/invalid-target.rs:195:48 | -195 | position, descriptor_set = 0, binding = 0, flat, // param-only - | ^^^^^^^^^^^ +195 | uniform, position, descriptor_set = 0, binding = 0, flat, // param-only + | ^^^^^^^^^^^ error: attribute is only valid on a function parameter, not on a struct field - --> $DIR/invalid-target.rs:195:52 + --> $DIR/invalid-target.rs:195:61 | -195 | position, descriptor_set = 0, binding = 0, flat, // param-only - | ^^^^ +195 | uniform, position, descriptor_set = 0, binding = 0, flat, // param-only + | ^^^^ error: attribute is only valid on a function or closure, not on a struct field --> $DIR/invalid-target.rs:196:9 @@ -1159,26 +1165,20 @@ error: attribute is only valid on a function or closure, not on a struct field error: attribute is only valid on a struct, not on a item --> $DIR/invalid-target.rs:202:5 | -202 | uniform, sampler, block, sampled_image, // struct-only (incl. `image_type`) +202 | sampler, block, sampled_image, // struct-only (incl. `image_type`) | ^^^^^^^ error: attribute is only valid on a struct, not on a item --> $DIR/invalid-target.rs:202:14 | -202 | uniform, sampler, block, sampled_image, // struct-only (incl. `image_type`) - | ^^^^^^^ +202 | sampler, block, sampled_image, // struct-only (incl. `image_type`) + | ^^^^^ error: attribute is only valid on a struct, not on a item - --> $DIR/invalid-target.rs:202:23 + --> $DIR/invalid-target.rs:202:21 | -202 | uniform, sampler, block, sampled_image, // struct-only (incl. `image_type`) - | ^^^^^ - -error: attribute is only valid on a struct, not on a item - --> $DIR/invalid-target.rs:202:30 - | -202 | uniform, sampler, block, sampled_image, // struct-only (incl. `image_type`) - | ^^^^^^^^^^^^^ +202 | sampler, block, sampled_image, // struct-only (incl. `image_type`) + | ^^^^^^^^^^^^^ error: attribute is only valid on a struct, not on a item --> $DIR/invalid-target.rs:203:5 @@ -1195,26 +1195,32 @@ error: attribute is only valid on a function, not on a item error: attribute is only valid on a function parameter, not on a item --> $DIR/invalid-target.rs:205:5 | -205 | position, descriptor_set = 0, binding = 0, flat, // param-only - | ^^^^^^^^ +205 | uniform, position, descriptor_set = 0, binding = 0, flat, // param-only + | ^^^^^^^ error: attribute is only valid on a function parameter, not on a item - --> $DIR/invalid-target.rs:205:15 + --> $DIR/invalid-target.rs:205:14 | -205 | position, descriptor_set = 0, binding = 0, flat, // param-only - | ^^^^^^^^^^^^^^^^^^ +205 | uniform, position, descriptor_set = 0, binding = 0, flat, // param-only + | ^^^^^^^^ error: attribute is only valid on a function parameter, not on a item - --> $DIR/invalid-target.rs:205:35 + --> $DIR/invalid-target.rs:205:24 | -205 | position, descriptor_set = 0, binding = 0, flat, // param-only - | ^^^^^^^^^^^ +205 | uniform, position, descriptor_set = 0, binding = 0, flat, // param-only + | ^^^^^^^^^^^^^^^^^^ error: attribute is only valid on a function parameter, not on a item - --> $DIR/invalid-target.rs:205:48 + --> $DIR/invalid-target.rs:205:44 | -205 | position, descriptor_set = 0, binding = 0, flat, // param-only - | ^^^^ +205 | uniform, position, descriptor_set = 0, binding = 0, flat, // param-only + | ^^^^^^^^^^^ + +error: attribute is only valid on a function parameter, not on a item + --> $DIR/invalid-target.rs:205:57 + | +205 | uniform, position, descriptor_set = 0, binding = 0, flat, // param-only + | ^^^^ error: attribute is only valid on a function or closure, not on a item --> $DIR/invalid-target.rs:206:5 @@ -1225,26 +1231,20 @@ error: attribute is only valid on a function or closure, not on a item error: attribute is only valid on a struct, not on a trait alias --> $DIR/invalid-target.rs:227:5 | -227 | uniform, sampler, block, sampled_image, // struct-only (incl. `image_type`) +227 | sampler, block, sampled_image, // struct-only (incl. `image_type`) | ^^^^^^^ error: attribute is only valid on a struct, not on a trait alias --> $DIR/invalid-target.rs:227:14 | -227 | uniform, sampler, block, sampled_image, // struct-only (incl. `image_type`) - | ^^^^^^^ - -error: attribute is only valid on a struct, not on a trait alias - --> $DIR/invalid-target.rs:227:23 - | -227 | uniform, sampler, block, sampled_image, // struct-only (incl. `image_type`) - | ^^^^^ +227 | sampler, block, sampled_image, // struct-only (incl. `image_type`) + | ^^^^^ error: attribute is only valid on a struct, not on a trait alias - --> $DIR/invalid-target.rs:227:30 + --> $DIR/invalid-target.rs:227:21 | -227 | uniform, sampler, block, sampled_image, // struct-only (incl. `image_type`) - | ^^^^^^^^^^^^^ +227 | sampler, block, sampled_image, // struct-only (incl. `image_type`) + | ^^^^^^^^^^^^^ error: attribute is only valid on a struct, not on a trait alias --> $DIR/invalid-target.rs:228:5 @@ -1261,26 +1261,32 @@ error: attribute is only valid on a function, not on a trait alias error: attribute is only valid on a function parameter, not on a trait alias --> $DIR/invalid-target.rs:230:5 | -230 | position, descriptor_set = 0, binding = 0, flat, // param-only - | ^^^^^^^^ +230 | uniform, position, descriptor_set = 0, binding = 0, flat, // param-only + | ^^^^^^^ + +error: attribute is only valid on a function parameter, not on a trait alias + --> $DIR/invalid-target.rs:230:14 + | +230 | uniform, position, descriptor_set = 0, binding = 0, flat, // param-only + | ^^^^^^^^ error: attribute is only valid on a function parameter, not on a trait alias - --> $DIR/invalid-target.rs:230:15 + --> $DIR/invalid-target.rs:230:24 | -230 | position, descriptor_set = 0, binding = 0, flat, // param-only - | ^^^^^^^^^^^^^^^^^^ +230 | uniform, position, descriptor_set = 0, binding = 0, flat, // param-only + | ^^^^^^^^^^^^^^^^^^ error: attribute is only valid on a function parameter, not on a trait alias - --> $DIR/invalid-target.rs:230:35 + --> $DIR/invalid-target.rs:230:44 | -230 | position, descriptor_set = 0, binding = 0, flat, // param-only - | ^^^^^^^^^^^ +230 | uniform, position, descriptor_set = 0, binding = 0, flat, // param-only + | ^^^^^^^^^^^ error: attribute is only valid on a function parameter, not on a trait alias - --> $DIR/invalid-target.rs:230:48 + --> $DIR/invalid-target.rs:230:57 | -230 | position, descriptor_set = 0, binding = 0, flat, // param-only - | ^^^^ +230 | uniform, position, descriptor_set = 0, binding = 0, flat, // param-only + | ^^^^ error: attribute is only valid on a function or closure, not on a trait alias --> $DIR/invalid-target.rs:231:5 @@ -1291,26 +1297,20 @@ error: attribute is only valid on a function or closure, not on a trait alias error: attribute is only valid on a struct, not on a trait --> $DIR/invalid-target.rs:236:5 | -236 | uniform, sampler, block, sampled_image, // struct-only (incl. `image_type`) +236 | sampler, block, sampled_image, // struct-only (incl. `image_type`) | ^^^^^^^ error: attribute is only valid on a struct, not on a trait --> $DIR/invalid-target.rs:236:14 | -236 | uniform, sampler, block, sampled_image, // struct-only (incl. `image_type`) - | ^^^^^^^ +236 | sampler, block, sampled_image, // struct-only (incl. `image_type`) + | ^^^^^ error: attribute is only valid on a struct, not on a trait - --> $DIR/invalid-target.rs:236:23 + --> $DIR/invalid-target.rs:236:21 | -236 | uniform, sampler, block, sampled_image, // struct-only (incl. `image_type`) - | ^^^^^ - -error: attribute is only valid on a struct, not on a trait - --> $DIR/invalid-target.rs:236:30 - | -236 | uniform, sampler, block, sampled_image, // struct-only (incl. `image_type`) - | ^^^^^^^^^^^^^ +236 | sampler, block, sampled_image, // struct-only (incl. `image_type`) + | ^^^^^^^^^^^^^ error: attribute is only valid on a struct, not on a trait --> $DIR/invalid-target.rs:237:5 @@ -1327,26 +1327,32 @@ error: attribute is only valid on a function, not on a trait error: attribute is only valid on a function parameter, not on a trait --> $DIR/invalid-target.rs:239:5 | -239 | position, descriptor_set = 0, binding = 0, flat, // param-only - | ^^^^^^^^ +239 | uniform, position, descriptor_set = 0, binding = 0, flat, // param-only + | ^^^^^^^ error: attribute is only valid on a function parameter, not on a trait - --> $DIR/invalid-target.rs:239:15 + --> $DIR/invalid-target.rs:239:14 | -239 | position, descriptor_set = 0, binding = 0, flat, // param-only - | ^^^^^^^^^^^^^^^^^^ +239 | uniform, position, descriptor_set = 0, binding = 0, flat, // param-only + | ^^^^^^^^ error: attribute is only valid on a function parameter, not on a trait - --> $DIR/invalid-target.rs:239:35 + --> $DIR/invalid-target.rs:239:24 | -239 | position, descriptor_set = 0, binding = 0, flat, // param-only - | ^^^^^^^^^^^ +239 | uniform, position, descriptor_set = 0, binding = 0, flat, // param-only + | ^^^^^^^^^^^^^^^^^^ error: attribute is only valid on a function parameter, not on a trait - --> $DIR/invalid-target.rs:239:48 + --> $DIR/invalid-target.rs:239:44 | -239 | position, descriptor_set = 0, binding = 0, flat, // param-only - | ^^^^ +239 | uniform, position, descriptor_set = 0, binding = 0, flat, // param-only + | ^^^^^^^^^^^ + +error: attribute is only valid on a function parameter, not on a trait + --> $DIR/invalid-target.rs:239:57 + | +239 | uniform, position, descriptor_set = 0, binding = 0, flat, // param-only + | ^^^^ error: attribute is only valid on a function or closure, not on a trait --> $DIR/invalid-target.rs:240:5 @@ -1357,26 +1363,20 @@ error: attribute is only valid on a function or closure, not on a trait error: attribute is only valid on a struct, not on a item --> $DIR/invalid-target.rs:279:5 | -279 | uniform, sampler, block, sampled_image, // struct-only (incl. `image_type`) +279 | sampler, block, sampled_image, // struct-only (incl. `image_type`) | ^^^^^^^ error: attribute is only valid on a struct, not on a item --> $DIR/invalid-target.rs:279:14 | -279 | uniform, sampler, block, sampled_image, // struct-only (incl. `image_type`) - | ^^^^^^^ +279 | sampler, block, sampled_image, // struct-only (incl. `image_type`) + | ^^^^^ error: attribute is only valid on a struct, not on a item - --> $DIR/invalid-target.rs:279:23 + --> $DIR/invalid-target.rs:279:21 | -279 | uniform, sampler, block, sampled_image, // struct-only (incl. `image_type`) - | ^^^^^ - -error: attribute is only valid on a struct, not on a item - --> $DIR/invalid-target.rs:279:30 - | -279 | uniform, sampler, block, sampled_image, // struct-only (incl. `image_type`) - | ^^^^^^^^^^^^^ +279 | sampler, block, sampled_image, // struct-only (incl. `image_type`) + | ^^^^^^^^^^^^^ error: attribute is only valid on a struct, not on a item --> $DIR/invalid-target.rs:280:5 @@ -1393,26 +1393,32 @@ error: attribute is only valid on a function, not on a item error: attribute is only valid on a function parameter, not on a item --> $DIR/invalid-target.rs:282:5 | -282 | position, descriptor_set = 0, binding = 0, flat, // param-only - | ^^^^^^^^ +282 | uniform, position, descriptor_set = 0, binding = 0, flat, // param-only + | ^^^^^^^ + +error: attribute is only valid on a function parameter, not on a item + --> $DIR/invalid-target.rs:282:14 + | +282 | uniform, position, descriptor_set = 0, binding = 0, flat, // param-only + | ^^^^^^^^ error: attribute is only valid on a function parameter, not on a item - --> $DIR/invalid-target.rs:282:15 + --> $DIR/invalid-target.rs:282:24 | -282 | position, descriptor_set = 0, binding = 0, flat, // param-only - | ^^^^^^^^^^^^^^^^^^ +282 | uniform, position, descriptor_set = 0, binding = 0, flat, // param-only + | ^^^^^^^^^^^^^^^^^^ error: attribute is only valid on a function parameter, not on a item - --> $DIR/invalid-target.rs:282:35 + --> $DIR/invalid-target.rs:282:44 | -282 | position, descriptor_set = 0, binding = 0, flat, // param-only - | ^^^^^^^^^^^ +282 | uniform, position, descriptor_set = 0, binding = 0, flat, // param-only + | ^^^^^^^^^^^ error: attribute is only valid on a function parameter, not on a item - --> $DIR/invalid-target.rs:282:48 + --> $DIR/invalid-target.rs:282:57 | -282 | position, descriptor_set = 0, binding = 0, flat, // param-only - | ^^^^ +282 | uniform, position, descriptor_set = 0, binding = 0, flat, // param-only + | ^^^^ error: attribute is only valid on a function or closure, not on a item --> $DIR/invalid-target.rs:283:5 @@ -1423,26 +1429,20 @@ error: attribute is only valid on a function or closure, not on a item error: attribute is only valid on a struct, not on a function --> $DIR/invalid-target.rs:313:5 | -313 | uniform, sampler, block, sampled_image, // struct-only (incl. `image_type`) +313 | sampler, block, sampled_image, // struct-only (incl. `image_type`) | ^^^^^^^ error: attribute is only valid on a struct, not on a function --> $DIR/invalid-target.rs:313:14 | -313 | uniform, sampler, block, sampled_image, // struct-only (incl. `image_type`) - | ^^^^^^^ - -error: attribute is only valid on a struct, not on a function - --> $DIR/invalid-target.rs:313:23 - | -313 | uniform, sampler, block, sampled_image, // struct-only (incl. `image_type`) - | ^^^^^ +313 | sampler, block, sampled_image, // struct-only (incl. `image_type`) + | ^^^^^ error: attribute is only valid on a struct, not on a function - --> $DIR/invalid-target.rs:313:30 + --> $DIR/invalid-target.rs:313:21 | -313 | uniform, sampler, block, sampled_image, // struct-only (incl. `image_type`) - | ^^^^^^^^^^^^^ +313 | sampler, block, sampled_image, // struct-only (incl. `image_type`) + | ^^^^^^^^^^^^^ error: attribute is only valid on a struct, not on a function --> $DIR/invalid-target.rs:314:5 @@ -1453,50 +1453,50 @@ error: attribute is only valid on a struct, not on a function error: attribute is only valid on a function parameter, not on a function --> $DIR/invalid-target.rs:315:5 | -315 | position, descriptor_set = 0, binding = 0, flat, // param-only - | ^^^^^^^^ +315 | uniform, position, descriptor_set = 0, binding = 0, flat, // param-only + | ^^^^^^^ error: attribute is only valid on a function parameter, not on a function - --> $DIR/invalid-target.rs:315:15 + --> $DIR/invalid-target.rs:315:14 | -315 | position, descriptor_set = 0, binding = 0, flat, // param-only - | ^^^^^^^^^^^^^^^^^^ +315 | uniform, position, descriptor_set = 0, binding = 0, flat, // param-only + | ^^^^^^^^ error: attribute is only valid on a function parameter, not on a function - --> $DIR/invalid-target.rs:315:35 + --> $DIR/invalid-target.rs:315:24 | -315 | position, descriptor_set = 0, binding = 0, flat, // param-only - | ^^^^^^^^^^^ +315 | uniform, position, descriptor_set = 0, binding = 0, flat, // param-only + | ^^^^^^^^^^^^^^^^^^ error: attribute is only valid on a function parameter, not on a function - --> $DIR/invalid-target.rs:315:48 + --> $DIR/invalid-target.rs:315:44 | -315 | position, descriptor_set = 0, binding = 0, flat, // param-only - | ^^^^ +315 | uniform, position, descriptor_set = 0, binding = 0, flat, // param-only + | ^^^^^^^^^^^ + +error: attribute is only valid on a function parameter, not on a function + --> $DIR/invalid-target.rs:315:57 + | +315 | uniform, position, descriptor_set = 0, binding = 0, flat, // param-only + | ^^^^ error: attribute is only valid on a struct, not on a function param --> $DIR/invalid-target.rs:319:9 | -319 | uniform, sampler, block, sampled_image, // struct-only (incl. `image_type`) +319 | sampler, block, sampled_image, // struct-only (incl. `image_type`) | ^^^^^^^ error: attribute is only valid on a struct, not on a function param --> $DIR/invalid-target.rs:319:18 | -319 | uniform, sampler, block, sampled_image, // struct-only (incl. `image_type`) - | ^^^^^^^ +319 | sampler, block, sampled_image, // struct-only (incl. `image_type`) + | ^^^^^ error: attribute is only valid on a struct, not on a function param - --> $DIR/invalid-target.rs:319:27 + --> $DIR/invalid-target.rs:319:25 | -319 | uniform, sampler, block, sampled_image, // struct-only (incl. `image_type`) - | ^^^^^ - -error: attribute is only valid on a struct, not on a function param - --> $DIR/invalid-target.rs:319:34 - | -319 | uniform, sampler, block, sampled_image, // struct-only (incl. `image_type`) - | ^^^^^^^^^^^^^ +319 | sampler, block, sampled_image, // struct-only (incl. `image_type`) + | ^^^^^^^^^^^^^ error: attribute is only valid on a struct, not on a function param --> $DIR/invalid-target.rs:320:9 @@ -1519,26 +1519,20 @@ error: attribute is only valid on a function or closure, not on a function param error: attribute is only valid on a struct, not on a statement --> $DIR/invalid-target.rs:327:9 | -327 | uniform, sampler, block, sampled_image, // struct-only (incl. `image_type`) +327 | sampler, block, sampled_image, // struct-only (incl. `image_type`) | ^^^^^^^ error: attribute is only valid on a struct, not on a statement --> $DIR/invalid-target.rs:327:18 | -327 | uniform, sampler, block, sampled_image, // struct-only (incl. `image_type`) - | ^^^^^^^ +327 | sampler, block, sampled_image, // struct-only (incl. `image_type`) + | ^^^^^ error: attribute is only valid on a struct, not on a statement - --> $DIR/invalid-target.rs:327:27 + --> $DIR/invalid-target.rs:327:25 | -327 | uniform, sampler, block, sampled_image, // struct-only (incl. `image_type`) - | ^^^^^ - -error: attribute is only valid on a struct, not on a statement - --> $DIR/invalid-target.rs:327:34 - | -327 | uniform, sampler, block, sampled_image, // struct-only (incl. `image_type`) - | ^^^^^^^^^^^^^ +327 | sampler, block, sampled_image, // struct-only (incl. `image_type`) + | ^^^^^^^^^^^^^ error: attribute is only valid on a struct, not on a statement --> $DIR/invalid-target.rs:328:9 @@ -1555,26 +1549,32 @@ error: attribute is only valid on a function, not on a statement error: attribute is only valid on a function parameter, not on a statement --> $DIR/invalid-target.rs:330:9 | -330 | position, descriptor_set = 0, binding = 0, flat, // param-only - | ^^^^^^^^ +330 | uniform, position, descriptor_set = 0, binding = 0, flat, // param-only + | ^^^^^^^ + +error: attribute is only valid on a function parameter, not on a statement + --> $DIR/invalid-target.rs:330:18 + | +330 | uniform, position, descriptor_set = 0, binding = 0, flat, // param-only + | ^^^^^^^^ error: attribute is only valid on a function parameter, not on a statement - --> $DIR/invalid-target.rs:330:19 + --> $DIR/invalid-target.rs:330:28 | -330 | position, descriptor_set = 0, binding = 0, flat, // param-only - | ^^^^^^^^^^^^^^^^^^ +330 | uniform, position, descriptor_set = 0, binding = 0, flat, // param-only + | ^^^^^^^^^^^^^^^^^^ error: attribute is only valid on a function parameter, not on a statement - --> $DIR/invalid-target.rs:330:39 + --> $DIR/invalid-target.rs:330:48 | -330 | position, descriptor_set = 0, binding = 0, flat, // param-only - | ^^^^^^^^^^^ +330 | uniform, position, descriptor_set = 0, binding = 0, flat, // param-only + | ^^^^^^^^^^^ error: attribute is only valid on a function parameter, not on a statement - --> $DIR/invalid-target.rs:330:52 + --> $DIR/invalid-target.rs:330:61 | -330 | position, descriptor_set = 0, binding = 0, flat, // param-only - | ^^^^ +330 | uniform, position, descriptor_set = 0, binding = 0, flat, // param-only + | ^^^^ error: attribute is only valid on a function or closure, not on a statement --> $DIR/invalid-target.rs:331:9 @@ -1585,26 +1585,20 @@ error: attribute is only valid on a function or closure, not on a statement error: attribute is only valid on a struct, not on a closure --> $DIR/invalid-target.rs:337:13 | -337 | uniform, sampler, block, sampled_image, // struct-only (incl. `image_type`) +337 | sampler, block, sampled_image, // struct-only (incl. `image_type`) | ^^^^^^^ error: attribute is only valid on a struct, not on a closure --> $DIR/invalid-target.rs:337:22 | -337 | uniform, sampler, block, sampled_image, // struct-only (incl. `image_type`) - | ^^^^^^^ - -error: attribute is only valid on a struct, not on a closure - --> $DIR/invalid-target.rs:337:31 - | -337 | uniform, sampler, block, sampled_image, // struct-only (incl. `image_type`) - | ^^^^^ +337 | sampler, block, sampled_image, // struct-only (incl. `image_type`) + | ^^^^^ error: attribute is only valid on a struct, not on a closure - --> $DIR/invalid-target.rs:337:38 + --> $DIR/invalid-target.rs:337:29 | -337 | uniform, sampler, block, sampled_image, // struct-only (incl. `image_type`) - | ^^^^^^^^^^^^^ +337 | sampler, block, sampled_image, // struct-only (incl. `image_type`) + | ^^^^^^^^^^^^^ error: attribute is only valid on a struct, not on a closure --> $DIR/invalid-target.rs:338:13 @@ -1621,50 +1615,50 @@ error: attribute is only valid on a function, not on a closure error: attribute is only valid on a function parameter, not on a closure --> $DIR/invalid-target.rs:340:13 | -340 | position, descriptor_set = 0, binding = 0, flat, // param-only - | ^^^^^^^^ +340 | uniform, position, descriptor_set = 0, binding = 0, flat, // param-only + | ^^^^^^^ error: attribute is only valid on a function parameter, not on a closure - --> $DIR/invalid-target.rs:340:23 + --> $DIR/invalid-target.rs:340:22 | -340 | position, descriptor_set = 0, binding = 0, flat, // param-only - | ^^^^^^^^^^^^^^^^^^ +340 | uniform, position, descriptor_set = 0, binding = 0, flat, // param-only + | ^^^^^^^^ error: attribute is only valid on a function parameter, not on a closure - --> $DIR/invalid-target.rs:340:43 + --> $DIR/invalid-target.rs:340:32 | -340 | position, descriptor_set = 0, binding = 0, flat, // param-only - | ^^^^^^^^^^^ +340 | uniform, position, descriptor_set = 0, binding = 0, flat, // param-only + | ^^^^^^^^^^^^^^^^^^ error: attribute is only valid on a function parameter, not on a closure - --> $DIR/invalid-target.rs:340:56 + --> $DIR/invalid-target.rs:340:52 | -340 | position, descriptor_set = 0, binding = 0, flat, // param-only - | ^^^^ +340 | uniform, position, descriptor_set = 0, binding = 0, flat, // param-only + | ^^^^^^^^^^^ + +error: attribute is only valid on a function parameter, not on a closure + --> $DIR/invalid-target.rs:340:65 + | +340 | uniform, position, descriptor_set = 0, binding = 0, flat, // param-only + | ^^^^ error: attribute is only valid on a struct, not on a expression --> $DIR/invalid-target.rs:346:13 | -346 | uniform, sampler, block, sampled_image, // struct-only (incl. `image_type`) +346 | sampler, block, sampled_image, // struct-only (incl. `image_type`) | ^^^^^^^ error: attribute is only valid on a struct, not on a expression --> $DIR/invalid-target.rs:346:22 | -346 | uniform, sampler, block, sampled_image, // struct-only (incl. `image_type`) - | ^^^^^^^ +346 | sampler, block, sampled_image, // struct-only (incl. `image_type`) + | ^^^^^ error: attribute is only valid on a struct, not on a expression - --> $DIR/invalid-target.rs:346:31 + --> $DIR/invalid-target.rs:346:29 | -346 | uniform, sampler, block, sampled_image, // struct-only (incl. `image_type`) - | ^^^^^ - -error: attribute is only valid on a struct, not on a expression - --> $DIR/invalid-target.rs:346:38 - | -346 | uniform, sampler, block, sampled_image, // struct-only (incl. `image_type`) - | ^^^^^^^^^^^^^ +346 | sampler, block, sampled_image, // struct-only (incl. `image_type`) + | ^^^^^^^^^^^^^ error: attribute is only valid on a struct, not on a expression --> $DIR/invalid-target.rs:347:13 @@ -1681,26 +1675,32 @@ error: attribute is only valid on a function, not on a expression error: attribute is only valid on a function parameter, not on a expression --> $DIR/invalid-target.rs:349:13 | -349 | position, descriptor_set = 0, binding = 0, flat, // param-only - | ^^^^^^^^ +349 | uniform, position, descriptor_set = 0, binding = 0, flat, // param-only + | ^^^^^^^ error: attribute is only valid on a function parameter, not on a expression - --> $DIR/invalid-target.rs:349:23 + --> $DIR/invalid-target.rs:349:22 | -349 | position, descriptor_set = 0, binding = 0, flat, // param-only - | ^^^^^^^^^^^^^^^^^^ +349 | uniform, position, descriptor_set = 0, binding = 0, flat, // param-only + | ^^^^^^^^ error: attribute is only valid on a function parameter, not on a expression - --> $DIR/invalid-target.rs:349:43 + --> $DIR/invalid-target.rs:349:32 | -349 | position, descriptor_set = 0, binding = 0, flat, // param-only - | ^^^^^^^^^^^ +349 | uniform, position, descriptor_set = 0, binding = 0, flat, // param-only + | ^^^^^^^^^^^^^^^^^^ error: attribute is only valid on a function parameter, not on a expression - --> $DIR/invalid-target.rs:349:56 + --> $DIR/invalid-target.rs:349:52 | -349 | position, descriptor_set = 0, binding = 0, flat, // param-only - | ^^^^ +349 | uniform, position, descriptor_set = 0, binding = 0, flat, // param-only + | ^^^^^^^^^^^ + +error: attribute is only valid on a function parameter, not on a expression + --> $DIR/invalid-target.rs:349:65 + | +349 | uniform, position, descriptor_set = 0, binding = 0, flat, // param-only + | ^^^^ error: attribute is only valid on a function or closure, not on a expression --> $DIR/invalid-target.rs:350:13 @@ -1711,26 +1711,20 @@ error: attribute is only valid on a function or closure, not on a expression error: attribute is only valid on a struct, not on a match arm --> $DIR/invalid-target.rs:357:13 | -357 | uniform, sampler, block, sampled_image, // struct-only (incl. `image_type`) +357 | sampler, block, sampled_image, // struct-only (incl. `image_type`) | ^^^^^^^ error: attribute is only valid on a struct, not on a match arm --> $DIR/invalid-target.rs:357:22 | -357 | uniform, sampler, block, sampled_image, // struct-only (incl. `image_type`) - | ^^^^^^^ - -error: attribute is only valid on a struct, not on a match arm - --> $DIR/invalid-target.rs:357:31 - | -357 | uniform, sampler, block, sampled_image, // struct-only (incl. `image_type`) - | ^^^^^ +357 | sampler, block, sampled_image, // struct-only (incl. `image_type`) + | ^^^^^ error: attribute is only valid on a struct, not on a match arm - --> $DIR/invalid-target.rs:357:38 + --> $DIR/invalid-target.rs:357:29 | -357 | uniform, sampler, block, sampled_image, // struct-only (incl. `image_type`) - | ^^^^^^^^^^^^^ +357 | sampler, block, sampled_image, // struct-only (incl. `image_type`) + | ^^^^^^^^^^^^^ error: attribute is only valid on a struct, not on a match arm --> $DIR/invalid-target.rs:358:13 @@ -1747,26 +1741,32 @@ error: attribute is only valid on a function, not on a match arm error: attribute is only valid on a function parameter, not on a match arm --> $DIR/invalid-target.rs:360:13 | -360 | position, descriptor_set = 0, binding = 0, flat, // param-only - | ^^^^^^^^ +360 | uniform, position, descriptor_set = 0, binding = 0, flat, // param-only + | ^^^^^^^ + +error: attribute is only valid on a function parameter, not on a match arm + --> $DIR/invalid-target.rs:360:22 + | +360 | uniform, position, descriptor_set = 0, binding = 0, flat, // param-only + | ^^^^^^^^ error: attribute is only valid on a function parameter, not on a match arm - --> $DIR/invalid-target.rs:360:23 + --> $DIR/invalid-target.rs:360:32 | -360 | position, descriptor_set = 0, binding = 0, flat, // param-only - | ^^^^^^^^^^^^^^^^^^ +360 | uniform, position, descriptor_set = 0, binding = 0, flat, // param-only + | ^^^^^^^^^^^^^^^^^^ error: attribute is only valid on a function parameter, not on a match arm - --> $DIR/invalid-target.rs:360:43 + --> $DIR/invalid-target.rs:360:52 | -360 | position, descriptor_set = 0, binding = 0, flat, // param-only - | ^^^^^^^^^^^ +360 | uniform, position, descriptor_set = 0, binding = 0, flat, // param-only + | ^^^^^^^^^^^ error: attribute is only valid on a function parameter, not on a match arm - --> $DIR/invalid-target.rs:360:56 + --> $DIR/invalid-target.rs:360:65 | -360 | position, descriptor_set = 0, binding = 0, flat, // param-only - | ^^^^ +360 | uniform, position, descriptor_set = 0, binding = 0, flat, // param-only + | ^^^^ error: attribute is only valid on a function or closure, not on a match arm --> $DIR/invalid-target.rs:361:13 @@ -1777,26 +1777,20 @@ error: attribute is only valid on a function or closure, not on a match arm error: attribute is only valid on a struct, not on a associated type --> $DIR/invalid-target.rs:244:9 | -244 | uniform, sampler, block, sampled_image, // struct-only (incl. `image_type`) +244 | sampler, block, sampled_image, // struct-only (incl. `image_type`) | ^^^^^^^ error: attribute is only valid on a struct, not on a associated type --> $DIR/invalid-target.rs:244:18 | -244 | uniform, sampler, block, sampled_image, // struct-only (incl. `image_type`) - | ^^^^^^^ +244 | sampler, block, sampled_image, // struct-only (incl. `image_type`) + | ^^^^^ error: attribute is only valid on a struct, not on a associated type - --> $DIR/invalid-target.rs:244:27 + --> $DIR/invalid-target.rs:244:25 | -244 | uniform, sampler, block, sampled_image, // struct-only (incl. `image_type`) - | ^^^^^ - -error: attribute is only valid on a struct, not on a associated type - --> $DIR/invalid-target.rs:244:34 - | -244 | uniform, sampler, block, sampled_image, // struct-only (incl. `image_type`) - | ^^^^^^^^^^^^^ +244 | sampler, block, sampled_image, // struct-only (incl. `image_type`) + | ^^^^^^^^^^^^^ error: attribute is only valid on a struct, not on a associated type --> $DIR/invalid-target.rs:245:9 @@ -1813,26 +1807,32 @@ error: attribute is only valid on a function, not on a associated type error: attribute is only valid on a function parameter, not on a associated type --> $DIR/invalid-target.rs:247:9 | -247 | position, descriptor_set = 0, binding = 0, flat, // param-only - | ^^^^^^^^ +247 | uniform, position, descriptor_set = 0, binding = 0, flat, // param-only + | ^^^^^^^ error: attribute is only valid on a function parameter, not on a associated type - --> $DIR/invalid-target.rs:247:19 + --> $DIR/invalid-target.rs:247:18 | -247 | position, descriptor_set = 0, binding = 0, flat, // param-only - | ^^^^^^^^^^^^^^^^^^ +247 | uniform, position, descriptor_set = 0, binding = 0, flat, // param-only + | ^^^^^^^^ error: attribute is only valid on a function parameter, not on a associated type - --> $DIR/invalid-target.rs:247:39 + --> $DIR/invalid-target.rs:247:28 | -247 | position, descriptor_set = 0, binding = 0, flat, // param-only - | ^^^^^^^^^^^ +247 | uniform, position, descriptor_set = 0, binding = 0, flat, // param-only + | ^^^^^^^^^^^^^^^^^^ error: attribute is only valid on a function parameter, not on a associated type - --> $DIR/invalid-target.rs:247:52 + --> $DIR/invalid-target.rs:247:48 | -247 | position, descriptor_set = 0, binding = 0, flat, // param-only - | ^^^^ +247 | uniform, position, descriptor_set = 0, binding = 0, flat, // param-only + | ^^^^^^^^^^^ + +error: attribute is only valid on a function parameter, not on a associated type + --> $DIR/invalid-target.rs:247:61 + | +247 | uniform, position, descriptor_set = 0, binding = 0, flat, // param-only + | ^^^^ error: attribute is only valid on a function or closure, not on a associated type --> $DIR/invalid-target.rs:248:9 @@ -1843,26 +1843,20 @@ error: attribute is only valid on a function or closure, not on a associated typ error: attribute is only valid on a struct, not on a associated const --> $DIR/invalid-target.rs:253:9 | -253 | uniform, sampler, block, sampled_image, // struct-only (incl. `image_type`) +253 | sampler, block, sampled_image, // struct-only (incl. `image_type`) | ^^^^^^^ error: attribute is only valid on a struct, not on a associated const --> $DIR/invalid-target.rs:253:18 | -253 | uniform, sampler, block, sampled_image, // struct-only (incl. `image_type`) - | ^^^^^^^ +253 | sampler, block, sampled_image, // struct-only (incl. `image_type`) + | ^^^^^ error: attribute is only valid on a struct, not on a associated const - --> $DIR/invalid-target.rs:253:27 + --> $DIR/invalid-target.rs:253:25 | -253 | uniform, sampler, block, sampled_image, // struct-only (incl. `image_type`) - | ^^^^^ - -error: attribute is only valid on a struct, not on a associated const - --> $DIR/invalid-target.rs:253:34 - | -253 | uniform, sampler, block, sampled_image, // struct-only (incl. `image_type`) - | ^^^^^^^^^^^^^ +253 | sampler, block, sampled_image, // struct-only (incl. `image_type`) + | ^^^^^^^^^^^^^ error: attribute is only valid on a struct, not on a associated const --> $DIR/invalid-target.rs:254:9 @@ -1879,26 +1873,32 @@ error: attribute is only valid on a function, not on a associated const error: attribute is only valid on a function parameter, not on a associated const --> $DIR/invalid-target.rs:256:9 | -256 | position, descriptor_set = 0, binding = 0, flat, // param-only - | ^^^^^^^^ +256 | uniform, position, descriptor_set = 0, binding = 0, flat, // param-only + | ^^^^^^^ + +error: attribute is only valid on a function parameter, not on a associated const + --> $DIR/invalid-target.rs:256:18 + | +256 | uniform, position, descriptor_set = 0, binding = 0, flat, // param-only + | ^^^^^^^^ error: attribute is only valid on a function parameter, not on a associated const - --> $DIR/invalid-target.rs:256:19 + --> $DIR/invalid-target.rs:256:28 | -256 | position, descriptor_set = 0, binding = 0, flat, // param-only - | ^^^^^^^^^^^^^^^^^^ +256 | uniform, position, descriptor_set = 0, binding = 0, flat, // param-only + | ^^^^^^^^^^^^^^^^^^ error: attribute is only valid on a function parameter, not on a associated const - --> $DIR/invalid-target.rs:256:39 + --> $DIR/invalid-target.rs:256:48 | -256 | position, descriptor_set = 0, binding = 0, flat, // param-only - | ^^^^^^^^^^^ +256 | uniform, position, descriptor_set = 0, binding = 0, flat, // param-only + | ^^^^^^^^^^^ error: attribute is only valid on a function parameter, not on a associated const - --> $DIR/invalid-target.rs:256:52 + --> $DIR/invalid-target.rs:256:61 | -256 | position, descriptor_set = 0, binding = 0, flat, // param-only - | ^^^^ +256 | uniform, position, descriptor_set = 0, binding = 0, flat, // param-only + | ^^^^ error: attribute is only valid on a function or closure, not on a associated const --> $DIR/invalid-target.rs:257:9 @@ -1909,26 +1909,20 @@ error: attribute is only valid on a function or closure, not on a associated con error: attribute is only valid on a struct, not on a method --> $DIR/invalid-target.rs:262:9 | -262 | uniform, sampler, block, sampled_image, // struct-only (incl. `image_type`) +262 | sampler, block, sampled_image, // struct-only (incl. `image_type`) | ^^^^^^^ error: attribute is only valid on a struct, not on a method --> $DIR/invalid-target.rs:262:18 | -262 | uniform, sampler, block, sampled_image, // struct-only (incl. `image_type`) - | ^^^^^^^ - -error: attribute is only valid on a struct, not on a method - --> $DIR/invalid-target.rs:262:27 - | -262 | uniform, sampler, block, sampled_image, // struct-only (incl. `image_type`) - | ^^^^^ +262 | sampler, block, sampled_image, // struct-only (incl. `image_type`) + | ^^^^^ error: attribute is only valid on a struct, not on a method - --> $DIR/invalid-target.rs:262:34 + --> $DIR/invalid-target.rs:262:25 | -262 | uniform, sampler, block, sampled_image, // struct-only (incl. `image_type`) - | ^^^^^^^^^^^^^ +262 | sampler, block, sampled_image, // struct-only (incl. `image_type`) + | ^^^^^^^^^^^^^ error: attribute is only valid on a struct, not on a method --> $DIR/invalid-target.rs:263:9 @@ -1945,26 +1939,32 @@ error: attribute is only valid on a function, not on a method error: attribute is only valid on a function parameter, not on a method --> $DIR/invalid-target.rs:265:9 | -265 | position, descriptor_set = 0, binding = 0, flat, // param-only - | ^^^^^^^^ +265 | uniform, position, descriptor_set = 0, binding = 0, flat, // param-only + | ^^^^^^^ + +error: attribute is only valid on a function parameter, not on a method + --> $DIR/invalid-target.rs:265:18 + | +265 | uniform, position, descriptor_set = 0, binding = 0, flat, // param-only + | ^^^^^^^^ error: attribute is only valid on a function parameter, not on a method - --> $DIR/invalid-target.rs:265:19 + --> $DIR/invalid-target.rs:265:28 | -265 | position, descriptor_set = 0, binding = 0, flat, // param-only - | ^^^^^^^^^^^^^^^^^^ +265 | uniform, position, descriptor_set = 0, binding = 0, flat, // param-only + | ^^^^^^^^^^^^^^^^^^ error: attribute is only valid on a function parameter, not on a method - --> $DIR/invalid-target.rs:265:39 + --> $DIR/invalid-target.rs:265:48 | -265 | position, descriptor_set = 0, binding = 0, flat, // param-only - | ^^^^^^^^^^^ +265 | uniform, position, descriptor_set = 0, binding = 0, flat, // param-only + | ^^^^^^^^^^^ error: attribute is only valid on a function parameter, not on a method - --> $DIR/invalid-target.rs:265:52 + --> $DIR/invalid-target.rs:265:61 | -265 | position, descriptor_set = 0, binding = 0, flat, // param-only - | ^^^^ +265 | uniform, position, descriptor_set = 0, binding = 0, flat, // param-only + | ^^^^ error: attribute is only valid on a function or closure, not on a method --> $DIR/invalid-target.rs:266:9 @@ -1975,26 +1975,20 @@ error: attribute is only valid on a function or closure, not on a method error: attribute is only valid on a struct, not on a method --> $DIR/invalid-target.rs:271:9 | -271 | uniform, sampler, block, sampled_image, // struct-only (incl. `image_type`) +271 | sampler, block, sampled_image, // struct-only (incl. `image_type`) | ^^^^^^^ error: attribute is only valid on a struct, not on a method --> $DIR/invalid-target.rs:271:18 | -271 | uniform, sampler, block, sampled_image, // struct-only (incl. `image_type`) - | ^^^^^^^ +271 | sampler, block, sampled_image, // struct-only (incl. `image_type`) + | ^^^^^ error: attribute is only valid on a struct, not on a method - --> $DIR/invalid-target.rs:271:27 + --> $DIR/invalid-target.rs:271:25 | -271 | uniform, sampler, block, sampled_image, // struct-only (incl. `image_type`) - | ^^^^^ - -error: attribute is only valid on a struct, not on a method - --> $DIR/invalid-target.rs:271:34 - | -271 | uniform, sampler, block, sampled_image, // struct-only (incl. `image_type`) - | ^^^^^^^^^^^^^ +271 | sampler, block, sampled_image, // struct-only (incl. `image_type`) + | ^^^^^^^^^^^^^ error: attribute is only valid on a struct, not on a method --> $DIR/invalid-target.rs:272:9 @@ -2005,50 +1999,50 @@ error: attribute is only valid on a struct, not on a method error: attribute is only valid on a function parameter, not on a method --> $DIR/invalid-target.rs:273:9 | -273 | position, descriptor_set = 0, binding = 0, flat, // param-only - | ^^^^^^^^ +273 | uniform, position, descriptor_set = 0, binding = 0, flat, // param-only + | ^^^^^^^ error: attribute is only valid on a function parameter, not on a method - --> $DIR/invalid-target.rs:273:19 + --> $DIR/invalid-target.rs:273:18 | -273 | position, descriptor_set = 0, binding = 0, flat, // param-only - | ^^^^^^^^^^^^^^^^^^ +273 | uniform, position, descriptor_set = 0, binding = 0, flat, // param-only + | ^^^^^^^^ error: attribute is only valid on a function parameter, not on a method - --> $DIR/invalid-target.rs:273:39 + --> $DIR/invalid-target.rs:273:28 | -273 | position, descriptor_set = 0, binding = 0, flat, // param-only - | ^^^^^^^^^^^ +273 | uniform, position, descriptor_set = 0, binding = 0, flat, // param-only + | ^^^^^^^^^^^^^^^^^^ error: attribute is only valid on a function parameter, not on a method - --> $DIR/invalid-target.rs:273:52 + --> $DIR/invalid-target.rs:273:48 | -273 | position, descriptor_set = 0, binding = 0, flat, // param-only - | ^^^^ +273 | uniform, position, descriptor_set = 0, binding = 0, flat, // param-only + | ^^^^^^^^^^^ + +error: attribute is only valid on a function parameter, not on a method + --> $DIR/invalid-target.rs:273:61 + | +273 | uniform, position, descriptor_set = 0, binding = 0, flat, // param-only + | ^^^^ error: attribute is only valid on a struct, not on a associated const --> $DIR/invalid-target.rs:210:9 | -210 | uniform, sampler, block, sampled_image, // struct-only (incl. `image_type`) +210 | sampler, block, sampled_image, // struct-only (incl. `image_type`) | ^^^^^^^ error: attribute is only valid on a struct, not on a associated const --> $DIR/invalid-target.rs:210:18 | -210 | uniform, sampler, block, sampled_image, // struct-only (incl. `image_type`) - | ^^^^^^^ - -error: attribute is only valid on a struct, not on a associated const - --> $DIR/invalid-target.rs:210:27 - | -210 | uniform, sampler, block, sampled_image, // struct-only (incl. `image_type`) - | ^^^^^ +210 | sampler, block, sampled_image, // struct-only (incl. `image_type`) + | ^^^^^ error: attribute is only valid on a struct, not on a associated const - --> $DIR/invalid-target.rs:210:34 + --> $DIR/invalid-target.rs:210:25 | -210 | uniform, sampler, block, sampled_image, // struct-only (incl. `image_type`) - | ^^^^^^^^^^^^^ +210 | sampler, block, sampled_image, // struct-only (incl. `image_type`) + | ^^^^^^^^^^^^^ error: attribute is only valid on a struct, not on a associated const --> $DIR/invalid-target.rs:211:9 @@ -2065,26 +2059,32 @@ error: attribute is only valid on a function, not on a associated const error: attribute is only valid on a function parameter, not on a associated const --> $DIR/invalid-target.rs:213:9 | -213 | position, descriptor_set = 0, binding = 0, flat, // param-only - | ^^^^^^^^ +213 | uniform, position, descriptor_set = 0, binding = 0, flat, // param-only + | ^^^^^^^ + +error: attribute is only valid on a function parameter, not on a associated const + --> $DIR/invalid-target.rs:213:18 + | +213 | uniform, position, descriptor_set = 0, binding = 0, flat, // param-only + | ^^^^^^^^ error: attribute is only valid on a function parameter, not on a associated const - --> $DIR/invalid-target.rs:213:19 + --> $DIR/invalid-target.rs:213:28 | -213 | position, descriptor_set = 0, binding = 0, flat, // param-only - | ^^^^^^^^^^^^^^^^^^ +213 | uniform, position, descriptor_set = 0, binding = 0, flat, // param-only + | ^^^^^^^^^^^^^^^^^^ error: attribute is only valid on a function parameter, not on a associated const - --> $DIR/invalid-target.rs:213:39 + --> $DIR/invalid-target.rs:213:48 | -213 | position, descriptor_set = 0, binding = 0, flat, // param-only - | ^^^^^^^^^^^ +213 | uniform, position, descriptor_set = 0, binding = 0, flat, // param-only + | ^^^^^^^^^^^ error: attribute is only valid on a function parameter, not on a associated const - --> $DIR/invalid-target.rs:213:52 + --> $DIR/invalid-target.rs:213:61 | -213 | position, descriptor_set = 0, binding = 0, flat, // param-only - | ^^^^ +213 | uniform, position, descriptor_set = 0, binding = 0, flat, // param-only + | ^^^^ error: attribute is only valid on a function or closure, not on a associated const --> $DIR/invalid-target.rs:214:9 @@ -2095,26 +2095,20 @@ error: attribute is only valid on a function or closure, not on a associated con error: attribute is only valid on a struct, not on a method --> $DIR/invalid-target.rs:219:9 | -219 | uniform, sampler, block, sampled_image, // struct-only (incl. `image_type`) +219 | sampler, block, sampled_image, // struct-only (incl. `image_type`) | ^^^^^^^ error: attribute is only valid on a struct, not on a method --> $DIR/invalid-target.rs:219:18 | -219 | uniform, sampler, block, sampled_image, // struct-only (incl. `image_type`) - | ^^^^^^^ - -error: attribute is only valid on a struct, not on a method - --> $DIR/invalid-target.rs:219:27 - | -219 | uniform, sampler, block, sampled_image, // struct-only (incl. `image_type`) - | ^^^^^ +219 | sampler, block, sampled_image, // struct-only (incl. `image_type`) + | ^^^^^ error: attribute is only valid on a struct, not on a method - --> $DIR/invalid-target.rs:219:34 + --> $DIR/invalid-target.rs:219:25 | -219 | uniform, sampler, block, sampled_image, // struct-only (incl. `image_type`) - | ^^^^^^^^^^^^^ +219 | sampler, block, sampled_image, // struct-only (incl. `image_type`) + | ^^^^^^^^^^^^^ error: attribute is only valid on a struct, not on a method --> $DIR/invalid-target.rs:220:9 @@ -2125,50 +2119,50 @@ error: attribute is only valid on a struct, not on a method error: attribute is only valid on a function parameter, not on a method --> $DIR/invalid-target.rs:221:9 | -221 | position, descriptor_set = 0, binding = 0, flat, // param-only - | ^^^^^^^^ +221 | uniform, position, descriptor_set = 0, binding = 0, flat, // param-only + | ^^^^^^^ + +error: attribute is only valid on a function parameter, not on a method + --> $DIR/invalid-target.rs:221:18 + | +221 | uniform, position, descriptor_set = 0, binding = 0, flat, // param-only + | ^^^^^^^^ error: attribute is only valid on a function parameter, not on a method - --> $DIR/invalid-target.rs:221:19 + --> $DIR/invalid-target.rs:221:28 | -221 | position, descriptor_set = 0, binding = 0, flat, // param-only - | ^^^^^^^^^^^^^^^^^^ +221 | uniform, position, descriptor_set = 0, binding = 0, flat, // param-only + | ^^^^^^^^^^^^^^^^^^ error: attribute is only valid on a function parameter, not on a method - --> $DIR/invalid-target.rs:221:39 + --> $DIR/invalid-target.rs:221:48 | -221 | position, descriptor_set = 0, binding = 0, flat, // param-only - | ^^^^^^^^^^^ +221 | uniform, position, descriptor_set = 0, binding = 0, flat, // param-only + | ^^^^^^^^^^^ error: attribute is only valid on a function parameter, not on a method - --> $DIR/invalid-target.rs:221:52 + --> $DIR/invalid-target.rs:221:61 | -221 | position, descriptor_set = 0, binding = 0, flat, // param-only - | ^^^^ +221 | uniform, position, descriptor_set = 0, binding = 0, flat, // param-only + | ^^^^ error: attribute is only valid on a struct, not on a associated type --> $DIR/invalid-target.rs:287:9 | -287 | uniform, sampler, block, sampled_image, // struct-only (incl. `image_type`) +287 | sampler, block, sampled_image, // struct-only (incl. `image_type`) | ^^^^^^^ error: attribute is only valid on a struct, not on a associated type --> $DIR/invalid-target.rs:287:18 | -287 | uniform, sampler, block, sampled_image, // struct-only (incl. `image_type`) - | ^^^^^^^ +287 | sampler, block, sampled_image, // struct-only (incl. `image_type`) + | ^^^^^ error: attribute is only valid on a struct, not on a associated type - --> $DIR/invalid-target.rs:287:27 + --> $DIR/invalid-target.rs:287:25 | -287 | uniform, sampler, block, sampled_image, // struct-only (incl. `image_type`) - | ^^^^^ - -error: attribute is only valid on a struct, not on a associated type - --> $DIR/invalid-target.rs:287:34 - | -287 | uniform, sampler, block, sampled_image, // struct-only (incl. `image_type`) - | ^^^^^^^^^^^^^ +287 | sampler, block, sampled_image, // struct-only (incl. `image_type`) + | ^^^^^^^^^^^^^ error: attribute is only valid on a struct, not on a associated type --> $DIR/invalid-target.rs:288:9 @@ -2185,26 +2179,32 @@ error: attribute is only valid on a function, not on a associated type error: attribute is only valid on a function parameter, not on a associated type --> $DIR/invalid-target.rs:290:9 | -290 | position, descriptor_set = 0, binding = 0, flat, // param-only - | ^^^^^^^^ +290 | uniform, position, descriptor_set = 0, binding = 0, flat, // param-only + | ^^^^^^^ + +error: attribute is only valid on a function parameter, not on a associated type + --> $DIR/invalid-target.rs:290:18 + | +290 | uniform, position, descriptor_set = 0, binding = 0, flat, // param-only + | ^^^^^^^^ error: attribute is only valid on a function parameter, not on a associated type - --> $DIR/invalid-target.rs:290:19 + --> $DIR/invalid-target.rs:290:28 | -290 | position, descriptor_set = 0, binding = 0, flat, // param-only - | ^^^^^^^^^^^^^^^^^^ +290 | uniform, position, descriptor_set = 0, binding = 0, flat, // param-only + | ^^^^^^^^^^^^^^^^^^ error: attribute is only valid on a function parameter, not on a associated type - --> $DIR/invalid-target.rs:290:39 + --> $DIR/invalid-target.rs:290:48 | -290 | position, descriptor_set = 0, binding = 0, flat, // param-only - | ^^^^^^^^^^^ +290 | uniform, position, descriptor_set = 0, binding = 0, flat, // param-only + | ^^^^^^^^^^^ error: attribute is only valid on a function parameter, not on a associated type - --> $DIR/invalid-target.rs:290:52 + --> $DIR/invalid-target.rs:290:61 | -290 | position, descriptor_set = 0, binding = 0, flat, // param-only - | ^^^^ +290 | uniform, position, descriptor_set = 0, binding = 0, flat, // param-only + | ^^^^ error: attribute is only valid on a function or closure, not on a associated type --> $DIR/invalid-target.rs:291:9 @@ -2215,26 +2215,20 @@ error: attribute is only valid on a function or closure, not on a associated typ error: attribute is only valid on a struct, not on a associated const --> $DIR/invalid-target.rs:296:9 | -296 | uniform, sampler, block, sampled_image, // struct-only (incl. `image_type`) +296 | sampler, block, sampled_image, // struct-only (incl. `image_type`) | ^^^^^^^ error: attribute is only valid on a struct, not on a associated const --> $DIR/invalid-target.rs:296:18 | -296 | uniform, sampler, block, sampled_image, // struct-only (incl. `image_type`) - | ^^^^^^^ - -error: attribute is only valid on a struct, not on a associated const - --> $DIR/invalid-target.rs:296:27 - | -296 | uniform, sampler, block, sampled_image, // struct-only (incl. `image_type`) - | ^^^^^ +296 | sampler, block, sampled_image, // struct-only (incl. `image_type`) + | ^^^^^ error: attribute is only valid on a struct, not on a associated const - --> $DIR/invalid-target.rs:296:34 + --> $DIR/invalid-target.rs:296:25 | -296 | uniform, sampler, block, sampled_image, // struct-only (incl. `image_type`) - | ^^^^^^^^^^^^^ +296 | sampler, block, sampled_image, // struct-only (incl. `image_type`) + | ^^^^^^^^^^^^^ error: attribute is only valid on a struct, not on a associated const --> $DIR/invalid-target.rs:297:9 @@ -2251,26 +2245,32 @@ error: attribute is only valid on a function, not on a associated const error: attribute is only valid on a function parameter, not on a associated const --> $DIR/invalid-target.rs:299:9 | -299 | position, descriptor_set = 0, binding = 0, flat, // param-only - | ^^^^^^^^ +299 | uniform, position, descriptor_set = 0, binding = 0, flat, // param-only + | ^^^^^^^ error: attribute is only valid on a function parameter, not on a associated const - --> $DIR/invalid-target.rs:299:19 + --> $DIR/invalid-target.rs:299:18 | -299 | position, descriptor_set = 0, binding = 0, flat, // param-only - | ^^^^^^^^^^^^^^^^^^ +299 | uniform, position, descriptor_set = 0, binding = 0, flat, // param-only + | ^^^^^^^^ error: attribute is only valid on a function parameter, not on a associated const - --> $DIR/invalid-target.rs:299:39 + --> $DIR/invalid-target.rs:299:28 | -299 | position, descriptor_set = 0, binding = 0, flat, // param-only - | ^^^^^^^^^^^ +299 | uniform, position, descriptor_set = 0, binding = 0, flat, // param-only + | ^^^^^^^^^^^^^^^^^^ error: attribute is only valid on a function parameter, not on a associated const - --> $DIR/invalid-target.rs:299:52 + --> $DIR/invalid-target.rs:299:48 | -299 | position, descriptor_set = 0, binding = 0, flat, // param-only - | ^^^^ +299 | uniform, position, descriptor_set = 0, binding = 0, flat, // param-only + | ^^^^^^^^^^^ + +error: attribute is only valid on a function parameter, not on a associated const + --> $DIR/invalid-target.rs:299:61 + | +299 | uniform, position, descriptor_set = 0, binding = 0, flat, // param-only + | ^^^^ error: attribute is only valid on a function or closure, not on a associated const --> $DIR/invalid-target.rs:300:9 @@ -2281,26 +2281,20 @@ error: attribute is only valid on a function or closure, not on a associated con error: attribute is only valid on a struct, not on a method --> $DIR/invalid-target.rs:305:9 | -305 | uniform, sampler, block, sampled_image, // struct-only (incl. `image_type`) +305 | sampler, block, sampled_image, // struct-only (incl. `image_type`) | ^^^^^^^ error: attribute is only valid on a struct, not on a method --> $DIR/invalid-target.rs:305:18 | -305 | uniform, sampler, block, sampled_image, // struct-only (incl. `image_type`) - | ^^^^^^^ - -error: attribute is only valid on a struct, not on a method - --> $DIR/invalid-target.rs:305:27 - | -305 | uniform, sampler, block, sampled_image, // struct-only (incl. `image_type`) - | ^^^^^ +305 | sampler, block, sampled_image, // struct-only (incl. `image_type`) + | ^^^^^ error: attribute is only valid on a struct, not on a method - --> $DIR/invalid-target.rs:305:34 + --> $DIR/invalid-target.rs:305:25 | -305 | uniform, sampler, block, sampled_image, // struct-only (incl. `image_type`) - | ^^^^^^^^^^^^^ +305 | sampler, block, sampled_image, // struct-only (incl. `image_type`) + | ^^^^^^^^^^^^^ error: attribute is only valid on a struct, not on a method --> $DIR/invalid-target.rs:306:9 @@ -2311,50 +2305,50 @@ error: attribute is only valid on a struct, not on a method error: attribute is only valid on a function parameter, not on a method --> $DIR/invalid-target.rs:307:9 | -307 | position, descriptor_set = 0, binding = 0, flat, // param-only - | ^^^^^^^^ +307 | uniform, position, descriptor_set = 0, binding = 0, flat, // param-only + | ^^^^^^^ + +error: attribute is only valid on a function parameter, not on a method + --> $DIR/invalid-target.rs:307:18 + | +307 | uniform, position, descriptor_set = 0, binding = 0, flat, // param-only + | ^^^^^^^^ error: attribute is only valid on a function parameter, not on a method - --> $DIR/invalid-target.rs:307:19 + --> $DIR/invalid-target.rs:307:28 | -307 | position, descriptor_set = 0, binding = 0, flat, // param-only - | ^^^^^^^^^^^^^^^^^^ +307 | uniform, position, descriptor_set = 0, binding = 0, flat, // param-only + | ^^^^^^^^^^^^^^^^^^ error: attribute is only valid on a function parameter, not on a method - --> $DIR/invalid-target.rs:307:39 + --> $DIR/invalid-target.rs:307:48 | -307 | position, descriptor_set = 0, binding = 0, flat, // param-only - | ^^^^^^^^^^^ +307 | uniform, position, descriptor_set = 0, binding = 0, flat, // param-only + | ^^^^^^^^^^^ error: attribute is only valid on a function parameter, not on a method - --> $DIR/invalid-target.rs:307:52 + --> $DIR/invalid-target.rs:307:61 | -307 | position, descriptor_set = 0, binding = 0, flat, // param-only - | ^^^^ +307 | uniform, position, descriptor_set = 0, binding = 0, flat, // param-only + | ^^^^ error: attribute is only valid on a struct, not on a foreign type --> $DIR/invalid-target.rs:75:9 | -75 | uniform, sampler, block, sampled_image, // struct-only (incl. `image_type`) +75 | sampler, block, sampled_image, // struct-only (incl. `image_type`) | ^^^^^^^ error: attribute is only valid on a struct, not on a foreign type --> $DIR/invalid-target.rs:75:18 | -75 | uniform, sampler, block, sampled_image, // struct-only (incl. `image_type`) - | ^^^^^^^ +75 | sampler, block, sampled_image, // struct-only (incl. `image_type`) + | ^^^^^ error: attribute is only valid on a struct, not on a foreign type - --> $DIR/invalid-target.rs:75:27 + --> $DIR/invalid-target.rs:75:25 | -75 | uniform, sampler, block, sampled_image, // struct-only (incl. `image_type`) - | ^^^^^ - -error: attribute is only valid on a struct, not on a foreign type - --> $DIR/invalid-target.rs:75:34 - | -75 | uniform, sampler, block, sampled_image, // struct-only (incl. `image_type`) - | ^^^^^^^^^^^^^ +75 | sampler, block, sampled_image, // struct-only (incl. `image_type`) + | ^^^^^^^^^^^^^ error: attribute is only valid on a struct, not on a foreign type --> $DIR/invalid-target.rs:76:9 @@ -2371,26 +2365,32 @@ error: attribute is only valid on a function, not on a foreign type error: attribute is only valid on a function parameter, not on a foreign type --> $DIR/invalid-target.rs:78:9 | -78 | position, descriptor_set = 0, binding = 0, flat, // param-only - | ^^^^^^^^ +78 | uniform, position, descriptor_set = 0, binding = 0, flat, // param-only + | ^^^^^^^ + +error: attribute is only valid on a function parameter, not on a foreign type + --> $DIR/invalid-target.rs:78:18 + | +78 | uniform, position, descriptor_set = 0, binding = 0, flat, // param-only + | ^^^^^^^^ error: attribute is only valid on a function parameter, not on a foreign type - --> $DIR/invalid-target.rs:78:19 + --> $DIR/invalid-target.rs:78:28 | -78 | position, descriptor_set = 0, binding = 0, flat, // param-only - | ^^^^^^^^^^^^^^^^^^ +78 | uniform, position, descriptor_set = 0, binding = 0, flat, // param-only + | ^^^^^^^^^^^^^^^^^^ error: attribute is only valid on a function parameter, not on a foreign type - --> $DIR/invalid-target.rs:78:39 + --> $DIR/invalid-target.rs:78:48 | -78 | position, descriptor_set = 0, binding = 0, flat, // param-only - | ^^^^^^^^^^^ +78 | uniform, position, descriptor_set = 0, binding = 0, flat, // param-only + | ^^^^^^^^^^^ error: attribute is only valid on a function parameter, not on a foreign type - --> $DIR/invalid-target.rs:78:52 + --> $DIR/invalid-target.rs:78:61 | -78 | position, descriptor_set = 0, binding = 0, flat, // param-only - | ^^^^ +78 | uniform, position, descriptor_set = 0, binding = 0, flat, // param-only + | ^^^^ error: attribute is only valid on a function or closure, not on a foreign type --> $DIR/invalid-target.rs:79:9 @@ -2401,26 +2401,20 @@ error: attribute is only valid on a function or closure, not on a foreign type error: attribute is only valid on a struct, not on a foreign static item --> $DIR/invalid-target.rs:84:9 | -84 | uniform, sampler, block, sampled_image, // struct-only (incl. `image_type`) +84 | sampler, block, sampled_image, // struct-only (incl. `image_type`) | ^^^^^^^ error: attribute is only valid on a struct, not on a foreign static item --> $DIR/invalid-target.rs:84:18 | -84 | uniform, sampler, block, sampled_image, // struct-only (incl. `image_type`) - | ^^^^^^^ +84 | sampler, block, sampled_image, // struct-only (incl. `image_type`) + | ^^^^^ error: attribute is only valid on a struct, not on a foreign static item - --> $DIR/invalid-target.rs:84:27 + --> $DIR/invalid-target.rs:84:25 | -84 | uniform, sampler, block, sampled_image, // struct-only (incl. `image_type`) - | ^^^^^ - -error: attribute is only valid on a struct, not on a foreign static item - --> $DIR/invalid-target.rs:84:34 - | -84 | uniform, sampler, block, sampled_image, // struct-only (incl. `image_type`) - | ^^^^^^^^^^^^^ +84 | sampler, block, sampled_image, // struct-only (incl. `image_type`) + | ^^^^^^^^^^^^^ error: attribute is only valid on a struct, not on a foreign static item --> $DIR/invalid-target.rs:85:9 @@ -2437,26 +2431,32 @@ error: attribute is only valid on a function, not on a foreign static item error: attribute is only valid on a function parameter, not on a foreign static item --> $DIR/invalid-target.rs:87:9 | -87 | position, descriptor_set = 0, binding = 0, flat, // param-only - | ^^^^^^^^ +87 | uniform, position, descriptor_set = 0, binding = 0, flat, // param-only + | ^^^^^^^ error: attribute is only valid on a function parameter, not on a foreign static item - --> $DIR/invalid-target.rs:87:19 + --> $DIR/invalid-target.rs:87:18 | -87 | position, descriptor_set = 0, binding = 0, flat, // param-only - | ^^^^^^^^^^^^^^^^^^ +87 | uniform, position, descriptor_set = 0, binding = 0, flat, // param-only + | ^^^^^^^^ error: attribute is only valid on a function parameter, not on a foreign static item - --> $DIR/invalid-target.rs:87:39 + --> $DIR/invalid-target.rs:87:28 | -87 | position, descriptor_set = 0, binding = 0, flat, // param-only - | ^^^^^^^^^^^ +87 | uniform, position, descriptor_set = 0, binding = 0, flat, // param-only + | ^^^^^^^^^^^^^^^^^^ error: attribute is only valid on a function parameter, not on a foreign static item - --> $DIR/invalid-target.rs:87:52 + --> $DIR/invalid-target.rs:87:48 | -87 | position, descriptor_set = 0, binding = 0, flat, // param-only - | ^^^^ +87 | uniform, position, descriptor_set = 0, binding = 0, flat, // param-only + | ^^^^^^^^^^^ + +error: attribute is only valid on a function parameter, not on a foreign static item + --> $DIR/invalid-target.rs:87:61 + | +87 | uniform, position, descriptor_set = 0, binding = 0, flat, // param-only + | ^^^^ error: attribute is only valid on a function or closure, not on a foreign static item --> $DIR/invalid-target.rs:88:9 @@ -2467,26 +2467,20 @@ error: attribute is only valid on a function or closure, not on a foreign static error: attribute is only valid on a struct, not on a foreign function --> $DIR/invalid-target.rs:93:9 | -93 | uniform, sampler, block, sampled_image, // struct-only (incl. `image_type`) +93 | sampler, block, sampled_image, // struct-only (incl. `image_type`) | ^^^^^^^ error: attribute is only valid on a struct, not on a foreign function --> $DIR/invalid-target.rs:93:18 | -93 | uniform, sampler, block, sampled_image, // struct-only (incl. `image_type`) - | ^^^^^^^ - -error: attribute is only valid on a struct, not on a foreign function - --> $DIR/invalid-target.rs:93:27 - | -93 | uniform, sampler, block, sampled_image, // struct-only (incl. `image_type`) - | ^^^^^ +93 | sampler, block, sampled_image, // struct-only (incl. `image_type`) + | ^^^^^ error: attribute is only valid on a struct, not on a foreign function - --> $DIR/invalid-target.rs:93:34 + --> $DIR/invalid-target.rs:93:25 | -93 | uniform, sampler, block, sampled_image, // struct-only (incl. `image_type`) - | ^^^^^^^^^^^^^ +93 | sampler, block, sampled_image, // struct-only (incl. `image_type`) + | ^^^^^^^^^^^^^ error: attribute is only valid on a struct, not on a foreign function --> $DIR/invalid-target.rs:94:9 @@ -2503,26 +2497,32 @@ error: attribute is only valid on a function, not on a foreign function error: attribute is only valid on a function parameter, not on a foreign function --> $DIR/invalid-target.rs:96:9 | -96 | position, descriptor_set = 0, binding = 0, flat, // param-only - | ^^^^^^^^ +96 | uniform, position, descriptor_set = 0, binding = 0, flat, // param-only + | ^^^^^^^ + +error: attribute is only valid on a function parameter, not on a foreign function + --> $DIR/invalid-target.rs:96:18 + | +96 | uniform, position, descriptor_set = 0, binding = 0, flat, // param-only + | ^^^^^^^^ error: attribute is only valid on a function parameter, not on a foreign function - --> $DIR/invalid-target.rs:96:19 + --> $DIR/invalid-target.rs:96:28 | -96 | position, descriptor_set = 0, binding = 0, flat, // param-only - | ^^^^^^^^^^^^^^^^^^ +96 | uniform, position, descriptor_set = 0, binding = 0, flat, // param-only + | ^^^^^^^^^^^^^^^^^^ error: attribute is only valid on a function parameter, not on a foreign function - --> $DIR/invalid-target.rs:96:39 + --> $DIR/invalid-target.rs:96:48 | -96 | position, descriptor_set = 0, binding = 0, flat, // param-only - | ^^^^^^^^^^^ +96 | uniform, position, descriptor_set = 0, binding = 0, flat, // param-only + | ^^^^^^^^^^^ error: attribute is only valid on a function parameter, not on a foreign function - --> $DIR/invalid-target.rs:96:52 + --> $DIR/invalid-target.rs:96:61 | -96 | position, descriptor_set = 0, binding = 0, flat, // param-only - | ^^^^ +96 | uniform, position, descriptor_set = 0, binding = 0, flat, // param-only + | ^^^^ error: attribute is only valid on a function or closure, not on a foreign function --> $DIR/invalid-target.rs:97:9 @@ -2534,10 +2534,10 @@ error: #[spirv(..)] cannot be applied to a macro --> $DIR/invalid-target.rs:28:1 | 28 | / #[spirv( -29 | | uniform, sampler, block, sampled_image, // struct-only (incl. `image_type`) +29 | | sampler, block, sampled_image, // struct-only (incl. `image_type`) 30 | | image_type(dim = "Dim2D", depth = 0, arrayed = 0, multisampled = 0, sampled = 1, image_format = "Unknown"), 31 | | vertex, // fn-only -32 | | position, descriptor_set = 0, binding = 0, flat, // param-only +32 | | uniform, position, descriptor_set = 0, binding = 0, flat, // param-only 33 | | unroll_loops, // fn/closure-only 34 | | )] | |__^ diff --git a/tests/ui/spirv-attr/multiple.rs b/tests/ui/spirv-attr/multiple.rs index 1c19ac2336..fa914ea730 100644 --- a/tests/ui/spirv-attr/multiple.rs +++ b/tests/ui/spirv-attr/multiple.rs @@ -5,12 +5,6 @@ use spirv_std as _; -#[spirv(uniform, uniform)] -struct _SameStorageClass {} - -#[spirv(uniform, push_constant)] -struct _DiffStorageClass {} - #[spirv(sampler, sampler)] struct _SameIntrinsicType {} @@ -31,6 +25,9 @@ fn _diff_entry() {} #[spirv(vertex)] fn _entry( + #[spirv(uniform, uniform)] _same_storage_class: (), + #[spirv(uniform, push_constant)] _diff_storage_class: (), + #[spirv(position, position)] _same_builtin: (), #[spirv(position, vertex_index)] _diff_builtin: (), diff --git a/tests/ui/spirv-attr/multiple.stderr b/tests/ui/spirv-attr/multiple.stderr index 864a8fddfd..9f62ba09b6 100644 --- a/tests/ui/spirv-attr/multiple.stderr +++ b/tests/ui/spirv-attr/multiple.stderr @@ -1,181 +1,181 @@ -error: only one storage class attribute is allowed on a struct +error: only one intrinsic type attribute is allowed on a struct --> $DIR/multiple.rs:8:18 | -8 | #[spirv(uniform, uniform)] +8 | #[spirv(sampler, sampler)] | ^^^^^^^ | -note: previous storage class attribute +note: previous intrinsic type attribute --> $DIR/multiple.rs:8:9 | -8 | #[spirv(uniform, uniform)] +8 | #[spirv(sampler, sampler)] | ^^^^^^^ -error: only one storage class attribute is allowed on a struct - --> $DIR/multiple.rs:11:18 - | -11 | #[spirv(uniform, push_constant)] - | ^^^^^^^^^^^^^ - | -note: previous storage class attribute - --> $DIR/multiple.rs:11:9 - | -11 | #[spirv(uniform, push_constant)] - | ^^^^^^^ - -error: only one intrinsic type attribute is allowed on a struct - --> $DIR/multiple.rs:14:18 - | -14 | #[spirv(sampler, sampler)] - | ^^^^^^^ - | -note: previous intrinsic type attribute - --> $DIR/multiple.rs:14:9 - | -14 | #[spirv(sampler, sampler)] - | ^^^^^^^ - error: only one intrinsic type attribute is allowed on a struct - --> $DIR/multiple.rs:19:5 + --> $DIR/multiple.rs:13:5 | -19 | image_type(dim = "Dim2D", depth = 0, arrayed = 0, multisampled = 0, sampled = 1, image_format = "Unknown"), +13 | image_type(dim = "Dim2D", depth = 0, arrayed = 0, multisampled = 0, sampled = 1, image_format = "Unknown"), | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | note: previous intrinsic type attribute - --> $DIR/multiple.rs:18:5 + --> $DIR/multiple.rs:12:5 | -18 | sampler, +12 | sampler, | ^^^^^^^ error: only one #[spirv(block)] attribute is allowed on a struct - --> $DIR/multiple.rs:23:16 + --> $DIR/multiple.rs:17:16 | -23 | #[spirv(block, block)] +17 | #[spirv(block, block)] | ^^^^^ | note: previous #[spirv(block)] attribute - --> $DIR/multiple.rs:23:9 + --> $DIR/multiple.rs:17:9 | -23 | #[spirv(block, block)] +17 | #[spirv(block, block)] | ^^^^^ error: only one entry-point attribute is allowed on a function - --> $DIR/multiple.rs:26:17 + --> $DIR/multiple.rs:20:17 | -26 | #[spirv(vertex, vertex)] +20 | #[spirv(vertex, vertex)] | ^^^^^^ | note: previous entry-point attribute - --> $DIR/multiple.rs:26:9 + --> $DIR/multiple.rs:20:9 | -26 | #[spirv(vertex, vertex)] +20 | #[spirv(vertex, vertex)] | ^^^^^^ error: only one entry-point attribute is allowed on a function - --> $DIR/multiple.rs:29:17 + --> $DIR/multiple.rs:23:17 | -29 | #[spirv(vertex, fragment)] +23 | #[spirv(vertex, fragment)] | ^^^^^^^^ | note: previous entry-point attribute - --> $DIR/multiple.rs:29:9 + --> $DIR/multiple.rs:23:9 | -29 | #[spirv(vertex, fragment)] +23 | #[spirv(vertex, fragment)] | ^^^^^^ +error: only one storage class attribute is allowed on a function param + --> $DIR/multiple.rs:28:22 + | +28 | #[spirv(uniform, uniform)] _same_storage_class: (), + | ^^^^^^^ + | +note: previous storage class attribute + --> $DIR/multiple.rs:28:13 + | +28 | #[spirv(uniform, uniform)] _same_storage_class: (), + | ^^^^^^^ + +error: only one storage class attribute is allowed on a function param + --> $DIR/multiple.rs:29:22 + | +29 | #[spirv(uniform, push_constant)] _diff_storage_class: (), + | ^^^^^^^^^^^^^ + | +note: previous storage class attribute + --> $DIR/multiple.rs:29:13 + | +29 | #[spirv(uniform, push_constant)] _diff_storage_class: (), + | ^^^^^^^ + error: only one builtin attribute is allowed on a function param - --> $DIR/multiple.rs:34:23 + --> $DIR/multiple.rs:31:23 | -34 | #[spirv(position, position)] _same_builtin: (), +31 | #[spirv(position, position)] _same_builtin: (), | ^^^^^^^^ | note: previous builtin attribute - --> $DIR/multiple.rs:34:13 + --> $DIR/multiple.rs:31:13 | -34 | #[spirv(position, position)] _same_builtin: (), +31 | #[spirv(position, position)] _same_builtin: (), | ^^^^^^^^ error: only one builtin attribute is allowed on a function param - --> $DIR/multiple.rs:35:23 + --> $DIR/multiple.rs:32:23 | -35 | #[spirv(position, vertex_index)] _diff_builtin: (), +32 | #[spirv(position, vertex_index)] _diff_builtin: (), | ^^^^^^^^^^^^ | note: previous builtin attribute - --> $DIR/multiple.rs:35:13 + --> $DIR/multiple.rs:32:13 | -35 | #[spirv(position, vertex_index)] _diff_builtin: (), +32 | #[spirv(position, vertex_index)] _diff_builtin: (), | ^^^^^^^^ error: only one #[spirv(descriptor_set)] attribute is allowed on a function param - --> $DIR/multiple.rs:37:33 + --> $DIR/multiple.rs:34:33 | -37 | #[spirv(descriptor_set = 0, descriptor_set = 0)] _same_descriptor_set: (), +34 | #[spirv(descriptor_set = 0, descriptor_set = 0)] _same_descriptor_set: (), | ^^^^^^^^^^^^^^^^^^ | note: previous #[spirv(descriptor_set)] attribute - --> $DIR/multiple.rs:37:13 + --> $DIR/multiple.rs:34:13 | -37 | #[spirv(descriptor_set = 0, descriptor_set = 0)] _same_descriptor_set: (), +34 | #[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:38:33 + --> $DIR/multiple.rs:35:33 | -38 | #[spirv(descriptor_set = 0, descriptor_set = 1)] _diff_descriptor_set: (), +35 | #[spirv(descriptor_set = 0, descriptor_set = 1)] _diff_descriptor_set: (), | ^^^^^^^^^^^^^^^^^^ | note: previous #[spirv(descriptor_set)] attribute - --> $DIR/multiple.rs:38:13 + --> $DIR/multiple.rs:35:13 | -38 | #[spirv(descriptor_set = 0, descriptor_set = 1)] _diff_descriptor_set: (), +35 | #[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:40:26 + --> $DIR/multiple.rs:37:26 | -40 | #[spirv(binding = 0, binding = 0)] _same_binding: (), +37 | #[spirv(binding = 0, binding = 0)] _same_binding: (), | ^^^^^^^^^^^ | note: previous #[spirv(binding)] attribute - --> $DIR/multiple.rs:40:13 + --> $DIR/multiple.rs:37:13 | -40 | #[spirv(binding = 0, binding = 0)] _same_binding: (), +37 | #[spirv(binding = 0, binding = 0)] _same_binding: (), | ^^^^^^^^^^^ error: only one #[spirv(binding)] attribute is allowed on a function param - --> $DIR/multiple.rs:41:26 + --> $DIR/multiple.rs:38:26 | -41 | #[spirv(binding = 0, binding = 1)] _diff_binding: (), +38 | #[spirv(binding = 0, binding = 1)] _diff_binding: (), | ^^^^^^^^^^^ | note: previous #[spirv(binding)] attribute - --> $DIR/multiple.rs:41:13 + --> $DIR/multiple.rs:38:13 | -41 | #[spirv(binding = 0, binding = 1)] _diff_binding: (), +38 | #[spirv(binding = 0, binding = 1)] _diff_binding: (), | ^^^^^^^^^^^ error: only one #[spirv(flat)] attribute is allowed on a function param - --> $DIR/multiple.rs:43:19 + --> $DIR/multiple.rs:40:19 | -43 | #[spirv(flat, flat)] _flat: (), +40 | #[spirv(flat, flat)] _flat: (), | ^^^^ | note: previous #[spirv(flat)] attribute - --> $DIR/multiple.rs:43:13 + --> $DIR/multiple.rs:40:13 | -43 | #[spirv(flat, flat)] _flat: (), +40 | #[spirv(flat, flat)] _flat: (), | ^^^^ error: only one #[spirv(unroll_loops)] attribute is allowed on a function - --> $DIR/multiple.rs:46:23 + --> $DIR/multiple.rs:43:23 | -46 | #[spirv(unroll_loops, unroll_loops)] +43 | #[spirv(unroll_loops, unroll_loops)] | ^^^^^^^^^^^^ | note: previous #[spirv(unroll_loops)] attribute - --> $DIR/multiple.rs:46:9 + --> $DIR/multiple.rs:43:9 | -46 | #[spirv(unroll_loops, unroll_loops)] +43 | #[spirv(unroll_loops, unroll_loops)] | ^^^^^^^^^^^^ error: aborting due to 15 previous errors diff --git a/tests/ui/storage_class/push_constant.rs b/tests/ui/storage_class/push_constant.rs index d74ed0412f..3248d14b74 100644 --- a/tests/ui/storage_class/push_constant.rs +++ b/tests/ui/storage_class/push_constant.rs @@ -4,9 +4,7 @@ // build-pass -extern crate spirv_std; -use spirv_std::storage_class::PushConstant; - +use spirv_std as _; #[derive(Copy, Clone)] pub struct ShaderConstants { @@ -16,6 +14,6 @@ pub struct ShaderConstants { } #[spirv(fragment)] -pub fn main(constants: PushConstant) { +pub fn main(#[spirv(push_constant)] constants: &ShaderConstants) { let _constants = *constants; } From 304e9b7ff312a365e68cd61cfda7641a2a230c07 Mon Sep 17 00:00:00 2001 From: Eduard-Mihai Burtescu Date: Mon, 22 Mar 2021 17:54:46 +0200 Subject: [PATCH 2/3] entry: reorganize storage class handling, and move some checking to `attr`. --- crates/rustc_codegen_spirv/src/attr.rs | 25 +++++ .../src/codegen_cx/entry.rs | 92 +++++++++---------- tests/ui/spirv-attr/invalid-storage-class.rs | 12 +++ .../spirv-attr/invalid-storage-class.stderr | 34 +++++++ 4 files changed, 114 insertions(+), 49 deletions(-) create mode 100644 tests/ui/spirv-attr/invalid-storage-class.rs create mode 100644 tests/ui/spirv-attr/invalid-storage-class.stderr diff --git a/crates/rustc_codegen_spirv/src/attr.rs b/crates/rustc_codegen_spirv/src/attr.rs index 49c5494ff0..28650b7648 100644 --- a/crates/rustc_codegen_spirv/src/attr.rs +++ b/crates/rustc_codegen_spirv/src/attr.rs @@ -297,6 +297,31 @@ impl CheckSpirvAttrVisitor<'_> { span, "attribute is only valid on a parameter of an entry-point function", ); + } else { + // FIXME(eddyb) should we just remove all 5 of these storage class + // attributes, instead of disallowing them here? + if let SpirvAttribute::StorageClass(storage_class) = parsed_attr { + let valid = match storage_class { + StorageClass::Input | StorageClass::Output => { + Err("is the default and should not be explicitly specified") + } + + StorageClass::Private + | StorageClass::Function + | StorageClass::Generic => { + Err("can not be used as part of an entry's interface") + } + + _ => Ok(()), + }; + + if let Err(msg) = valid { + self.tcx.sess.span_err( + span, + &format!("`{:?}` storage class {}", storage_class, msg), + ); + } + } } Ok(()) } diff --git a/crates/rustc_codegen_spirv/src/codegen_cx/entry.rs b/crates/rustc_codegen_spirv/src/codegen_cx/entry.rs index 78cfe8c074..2aa18b7863 100644 --- a/crates/rustc_codegen_spirv/src/codegen_cx/entry.rs +++ b/crates/rustc_codegen_spirv/src/codegen_cx/entry.rs @@ -148,20 +148,51 @@ impl<'tcx> CodegenCx<'tcx> { hir_param: &hir::Param<'tcx>, decoration_locations: &mut HashMap, ) -> (Word, StorageClass) { - let writable = match layout.ty.kind() { - // FIXME(eddyb) also take into account `&T` interior mutability, - // i.e. it's only immutable if `T: Freeze`, which we should check. - // FIXME(eddyb) also check the type for compatibility with being - // part of the interface, including potentially `Sync`ness etc. - TyKind::Ref(_, _, m) => *m == hir::Mutability::Mut, + let attrs = AggregatedSpirvAttributes::parse(self, self.tcx.hir().attrs(hir_param.hir_id)); - _ => self.tcx.sess.span_fatal( - hir_param.span, - &format!( - "invalid entry param type `{}` (expected `&T` or `&mut T`)", - layout.ty + // FIXME(eddyb) attribute validation should be done ahead of time. + // FIXME(eddyb) also take into account `&T` interior mutability, + // i.e. it's only immutable if `T: Freeze`, which we should check. + // FIXME(eddyb) also check the type for compatibility with being + // part of the interface, including potentially `Sync`ness etc. + let storage_class = if let Some(storage_class_attr) = attrs.storage_class { + let storage_class = storage_class_attr.value; + let expected_mutbl = match storage_class { + StorageClass::UniformConstant + | StorageClass::Input + | StorageClass::PushConstant => hir::Mutability::Not, + + _ => hir::Mutability::Mut, + }; + + match layout.ty.kind() { + TyKind::Ref(_, _, m) if *m == expected_mutbl => storage_class, + + _ => self.tcx.sess.span_fatal( + hir_param.span, + &format!( + "invalid entry param type `{}` for storage class `{:?}` \ + (expected `&{}T`)", + layout.ty, + storage_class, + expected_mutbl.prefix_str() + ), ), - ), + } + } else { + match layout.ty.kind() { + TyKind::Ref(_, _, hir::Mutability::Mut) => StorageClass::Output, + + TyKind::Ref(_, _, hir::Mutability::Not) => StorageClass::Input, + + _ => self.tcx.sess.span_fatal( + hir_param.span, + &format!( + "invalid entry param type `{}` (expected `&T` or `&mut T`)", + layout.ty + ), + ), + } }; // Pre-allocate the module-scoped `OpVariable`'s *Result* ID. @@ -171,7 +202,6 @@ impl<'tcx> CodegenCx<'tcx> { self.emit_global().name(variable, ident.to_string()); } - let attrs = AggregatedSpirvAttributes::parse(self, self.tcx.hir().attrs(hir_param.hir_id)); let mut decoration_supersedes_location = false; if let Some(builtin) = attrs.builtin.map(|attr| attr.value) { self.emit_global().decorate( @@ -202,42 +232,6 @@ impl<'tcx> CodegenCx<'tcx> { .decorate(variable, Decoration::Flat, std::iter::empty()); } - let storage_class = if let Some(storage_class_attr) = attrs.storage_class { - // FIXME(eddyb) attribute validation should be done ahead of time. - let valid = match storage_class_attr.value { - StorageClass::UniformConstant - | StorageClass::Input - | StorageClass::PushConstant - if writable => - { - Err("can only be used with immutable references") - } - - StorageClass::Input | StorageClass::Output => { - Err("is the default and should not be explicitly specified") - } - - StorageClass::Private | StorageClass::Function | StorageClass::Generic => { - Err("can not be used as part of an entry's interface") - } - - _ => Ok(()), - }; - - if let Err(msg) = valid { - self.tcx.sess.span_err( - storage_class_attr.span, - &format!("`{:?}` storage class {}", storage_class_attr.value, msg), - ); - } - - storage_class_attr.value - } else if writable { - StorageClass::Output - } else { - StorageClass::Input - }; - // FIXME(eddyb) check whether the storage class is compatible with the // specific shader stage of this entry-point, and any decorations // (e.g. Vulkan has specific rules for builtin storage classes). diff --git a/tests/ui/spirv-attr/invalid-storage-class.rs b/tests/ui/spirv-attr/invalid-storage-class.rs new file mode 100644 index 0000000000..4efa1e7599 --- /dev/null +++ b/tests/ui/spirv-attr/invalid-storage-class.rs @@ -0,0 +1,12 @@ +// Tests that certain storage class `#[spirv(...)]` attributes are disallowed. + +// build-fail + +#[spirv(vertex)] +fn _entry( + #[spirv(input)] _: (), + #[spirv(output)] _: (), + #[spirv(private)] _: (), + #[spirv(function)] _: (), + #[spirv(generic)] _: (), +) {} diff --git a/tests/ui/spirv-attr/invalid-storage-class.stderr b/tests/ui/spirv-attr/invalid-storage-class.stderr new file mode 100644 index 0000000000..295d39fbc3 --- /dev/null +++ b/tests/ui/spirv-attr/invalid-storage-class.stderr @@ -0,0 +1,34 @@ +error: `#[panic_handler]` function required, but not found + +error: `Input` storage class is the default and should not be explicitly specified + --> $DIR/invalid-storage-class.rs:7:13 + | +7 | #[spirv(input)] _: (), + | ^^^^^ + +error: `Output` storage class is the default and should not be explicitly specified + --> $DIR/invalid-storage-class.rs:8:13 + | +8 | #[spirv(output)] _: (), + | ^^^^^^ + +error: `Private` storage class can not be used as part of an entry's interface + --> $DIR/invalid-storage-class.rs:9:13 + | +9 | #[spirv(private)] _: (), + | ^^^^^^^ + +error: `Function` storage class can not be used as part of an entry's interface + --> $DIR/invalid-storage-class.rs:10:13 + | +10 | #[spirv(function)] _: (), + | ^^^^^^^^ + +error: `Generic` storage class can not be used as part of an entry's interface + --> $DIR/invalid-storage-class.rs:11:13 + | +11 | #[spirv(generic)] _: (), + | ^^^^^^^ + +error: aborting due to 6 previous errors + From ff92d4e6a8585c8f8ffc1498c215fee20eda9d0c Mon Sep 17 00:00:00 2001 From: Eduard-Mihai Burtescu Date: Mon, 22 Mar 2021 18:48:44 +0200 Subject: [PATCH 3/3] entry: use `T` instead of `&T` for `Input`s. --- .../src/codegen_cx/entry.rs | 75 +++++++++++++------ crates/spirv-builder/src/test/basic.rs | 8 +- examples/shaders/mouse-shader/src/lib.rs | 6 +- examples/shaders/simplest-shader/src/lib.rs | 3 +- examples/shaders/sky-shader/src/lib.rs | 6 +- tests/ui/glam/mat3_vec3_multiply.rs | 3 +- tests/ui/image/write.rs | 3 +- tests/ui/lang/control_flow/defer.rs | 8 +- tests/ui/lang/control_flow/for_range.rs | 4 +- .../for_with_custom_range_iter.rs | 4 +- tests/ui/lang/control_flow/if.rs | 4 +- tests/ui/lang/control_flow/if_else.rs | 4 +- tests/ui/lang/control_flow/if_else_if_else.rs | 6 +- tests/ui/lang/control_flow/if_if.rs | 6 +- tests/ui/lang/control_flow/if_return_else.rs | 4 +- .../control_flow/if_return_else_return.rs | 4 +- tests/ui/lang/control_flow/if_while.rs | 6 +- tests/ui/lang/control_flow/ifx2.rs | 6 +- tests/ui/lang/control_flow/while.rs | 4 +- tests/ui/lang/control_flow/while_break.rs | 4 +- tests/ui/lang/control_flow/while_continue.rs | 4 +- tests/ui/lang/control_flow/while_if_break.rs | 6 +- .../control_flow/while_if_break_else_break.rs | 6 +- .../control_flow/while_if_break_if_break.rs | 8 +- .../ui/lang/control_flow/while_if_continue.rs | 6 +- .../while_if_continue_else_continue.rs | 6 +- tests/ui/lang/control_flow/while_return.rs | 4 +- tests/ui/lang/control_flow/while_while.rs | 6 +- .../ui/lang/control_flow/while_while_break.rs | 6 +- .../lang/control_flow/while_while_continue.rs | 6 +- .../lang/control_flow/while_while_if_break.rs | 8 +- .../control_flow/while_while_if_continue.rs | 8 +- tests/ui/lang/f32/signum.rs | 4 +- 33 files changed, 136 insertions(+), 110 deletions(-) diff --git a/crates/rustc_codegen_spirv/src/codegen_cx/entry.rs b/crates/rustc_codegen_spirv/src/codegen_cx/entry.rs index 2aa18b7863..63ab59ed63 100644 --- a/crates/rustc_codegen_spirv/src/codegen_cx/entry.rs +++ b/crates/rustc_codegen_spirv/src/codegen_cx/entry.rs @@ -10,6 +10,7 @@ use rustc_middle::ty::layout::TyAndLayout; use rustc_middle::ty::{Instance, Ty, TyKind}; use rustc_span::Span; use rustc_target::abi::call::{FnAbi, PassMode}; +use rustc_target::abi::LayoutOf; use std::collections::HashMap; impl<'tcx> CodegenCx<'tcx> { @@ -37,12 +38,12 @@ impl<'tcx> CodegenCx<'tcx> { let fn_hir_id = self.tcx.hir().local_def_id_to_hir_id(local_id); let body = self.tcx.hir().body(self.tcx.hir().body_owned_by(fn_hir_id)); for (abi, arg) in fn_abi.args.iter().zip(body.params) { - if let PassMode::Direct(_) = abi.mode { - } else { - self.tcx.sess.span_err( + match abi.mode { + PassMode::Direct(_) | PassMode::Indirect { .. } => {} + _ => self.tcx.sess.span_err( arg.span, &format!("PassMode {:?} invalid for entry point parameter", abi.mode), - ) + ), } } if let PassMode::Ignore = fn_abi.ret.mode { @@ -104,7 +105,7 @@ impl<'tcx> CodegenCx<'tcx> { }; let mut decoration_locations = HashMap::new(); // Create OpVariables before OpFunction so they're global instead of local vars. - let arguments = entry_fn_abi + let declared_params = entry_fn_abi .args .iter() .zip(hir_params) @@ -117,11 +118,38 @@ impl<'tcx> CodegenCx<'tcx> { .begin_function(void, None, FunctionControl::NONE, fn_void_void) .unwrap(); emit.begin_block(None).unwrap(); + // Adjust any global `OpVariable`s as needed (e.g. loading from `Input`s). + let arguments: Vec<_> = declared_params + .iter() + .zip(&entry_fn_abi.args) + .zip(hir_params) + .map(|((&(var, storage_class), entry_fn_arg), hir_param)| { + match entry_fn_arg.layout.ty.kind() { + TyKind::Ref(..) => var, + + _ => match entry_fn_arg.mode { + PassMode::Indirect { .. } => var, + PassMode::Direct(_) => { + assert_eq!(storage_class, StorageClass::Input); + + // NOTE(eddyb) this should never fail as it has to have + // been already computed earlier by `declare_parameter`. + let value_spirv_type = + entry_fn_arg.layout.spirv_type(hir_param.span, self); + + emit.load(value_spirv_type, None, var, None, std::iter::empty()) + .unwrap() + } + _ => unreachable!(), + }, + } + }) + .collect(); emit.function_call( entry_func_return_type, None, entry_func.def_cx(self), - arguments.iter().map(|&(a, _)| a), + arguments, ) .unwrap(); emit.ret().unwrap(); @@ -129,13 +157,13 @@ impl<'tcx> CodegenCx<'tcx> { let interface: Vec<_> = if emit.version().unwrap() > (1, 3) { // SPIR-V >= v1.4 includes all OpVariables in the interface. - arguments.into_iter().map(|(a, _)| a).collect() + declared_params.into_iter().map(|(var, _)| var).collect() } else { // SPIR-V <= v1.3 only includes Input and Output in the interface. - arguments + declared_params .into_iter() .filter(|&(_, s)| s == StorageClass::Input || s == StorageClass::Output) - .map(|(a, _)| a) + .map(|(var, _)| var) .collect() }; emit.entry_point(execution_model, fn_id, name, interface); @@ -155,7 +183,7 @@ impl<'tcx> CodegenCx<'tcx> { // i.e. it's only immutable if `T: Freeze`, which we should check. // FIXME(eddyb) also check the type for compatibility with being // part of the interface, including potentially `Sync`ness etc. - let storage_class = if let Some(storage_class_attr) = attrs.storage_class { + let (value_ty, storage_class) = if let Some(storage_class_attr) = attrs.storage_class { let storage_class = storage_class_attr.value; let expected_mutbl = match storage_class { StorageClass::UniformConstant @@ -165,8 +193,8 @@ impl<'tcx> CodegenCx<'tcx> { _ => hir::Mutability::Mut, }; - match layout.ty.kind() { - TyKind::Ref(_, _, m) if *m == expected_mutbl => storage_class, + match *layout.ty.kind() { + TyKind::Ref(_, pointee_ty, m) if m == expected_mutbl => (pointee_ty, storage_class), _ => self.tcx.sess.span_fatal( hir_param.span, @@ -180,18 +208,20 @@ impl<'tcx> CodegenCx<'tcx> { ), } } else { - match layout.ty.kind() { - TyKind::Ref(_, _, hir::Mutability::Mut) => StorageClass::Output, - - TyKind::Ref(_, _, hir::Mutability::Not) => StorageClass::Input, + match *layout.ty.kind() { + TyKind::Ref(_, pointee_ty, hir::Mutability::Mut) => { + (pointee_ty, StorageClass::Output) + } - _ => self.tcx.sess.span_fatal( + TyKind::Ref(_, pointee_ty, hir::Mutability::Not) => self.tcx.sess.span_fatal( hir_param.span, &format!( - "invalid entry param type `{}` (expected `&T` or `&mut T`)", - layout.ty + "invalid entry param type `{}` (expected `{}` or `&mut {1}`)", + layout.ty, pointee_ty ), ), + + _ => (layout.ty, StorageClass::Input), } }; @@ -258,9 +288,12 @@ impl<'tcx> CodegenCx<'tcx> { } // Emit the `OpVariable` with its *Result* ID set to `variable`. - let spirv_type = layout.spirv_type(hir_param.span, self); + let var_spirv_type = SpirvType::Pointer { + pointee: self.layout_of(value_ty).spirv_type(hir_param.span, self), + } + .def(hir_param.span, self); self.emit_global() - .variable(spirv_type, Some(variable), storage_class, None); + .variable(var_spirv_type, Some(variable), storage_class, None); (variable, storage_class) } diff --git a/crates/spirv-builder/src/test/basic.rs b/crates/spirv-builder/src/test/basic.rs index 2e7e9ee2bb..ff3863e61c 100644 --- a/crates/spirv-builder/src/test/basic.rs +++ b/crates/spirv-builder/src/test/basic.rs @@ -371,11 +371,11 @@ macro_rules! test_copy_via_raw_ptr { } } #[spirv(fragment)] - pub fn main(i: &f32, o: &mut f32) { - copy_via_raw_ptr(i, o); + pub fn main(i: f32, o: &mut f32) { + copy_via_raw_ptr(&i, o); // FIXME(eddyb) above call results in inlining `copy_via_raw_ptr`, - // due to the to `Input`/`Output` storage classes, so to get the - // disassembled function we also need `Function`-local pointers: + // due to the to `Output` storage classe, so to get the disassembled + // function we also need `Function`-local pointers: let (src, mut dst) = (0.0, 0.0); copy_via_raw_ptr(&src, &mut dst); } diff --git a/examples/shaders/mouse-shader/src/lib.rs b/examples/shaders/mouse-shader/src/lib.rs index 27cb55f80f..a7afa20d26 100644 --- a/examples/shaders/mouse-shader/src/lib.rs +++ b/examples/shaders/mouse-shader/src/lib.rs @@ -143,7 +143,7 @@ impl Painter { #[spirv(fragment)] pub fn main_fs( - #[spirv(frag_coord)] in_frag_coord: &Vec4, + #[spirv(frag_coord)] in_frag_coord: Vec4, #[spirv(push_constant)] constants: &ShaderConstants, output: &mut Vec4, ) { @@ -251,9 +251,7 @@ pub fn main_fs( } #[spirv(vertex)] -pub fn main_vs(#[spirv(vertex_index)] vert_idx: &i32, #[spirv(position)] builtin_pos: &mut Vec4) { - let vert_idx = *vert_idx; - +pub fn main_vs(#[spirv(vertex_index)] vert_idx: i32, #[spirv(position)] builtin_pos: &mut Vec4) { // Create a "full screen triangle" by mapping the vertex index. // ported from https://www.saschawillems.de/blog/2016/08/13/vulkan-tutorial-on-rendering-a-fullscreen-quad-without-buffers/ let uv = vec2(((vert_idx << 1) & 2) as f32, (vert_idx & 2) as f32); diff --git a/examples/shaders/simplest-shader/src/lib.rs b/examples/shaders/simplest-shader/src/lib.rs index 8d59bd5f63..0d9aebe17f 100644 --- a/examples/shaders/simplest-shader/src/lib.rs +++ b/examples/shaders/simplest-shader/src/lib.rs @@ -18,8 +18,7 @@ pub fn main_fs(output: &mut Vec4) { } #[spirv(vertex)] -pub fn main_vs(#[spirv(vertex_index)] vert_id: &i32, #[spirv(position)] out_pos: &mut Vec4) { - let vert_id = *vert_id; +pub fn main_vs(#[spirv(vertex_index)] vert_id: i32, #[spirv(position)] out_pos: &mut Vec4) { *out_pos = vec4( (vert_id - 1) as f32, ((vert_id & 1) * 2 - 1) as f32, diff --git a/examples/shaders/sky-shader/src/lib.rs b/examples/shaders/sky-shader/src/lib.rs index 7a57408e79..9f2f6e9de9 100644 --- a/examples/shaders/sky-shader/src/lib.rs +++ b/examples/shaders/sky-shader/src/lib.rs @@ -159,7 +159,7 @@ pub fn fs(constants: &ShaderConstants, frag_coord: Vec2) -> Vec4 { #[spirv(fragment)] pub fn main_fs( - #[spirv(frag_coord)] in_frag_coord: &Vec4, + #[spirv(frag_coord)] in_frag_coord: Vec4, #[spirv(push_constant)] constants: &ShaderConstants, output: &mut Vec4, ) { @@ -168,9 +168,7 @@ pub fn main_fs( } #[spirv(vertex)] -pub fn main_vs(#[spirv(vertex_index)] vert_idx: &i32, #[spirv(position)] builtin_pos: &mut Vec4) { - let vert_idx = *vert_idx; - +pub fn main_vs(#[spirv(vertex_index)] vert_idx: i32, #[spirv(position)] builtin_pos: &mut Vec4) { // Create a "full screen triangle" by mapping the vertex index. // ported from https://www.saschawillems.de/blog/2016/08/13/vulkan-tutorial-on-rendering-a-fullscreen-quad-without-buffers/ let uv = vec2(((vert_idx << 1) & 2) as f32, (vert_idx & 2) as f32); diff --git a/tests/ui/glam/mat3_vec3_multiply.rs b/tests/ui/glam/mat3_vec3_multiply.rs index 1bbf198a48..2efb5109c3 100644 --- a/tests/ui/glam/mat3_vec3_multiply.rs +++ b/tests/ui/glam/mat3_vec3_multiply.rs @@ -4,8 +4,7 @@ use spirv_std as _; #[spirv(fragment)] -pub fn main(input: &glam::Mat3, output: &mut glam::Vec3) { - let input = *input; +pub fn main(input: glam::Mat3, output: &mut glam::Vec3) { let vector = input * glam::Vec3::new(1.0, 2.0, 3.0); *output = vector; } diff --git a/tests/ui/image/write.rs b/tests/ui/image/write.rs index ad2bf39f75..e2cf172446 100644 --- a/tests/ui/image/write.rs +++ b/tests/ui/image/write.rs @@ -4,8 +4,7 @@ use spirv_std::{arch, StorageImage2d}; #[spirv(fragment)] -pub fn main(input: &glam::Vec2, #[spirv(uniform_constant)] image: &StorageImage2d) { - let texels = *input; +pub fn main(texels: glam::Vec2, #[spirv(uniform_constant)] image: &StorageImage2d) { unsafe { image.write(glam::UVec2::new(0, 1), texels); } diff --git a/tests/ui/lang/control_flow/defer.rs b/tests/ui/lang/control_flow/defer.rs index bc5c257ab5..a1558b7c3e 100644 --- a/tests/ui/lang/control_flow/defer.rs +++ b/tests/ui/lang/control_flow/defer.rs @@ -3,13 +3,13 @@ use spirv_std as _; #[spirv(fragment)] -pub fn main(i: &i32) { - while *i < 32 { +pub fn main(i: i32) { + while i < 32 { let current_position = 0; - if *i < current_position { + if i < current_position { break; } - if *i < current_position { + if i < current_position { break; } } diff --git a/tests/ui/lang/control_flow/for_range.rs b/tests/ui/lang/control_flow/for_range.rs index 2121fa316c..b23bb43c2b 100644 --- a/tests/ui/lang/control_flow/for_range.rs +++ b/tests/ui/lang/control_flow/for_range.rs @@ -3,7 +3,7 @@ use spirv_std as _; #[spirv(fragment)] -pub fn main(i: &i32) { - for _ in 0..*i { +pub fn main(i: i32) { + for _ in 0..i { } } diff --git a/tests/ui/lang/control_flow/for_with_custom_range_iter.rs b/tests/ui/lang/control_flow/for_with_custom_range_iter.rs index 1e7df3de39..20aceec418 100644 --- a/tests/ui/lang/control_flow/for_with_custom_range_iter.rs +++ b/tests/ui/lang/control_flow/for_with_custom_range_iter.rs @@ -25,8 +25,8 @@ impl Iterator for RangeIter { } #[spirv(fragment)] -pub fn main(i: &i32) { - for _ in RangeIter(0..*i) { +pub fn main(i: i32) { + for _ in RangeIter(0..i) { } } diff --git a/tests/ui/lang/control_flow/if.rs b/tests/ui/lang/control_flow/if.rs index 8604fb8602..fe73ee6a20 100644 --- a/tests/ui/lang/control_flow/if.rs +++ b/tests/ui/lang/control_flow/if.rs @@ -3,8 +3,8 @@ use spirv_std as _; #[spirv(fragment)] -pub fn main(i: &i32) { - if *i > 0 { +pub fn main(i: i32) { + if i > 0 { } } diff --git a/tests/ui/lang/control_flow/if_else.rs b/tests/ui/lang/control_flow/if_else.rs index 7c2cc47ba7..5d91096fff 100644 --- a/tests/ui/lang/control_flow/if_else.rs +++ b/tests/ui/lang/control_flow/if_else.rs @@ -3,8 +3,8 @@ use spirv_std as _; #[spirv(fragment)] -pub fn main(i: &i32) { - if *i > 0 { +pub fn main(i: i32) { + if i > 0 { } else { diff --git a/tests/ui/lang/control_flow/if_else_if_else.rs b/tests/ui/lang/control_flow/if_else_if_else.rs index 0d058c9055..41425ce342 100644 --- a/tests/ui/lang/control_flow/if_else_if_else.rs +++ b/tests/ui/lang/control_flow/if_else_if_else.rs @@ -3,10 +3,10 @@ use spirv_std as _; #[spirv(fragment)] -pub fn main(i: &i32) { - if *i > 0 { +pub fn main(i: i32) { + if i > 0 { - } else if *i < 0 { + } else if i < 0 { } else { diff --git a/tests/ui/lang/control_flow/if_if.rs b/tests/ui/lang/control_flow/if_if.rs index ee171f6602..ec9c1e679e 100644 --- a/tests/ui/lang/control_flow/if_if.rs +++ b/tests/ui/lang/control_flow/if_if.rs @@ -3,9 +3,9 @@ use spirv_std as _; #[spirv(fragment)] -pub fn main(i: &i32) { - if *i > 0 { - if *i < 10 { +pub fn main(i: i32) { + if i > 0 { + if i < 10 { } } diff --git a/tests/ui/lang/control_flow/if_return_else.rs b/tests/ui/lang/control_flow/if_return_else.rs index ae5bda31e1..cdf79e546a 100644 --- a/tests/ui/lang/control_flow/if_return_else.rs +++ b/tests/ui/lang/control_flow/if_return_else.rs @@ -3,8 +3,8 @@ use spirv_std as _; #[spirv(fragment)] -pub fn main(i: &i32) { - if *i < 10 { +pub fn main(i: i32) { + if i < 10 { return; } else { } diff --git a/tests/ui/lang/control_flow/if_return_else_return.rs b/tests/ui/lang/control_flow/if_return_else_return.rs index 77aee56de8..a1f339fb2d 100644 --- a/tests/ui/lang/control_flow/if_return_else_return.rs +++ b/tests/ui/lang/control_flow/if_return_else_return.rs @@ -3,8 +3,8 @@ use spirv_std as _; #[spirv(fragment)] -pub fn main(i: &i32) { - if *i < 10 { +pub fn main(i: i32) { + if i < 10 { return; } else { return; diff --git a/tests/ui/lang/control_flow/if_while.rs b/tests/ui/lang/control_flow/if_while.rs index b988ed228e..3881d1c686 100644 --- a/tests/ui/lang/control_flow/if_while.rs +++ b/tests/ui/lang/control_flow/if_while.rs @@ -3,9 +3,9 @@ use spirv_std as _; #[spirv(fragment)] -pub fn main(i: &i32) { - if *i == 0 { - while *i < 10 { +pub fn main(i: i32) { + if i == 0 { + while i < 10 { } } } diff --git a/tests/ui/lang/control_flow/ifx2.rs b/tests/ui/lang/control_flow/ifx2.rs index c3ebc6ce0c..3908a343f7 100644 --- a/tests/ui/lang/control_flow/ifx2.rs +++ b/tests/ui/lang/control_flow/ifx2.rs @@ -3,11 +3,11 @@ use spirv_std as _; #[spirv(fragment)] -pub fn main(i: &i32) { - if *i > 0 { +pub fn main(i: i32) { + if i > 0 { } - if *i > 1 { + if i > 1 { } } diff --git a/tests/ui/lang/control_flow/while.rs b/tests/ui/lang/control_flow/while.rs index d4a1f0d5e7..4fa4bd77e9 100644 --- a/tests/ui/lang/control_flow/while.rs +++ b/tests/ui/lang/control_flow/while.rs @@ -3,7 +3,7 @@ use spirv_std as _; #[spirv(fragment)] -pub fn main(i: &i32) { - while *i < 10 { +pub fn main(i: i32) { + while i < 10 { } } diff --git a/tests/ui/lang/control_flow/while_break.rs b/tests/ui/lang/control_flow/while_break.rs index 613d6f8f46..8f7d8cec3d 100644 --- a/tests/ui/lang/control_flow/while_break.rs +++ b/tests/ui/lang/control_flow/while_break.rs @@ -3,8 +3,8 @@ use spirv_std as _; #[spirv(fragment)] -pub fn main(i: &i32) { - while *i < 10 { +pub fn main(i: i32) { + while i < 10 { break; } } diff --git a/tests/ui/lang/control_flow/while_continue.rs b/tests/ui/lang/control_flow/while_continue.rs index 0d7ba44097..2e7fe3d007 100644 --- a/tests/ui/lang/control_flow/while_continue.rs +++ b/tests/ui/lang/control_flow/while_continue.rs @@ -3,8 +3,8 @@ use spirv_std as _; #[spirv(fragment)] -pub fn main(i: &i32) { - while *i < 10 { +pub fn main(i: i32) { + while i < 10 { continue; } } diff --git a/tests/ui/lang/control_flow/while_if_break.rs b/tests/ui/lang/control_flow/while_if_break.rs index b2cd368223..3e17eb12d3 100644 --- a/tests/ui/lang/control_flow/while_if_break.rs +++ b/tests/ui/lang/control_flow/while_if_break.rs @@ -3,9 +3,9 @@ use spirv_std as _; #[spirv(fragment)] -pub fn main(i: &i32) { - while *i < 10 { - if *i == 0 { +pub fn main(i: i32) { + while i < 10 { + if i == 0 { break; } } diff --git a/tests/ui/lang/control_flow/while_if_break_else_break.rs b/tests/ui/lang/control_flow/while_if_break_else_break.rs index 21e75a4c9e..6a5bd6d00d 100644 --- a/tests/ui/lang/control_flow/while_if_break_else_break.rs +++ b/tests/ui/lang/control_flow/while_if_break_else_break.rs @@ -3,9 +3,9 @@ use spirv_std as _; #[spirv(fragment)] -pub fn main(i: &i32) { - while *i < 10 { - if *i == 0 { +pub fn main(i: i32) { + while i < 10 { + if i == 0 { break; } else { break; diff --git a/tests/ui/lang/control_flow/while_if_break_if_break.rs b/tests/ui/lang/control_flow/while_if_break_if_break.rs index 72e73e6c51..8f730aa333 100644 --- a/tests/ui/lang/control_flow/while_if_break_if_break.rs +++ b/tests/ui/lang/control_flow/while_if_break_if_break.rs @@ -3,12 +3,12 @@ use spirv_std as _; #[spirv(fragment)] -pub fn main(i: &i32) { - while *i < 10 { - if *i == 0 { +pub fn main(i: i32) { + while i < 10 { + if i == 0 { break; } - if *i == 1 { + if i == 1 { break; } } diff --git a/tests/ui/lang/control_flow/while_if_continue.rs b/tests/ui/lang/control_flow/while_if_continue.rs index d8cffa46cf..b6451e9e83 100644 --- a/tests/ui/lang/control_flow/while_if_continue.rs +++ b/tests/ui/lang/control_flow/while_if_continue.rs @@ -3,9 +3,9 @@ use spirv_std as _; #[spirv(fragment)] -pub fn main(i: &i32) { - while *i < 10 { - if *i == 0 { +pub fn main(i: i32) { + while i < 10 { + if i == 0 { continue; } } diff --git a/tests/ui/lang/control_flow/while_if_continue_else_continue.rs b/tests/ui/lang/control_flow/while_if_continue_else_continue.rs index 4b88512fd1..e0578e8746 100644 --- a/tests/ui/lang/control_flow/while_if_continue_else_continue.rs +++ b/tests/ui/lang/control_flow/while_if_continue_else_continue.rs @@ -3,9 +3,9 @@ use spirv_std as _; #[spirv(fragment)] -pub fn main(i: &i32) { - while *i < 10 { - if *i == 0 { +pub fn main(i: i32) { + while i < 10 { + if i == 0 { continue; } else { continue; diff --git a/tests/ui/lang/control_flow/while_return.rs b/tests/ui/lang/control_flow/while_return.rs index 7f6e1c46bb..7844796c21 100644 --- a/tests/ui/lang/control_flow/while_return.rs +++ b/tests/ui/lang/control_flow/while_return.rs @@ -3,8 +3,8 @@ use spirv_std as _; #[spirv(fragment)] -pub fn main(i: &i32) { - while *i < 10 { +pub fn main(i: i32) { + while i < 10 { return; } } diff --git a/tests/ui/lang/control_flow/while_while.rs b/tests/ui/lang/control_flow/while_while.rs index 8613660642..46b0949213 100644 --- a/tests/ui/lang/control_flow/while_while.rs +++ b/tests/ui/lang/control_flow/while_while.rs @@ -3,9 +3,9 @@ use spirv_std as _; #[spirv(fragment)] -pub fn main(i: &i32) { - while *i < 20 { - while *i < 10 { +pub fn main(i: i32) { + while i < 20 { + while i < 10 { } } } diff --git a/tests/ui/lang/control_flow/while_while_break.rs b/tests/ui/lang/control_flow/while_while_break.rs index a136bfd80f..451cff06bb 100644 --- a/tests/ui/lang/control_flow/while_while_break.rs +++ b/tests/ui/lang/control_flow/while_while_break.rs @@ -3,9 +3,9 @@ use spirv_std as _; #[spirv(fragment)] -pub fn main(i: &i32) { - while *i < 20 { - while *i < 10 { +pub fn main(i: i32) { + while i < 20 { + while i < 10 { break; } } diff --git a/tests/ui/lang/control_flow/while_while_continue.rs b/tests/ui/lang/control_flow/while_while_continue.rs index 5ed39146af..78b4f0fddf 100644 --- a/tests/ui/lang/control_flow/while_while_continue.rs +++ b/tests/ui/lang/control_flow/while_while_continue.rs @@ -3,9 +3,9 @@ use spirv_std as _; #[spirv(fragment)] -pub fn main(i: &i32) { - while *i < 20 { - while *i < 10 { +pub fn main(i: i32) { + while i < 20 { + while i < 10 { continue; } } diff --git a/tests/ui/lang/control_flow/while_while_if_break.rs b/tests/ui/lang/control_flow/while_while_if_break.rs index fc6fb00845..b4fab2fca9 100644 --- a/tests/ui/lang/control_flow/while_while_if_break.rs +++ b/tests/ui/lang/control_flow/while_while_if_break.rs @@ -3,10 +3,10 @@ use spirv_std as _; #[spirv(fragment)] -pub fn main(i: &i32) { - while *i < 20 { - while *i < 10 { - if *i > 10 { +pub fn main(i: i32) { + while i < 20 { + while i < 10 { + if i > 10 { break; } } diff --git a/tests/ui/lang/control_flow/while_while_if_continue.rs b/tests/ui/lang/control_flow/while_while_if_continue.rs index b968534440..e07a3f7c23 100644 --- a/tests/ui/lang/control_flow/while_while_if_continue.rs +++ b/tests/ui/lang/control_flow/while_while_if_continue.rs @@ -3,10 +3,10 @@ use spirv_std as _; #[spirv(fragment)] -pub fn main(i: &i32) { - while *i < 20 { - while *i < 10 { - if *i > 5 { +pub fn main(i: i32) { + while i < 20 { + while i < 10 { + if i > 5 { continue; } } diff --git a/tests/ui/lang/f32/signum.rs b/tests/ui/lang/f32/signum.rs index b62e9cb132..02f8df073a 100644 --- a/tests/ui/lang/f32/signum.rs +++ b/tests/ui/lang/f32/signum.rs @@ -4,6 +4,6 @@ use spirv_std::num_traits::Float; #[spirv(fragment)] -pub fn main(i: &f32, o: &mut f32) { - *o = (*i).signum(); +pub fn main(i: f32, o: &mut f32) { + *o = i.signum(); }