1- // Tests that `#[rust_gpu::spirv (...)]` attributes cannot be applied to the wrong "targets"
1+ // Tests that `#[rust_gpu::spirv_v0_9 (...)]` attributes cannot be applied to the wrong "targets"
22// (i.e. various kinds of definitions and other syntactic categories).
33
44// build-fail
1111) ]
1212
1313// NOTE(eddyb) in the interest of keeping this test manageable, only one of
14- // each of the following categories of `#[rust_gpu::spirv (...)]` attributes is used:
14+ // each of the following categories of `#[rust_gpu::spirv_v0_9 (...)]` attributes is used:
1515// * entry: `vertex`
1616// * storage class: `uniform`
1717// * builtin: `position`
1818
1919// NOTE(eddyb) accounting for the number of errors this test actually produces:
2020// * 437 errors, all "attribute is only valid on" (see `invalid-target.stderr`)
21- // * 41 uses of `#[rust_gpu::spirv (...)]` in this test
22- // * at most 11 attributes per `#[rust_gpu::spirv (...)]`, so an upper bound of `41*11 = 451`
21+ // * 41 uses of `#[rust_gpu::spirv_v0_9 (...)]` in this test
22+ // * at most 11 attributes per `#[rust_gpu::spirv_v0_9 (...)]`, so an upper bound of `41*11 = 451`
2323// * the difference between 451 and 437 is 14, i.e. valid attributes, made up of:
2424// * 4 on `_Struct`
2525// * 4 on functions, i.e. 1 on each of:
2929// * `_fn`
3030// * 6 on `_entry_param`
3131
32- // NOTE(shesp) Directly using `#[rust_gpu::spirv (...)]` because macro attributes are invalid in most contexts
32+ // NOTE(shesp) Directly using `#[rust_gpu::spirv_v0_9 (...)]` because macro attributes are invalid in most contexts
3333
34- #[ rust_gpu:: spirv (
34+ #[ rust_gpu:: spirv_v0_9 (
3535 sampler, block, sampled_image, generic_image_type, // struct-only
3636 vertex, // fn-only
3737 uniform, position, descriptor_set = 0 , binding = 0 , flat, invariant, // param-only
@@ -40,77 +40,77 @@ macro_rules! _macro {
4040 ( ) => { } ;
4141}
4242
43- #[ rust_gpu:: spirv (
43+ #[ rust_gpu:: spirv_v0_9 (
4444 sampler, block, sampled_image, generic_image_type, // struct-only
4545 vertex, // fn-only
4646 uniform, position, descriptor_set = 0 , binding = 0 , flat, invariant, // param-only
4747) ]
4848extern crate spirv_std as _;
4949
50- #[ rust_gpu:: spirv (
50+ #[ rust_gpu:: spirv_v0_9 (
5151 sampler, block, sampled_image, generic_image_type, // struct-only
5252 vertex, // fn-only
5353 uniform, position, descriptor_set = 0 , binding = 0 , flat, invariant, // param-only
5454) ]
5555use spirv_std as _;
5656
57- #[ rust_gpu:: spirv (
57+ #[ rust_gpu:: spirv_v0_9 (
5858 sampler, block, sampled_image, generic_image_type, // struct-only
5959 vertex, // fn-only
6060 uniform, position, descriptor_set = 0 , binding = 0 , flat, invariant, // param-only
6161) ]
6262mod _mod { }
6363
64- #[ rust_gpu:: spirv (
64+ #[ rust_gpu:: spirv_v0_9 (
6565 sampler, block, sampled_image, generic_image_type, // struct-only
6666 vertex, // fn-only
6767 uniform, position, descriptor_set = 0 , binding = 0 , flat, invariant, // param-only
6868) ]
6969extern "C" {
70- #[ rust_gpu:: spirv (
70+ #[ rust_gpu:: spirv_v0_9 (
7171 sampler, block, sampled_image, generic_image_type, // struct-only
7272 vertex, // fn-only
7373 uniform, position, descriptor_set = 0 , binding = 0 , flat, invariant, // param-only
7474 ) ]
7575 type _ForeignTy ;
7676
77- #[ rust_gpu:: spirv (
77+ #[ rust_gpu:: spirv_v0_9 (
7878 sampler, block, sampled_image, generic_image_type, // struct-only
7979 vertex, // fn-only
8080 uniform, position, descriptor_set = 0 , binding = 0 , flat, invariant, // param-only
8181 ) ]
8282 static _FOREIGN_STATIC: ( ) ;
8383
84- #[ rust_gpu:: spirv (
84+ #[ rust_gpu:: spirv_v0_9 (
8585 sampler, block, sampled_image, generic_image_type, // struct-only
8686 vertex, // fn-only
8787 uniform, position, descriptor_set = 0 , binding = 0 , flat, invariant, // param-only
8888 ) ]
8989 fn _foreign_fn ( ) ;
9090}
9191
92- #[ rust_gpu:: spirv (
92+ #[ rust_gpu:: spirv_v0_9 (
9393 sampler, block, sampled_image, generic_image_type, // struct-only
9494 vertex, // fn-only
9595 uniform, position, descriptor_set = 0 , binding = 0 , flat, invariant, // param-only
9696) ]
9797static _STATIC: ( ) = ( ) ;
9898
99- #[ rust_gpu:: spirv (
99+ #[ rust_gpu:: spirv_v0_9 (
100100 sampler, block, sampled_image, generic_image_type, // struct-only
101101 vertex, // fn-only
102102 uniform, position, descriptor_set = 0 , binding = 0 , flat, invariant, // param-only
103103) ]
104104const _CONST: ( ) = ( ) ;
105105
106- #[ rust_gpu:: spirv (
106+ #[ rust_gpu:: spirv_v0_9 (
107107 sampler, block, sampled_image, generic_image_type, // struct-only
108108 vertex, // fn-only
109109 uniform, position, descriptor_set = 0 , binding = 0 , flat, invariant, // param-only
110110) ]
111111type _TyAlias = ( ) ;
112112
113- #[ rust_gpu:: spirv (
113+ #[ rust_gpu:: spirv_v0_9 (
114114 sampler, block, sampled_image, generic_image_type, // struct-only
115115 vertex, // fn-only
116116 uniform, position, descriptor_set = 0 , binding = 0 , flat, invariant, // param-only
@@ -121,19 +121,19 @@ fn _opaque_ty_definer() -> _OpaqueTy {
121121 ( )
122122}
123123
124- #[ rust_gpu:: spirv (
124+ #[ rust_gpu:: spirv_v0_9 (
125125 sampler, block, sampled_image, generic_image_type, // struct-only
126126 vertex, // fn-only
127127 uniform, position, descriptor_set = 0 , binding = 0 , flat, invariant, // param-only
128128) ]
129129enum _Enum {
130- #[ rust_gpu:: spirv (
130+ #[ rust_gpu:: spirv_v0_9 (
131131 sampler, block, sampled_image, generic_image_type, // struct-only
132132 vertex, // fn-only
133133 uniform, position, descriptor_set = 0 , binding = 0 , flat, invariant, // param-only
134134 ) ]
135135 _Variant {
136- #[ rust_gpu:: spirv (
136+ #[ rust_gpu:: spirv_v0_9 (
137137 sampler, block, sampled_image, generic_image_type, // struct-only
138138 vertex, // fn-only
139139 uniform, position, descriptor_set = 0 , binding = 0 , flat, invariant, // param-only
@@ -142,148 +142,148 @@ enum _Enum {
142142 } ,
143143}
144144
145- #[ rust_gpu:: spirv (
145+ #[ rust_gpu:: spirv_v0_9 (
146146 sampler, block, sampled_image, generic_image_type, // struct-only
147147 vertex, // fn-only
148148 uniform, position, descriptor_set = 0 , binding = 0 , flat, invariant, // param-only
149149) ]
150150union _Union {
151- #[ rust_gpu:: spirv (
151+ #[ rust_gpu:: spirv_v0_9 (
152152 sampler, block, sampled_image, generic_image_type, // struct-only
153153 vertex, // fn-only
154154 uniform, position, descriptor_set = 0 , binding = 0 , flat, invariant, // param-only
155155 ) ]
156156 _field : ( ) ,
157157}
158158
159- #[ rust_gpu:: spirv (
159+ #[ rust_gpu:: spirv_v0_9 (
160160 vertex, // fn-only
161161 uniform, position, descriptor_set = 0 , binding = 0 , flat, invariant, // param-only
162162) ]
163163struct _Struct {
164- #[ rust_gpu:: spirv (
164+ #[ rust_gpu:: spirv_v0_9 (
165165 sampler, block, sampled_image, generic_image_type, // struct-only
166166 vertex, // fn-only
167167 uniform, position, descriptor_set = 0 , binding = 0 , flat, invariant, // param-only
168168 ) ]
169169 _field : ( ) ,
170170}
171171
172- #[ rust_gpu:: spirv (
172+ #[ rust_gpu:: spirv_v0_9 (
173173 sampler, block, sampled_image, generic_image_type, // struct-only
174174 vertex, // fn-only
175175 uniform, position, descriptor_set = 0 , binding = 0 , flat, invariant, // param-only
176176) ]
177177impl _Struct {
178- #[ rust_gpu:: spirv (
178+ #[ rust_gpu:: spirv_v0_9 (
179179 sampler, block, sampled_image, generic_image_type, // struct-only
180180 vertex, // fn-only
181181 uniform, position, descriptor_set = 0 , binding = 0 , flat, invariant, // param-only
182182 ) ]
183183 const _INHERENT_ASSOC_CONST: ( ) = ( ) ;
184184
185- #[ rust_gpu:: spirv (
185+ #[ rust_gpu:: spirv_v0_9 (
186186 sampler, block, sampled_image, generic_image_type, // struct-only
187187 uniform, position, descriptor_set = 0 , binding = 0 , flat, invariant, // param-only
188188 ) ]
189189 fn _inherent_method ( ) { }
190190}
191191
192- #[ rust_gpu:: spirv (
192+ #[ rust_gpu:: spirv_v0_9 (
193193 sampler, block, sampled_image, generic_image_type, // struct-only
194194 vertex, // fn-only
195195 uniform, position, descriptor_set = 0 , binding = 0 , flat, invariant, // param-only
196196) ]
197197trait _TraitAlias = Copy ;
198198
199- #[ rust_gpu:: spirv (
199+ #[ rust_gpu:: spirv_v0_9 (
200200 sampler, block, sampled_image, generic_image_type, // struct-only
201201 vertex, // fn-only
202202 uniform, position, descriptor_set = 0 , binding = 0 , flat, invariant, // param-only
203203) ]
204204trait _Trait {
205- #[ rust_gpu:: spirv (
205+ #[ rust_gpu:: spirv_v0_9 (
206206 sampler, block, sampled_image, generic_image_type, // struct-only
207207 vertex, // fn-only
208208 uniform, position, descriptor_set = 0 , binding = 0 , flat, invariant, // param-only
209209 ) ]
210210 type _AssocTy ;
211211
212- #[ rust_gpu:: spirv (
212+ #[ rust_gpu:: spirv_v0_9 (
213213 sampler, block, sampled_image, generic_image_type, // struct-only
214214 vertex, // fn-only
215215 uniform, position, descriptor_set = 0 , binding = 0 , flat, invariant, // param-only
216216 ) ]
217217 const _TRAIT_ASSOC_CONST: ( ) ;
218218
219- #[ rust_gpu:: spirv (
219+ #[ rust_gpu:: spirv_v0_9 (
220220 sampler, block, sampled_image, generic_image_type, // struct-only
221221 vertex, // fn-only
222222 uniform, position, descriptor_set = 0 , binding = 0 , flat, invariant, // param-only
223223 ) ]
224224 fn _trait_method ( ) ;
225225
226- #[ rust_gpu:: spirv (
226+ #[ rust_gpu:: spirv_v0_9 (
227227 sampler, block, sampled_image, generic_image_type, // struct-only
228228 uniform, position, descriptor_set = 0 , binding = 0 , flat, invariant, // param-only
229229 ) ]
230230 fn _trait_method_with_default ( ) { }
231231}
232232
233- #[ rust_gpu:: spirv (
233+ #[ rust_gpu:: spirv_v0_9 (
234234 sampler, block, sampled_image, generic_image_type, // struct-only
235235 vertex, // fn-only
236236 uniform, position, descriptor_set = 0 , binding = 0 , flat, invariant, // param-only
237237) ]
238238impl _Trait for ( ) {
239- #[ rust_gpu:: spirv (
239+ #[ rust_gpu:: spirv_v0_9 (
240240 sampler, block, sampled_image, generic_image_type, // struct-only
241241 vertex, // fn-only
242242 uniform, position, descriptor_set = 0 , binding = 0 , flat, invariant, // param-only
243243 ) ]
244244 type _AssocTy = ( ) ;
245245
246- #[ rust_gpu:: spirv (
246+ #[ rust_gpu:: spirv_v0_9 (
247247 sampler, block, sampled_image, generic_image_type, // struct-only
248248 vertex, // fn-only
249249 uniform, position, descriptor_set = 0 , binding = 0 , flat, invariant, // param-only
250250 ) ]
251251 const _TRAIT_ASSOC_CONST: ( ) = ( ) ;
252252
253- #[ rust_gpu:: spirv (
253+ #[ rust_gpu:: spirv_v0_9 (
254254 sampler, block, sampled_image, generic_image_type, // struct-only
255255 uniform, position, descriptor_set = 0 , binding = 0 , flat, invariant, // param-only
256256 ) ]
257257 fn _trait_method ( ) { }
258258}
259259
260- #[ rust_gpu:: spirv (
260+ #[ rust_gpu:: spirv_v0_9 (
261261 sampler, block, sampled_image, generic_image_type, // struct-only
262262 uniform, position, descriptor_set = 0 , binding = 0 , flat, invariant, // param-only
263263) ]
264264fn _fn(
265- #[ rust_gpu:: spirv (
265+ #[ rust_gpu:: spirv_v0_9 (
266266 sampler, block, sampled_image, generic_image_type, // struct-only
267267 vertex, // fn-only
268268 ) ]
269269 _entry_param : ( ) ,
270270) {
271- #[ rust_gpu:: spirv (
271+ #[ rust_gpu:: spirv_v0_9 (
272272 sampler, block, sampled_image, generic_image_type, // struct-only
273273 vertex, // fn-only
274274 uniform, position, descriptor_set = 0 , binding = 0 , flat, invariant, // param-only
275275 ) ]
276276 let _statement = ( ) ;
277277
278- let _closure = #[ rust_gpu:: spirv (
278+ let _closure = #[ rust_gpu:: spirv_v0_9 (
279279 sampler, block, sampled_image, generic_image_type, // struct-only
280280 vertex, // fn-only
281281 uniform, position, descriptor_set = 0 , binding = 0 , flat, invariant, // param-only
282282 ) ]
283283 || { } ;
284284
285285 (
286- #[ rust_gpu:: spirv (
286+ #[ rust_gpu:: spirv_v0_9 (
287287 sampler, block, sampled_image, generic_image_type, // struct-only
288288 vertex, // fn-only
289289 uniform, position, descriptor_set = 0 , binding = 0 , flat, invariant, // param-only
@@ -293,7 +293,7 @@ fn _fn(
293293 ) ;
294294
295295 match ( ) {
296- #[ rust_gpu:: spirv (
296+ #[ rust_gpu:: spirv_v0_9 (
297297 sampler, block, sampled_image, generic_image_type, // struct-only
298298 vertex, // fn-only
299299 uniform, position, descriptor_set = 0 , binding = 0 , flat, invariant, // param-only
@@ -303,17 +303,17 @@ fn _fn(
303303}
304304
305305fn _fn_with_generics<
306- #[ rust_gpu:: spirv (
306+ #[ rust_gpu:: spirv_v0_9 (
307307 sampler, block, sampled_image, generic_image_type, // struct-only
308308 vertex, // fn-only
309309 uniform, position, descriptor_set = 0 , binding = 0 , flat, invariant, // param-only
310310 ) ] ' _lifetime_param,
311- #[ rust_gpu:: spirv (
311+ #[ rust_gpu:: spirv_v0_9 (
312312 sampler, block, sampled_image, generic_image_type, // struct-only
313313 vertex, // fn-only
314314 uniform, position, descriptor_set = 0 , binding = 0 , flat, invariant, // param-only
315315 ) ] _TyParam,
316- #[ rust_gpu:: spirv (
316+ #[ rust_gpu:: spirv_v0_9 (
317317 sampler, block, sampled_image, generic_image_type, // struct-only
318318 vertex, // fn-only
319319 uniform, position, descriptor_set = 0 , binding = 0 , flat, invariant, // param-only
0 commit comments