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"
2
2
// (i.e. various kinds of definitions and other syntactic categories).
3
3
4
4
// build-fail
11
11
) ]
12
12
13
13
// 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:
15
15
// * entry: `vertex`
16
16
// * storage class: `uniform`
17
17
// * builtin: `position`
18
18
19
19
// NOTE(eddyb) accounting for the number of errors this test actually produces:
20
20
// * 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`
23
23
// * the difference between 451 and 437 is 14, i.e. valid attributes, made up of:
24
24
// * 4 on `_Struct`
25
25
// * 4 on functions, i.e. 1 on each of:
29
29
// * `_fn`
30
30
// * 6 on `_entry_param`
31
31
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
33
33
34
- #[ rust_gpu:: spirv (
34
+ #[ rust_gpu:: spirv_v0_9 (
35
35
sampler, block, sampled_image, generic_image_type, // struct-only
36
36
vertex, // fn-only
37
37
uniform, position, descriptor_set = 0 , binding = 0 , flat, invariant, // param-only
@@ -40,77 +40,77 @@ macro_rules! _macro {
40
40
( ) => { } ;
41
41
}
42
42
43
- #[ rust_gpu:: spirv (
43
+ #[ rust_gpu:: spirv_v0_9 (
44
44
sampler, block, sampled_image, generic_image_type, // struct-only
45
45
vertex, // fn-only
46
46
uniform, position, descriptor_set = 0 , binding = 0 , flat, invariant, // param-only
47
47
) ]
48
48
extern crate spirv_std as _;
49
49
50
- #[ rust_gpu:: spirv (
50
+ #[ rust_gpu:: spirv_v0_9 (
51
51
sampler, block, sampled_image, generic_image_type, // struct-only
52
52
vertex, // fn-only
53
53
uniform, position, descriptor_set = 0 , binding = 0 , flat, invariant, // param-only
54
54
) ]
55
55
use spirv_std as _;
56
56
57
- #[ rust_gpu:: spirv (
57
+ #[ rust_gpu:: spirv_v0_9 (
58
58
sampler, block, sampled_image, generic_image_type, // struct-only
59
59
vertex, // fn-only
60
60
uniform, position, descriptor_set = 0 , binding = 0 , flat, invariant, // param-only
61
61
) ]
62
62
mod _mod { }
63
63
64
- #[ rust_gpu:: spirv (
64
+ #[ rust_gpu:: spirv_v0_9 (
65
65
sampler, block, sampled_image, generic_image_type, // struct-only
66
66
vertex, // fn-only
67
67
uniform, position, descriptor_set = 0 , binding = 0 , flat, invariant, // param-only
68
68
) ]
69
69
extern "C" {
70
- #[ rust_gpu:: spirv (
70
+ #[ rust_gpu:: spirv_v0_9 (
71
71
sampler, block, sampled_image, generic_image_type, // struct-only
72
72
vertex, // fn-only
73
73
uniform, position, descriptor_set = 0 , binding = 0 , flat, invariant, // param-only
74
74
) ]
75
75
type _ForeignTy ;
76
76
77
- #[ rust_gpu:: spirv (
77
+ #[ rust_gpu:: spirv_v0_9 (
78
78
sampler, block, sampled_image, generic_image_type, // struct-only
79
79
vertex, // fn-only
80
80
uniform, position, descriptor_set = 0 , binding = 0 , flat, invariant, // param-only
81
81
) ]
82
82
static _FOREIGN_STATIC: ( ) ;
83
83
84
- #[ rust_gpu:: spirv (
84
+ #[ rust_gpu:: spirv_v0_9 (
85
85
sampler, block, sampled_image, generic_image_type, // struct-only
86
86
vertex, // fn-only
87
87
uniform, position, descriptor_set = 0 , binding = 0 , flat, invariant, // param-only
88
88
) ]
89
89
fn _foreign_fn ( ) ;
90
90
}
91
91
92
- #[ rust_gpu:: spirv (
92
+ #[ rust_gpu:: spirv_v0_9 (
93
93
sampler, block, sampled_image, generic_image_type, // struct-only
94
94
vertex, // fn-only
95
95
uniform, position, descriptor_set = 0 , binding = 0 , flat, invariant, // param-only
96
96
) ]
97
97
static _STATIC: ( ) = ( ) ;
98
98
99
- #[ rust_gpu:: spirv (
99
+ #[ rust_gpu:: spirv_v0_9 (
100
100
sampler, block, sampled_image, generic_image_type, // struct-only
101
101
vertex, // fn-only
102
102
uniform, position, descriptor_set = 0 , binding = 0 , flat, invariant, // param-only
103
103
) ]
104
104
const _CONST: ( ) = ( ) ;
105
105
106
- #[ rust_gpu:: spirv (
106
+ #[ rust_gpu:: spirv_v0_9 (
107
107
sampler, block, sampled_image, generic_image_type, // struct-only
108
108
vertex, // fn-only
109
109
uniform, position, descriptor_set = 0 , binding = 0 , flat, invariant, // param-only
110
110
) ]
111
111
type _TyAlias = ( ) ;
112
112
113
- #[ rust_gpu:: spirv (
113
+ #[ rust_gpu:: spirv_v0_9 (
114
114
sampler, block, sampled_image, generic_image_type, // struct-only
115
115
vertex, // fn-only
116
116
uniform, position, descriptor_set = 0 , binding = 0 , flat, invariant, // param-only
@@ -121,19 +121,19 @@ fn _opaque_ty_definer() -> _OpaqueTy {
121
121
( )
122
122
}
123
123
124
- #[ rust_gpu:: spirv (
124
+ #[ rust_gpu:: spirv_v0_9 (
125
125
sampler, block, sampled_image, generic_image_type, // struct-only
126
126
vertex, // fn-only
127
127
uniform, position, descriptor_set = 0 , binding = 0 , flat, invariant, // param-only
128
128
) ]
129
129
enum _Enum {
130
- #[ rust_gpu:: spirv (
130
+ #[ rust_gpu:: spirv_v0_9 (
131
131
sampler, block, sampled_image, generic_image_type, // struct-only
132
132
vertex, // fn-only
133
133
uniform, position, descriptor_set = 0 , binding = 0 , flat, invariant, // param-only
134
134
) ]
135
135
_Variant {
136
- #[ rust_gpu:: spirv (
136
+ #[ rust_gpu:: spirv_v0_9 (
137
137
sampler, block, sampled_image, generic_image_type, // struct-only
138
138
vertex, // fn-only
139
139
uniform, position, descriptor_set = 0 , binding = 0 , flat, invariant, // param-only
@@ -142,148 +142,148 @@ enum _Enum {
142
142
} ,
143
143
}
144
144
145
- #[ rust_gpu:: spirv (
145
+ #[ rust_gpu:: spirv_v0_9 (
146
146
sampler, block, sampled_image, generic_image_type, // struct-only
147
147
vertex, // fn-only
148
148
uniform, position, descriptor_set = 0 , binding = 0 , flat, invariant, // param-only
149
149
) ]
150
150
union _Union {
151
- #[ rust_gpu:: spirv (
151
+ #[ rust_gpu:: spirv_v0_9 (
152
152
sampler, block, sampled_image, generic_image_type, // struct-only
153
153
vertex, // fn-only
154
154
uniform, position, descriptor_set = 0 , binding = 0 , flat, invariant, // param-only
155
155
) ]
156
156
_field : ( ) ,
157
157
}
158
158
159
- #[ rust_gpu:: spirv (
159
+ #[ rust_gpu:: spirv_v0_9 (
160
160
vertex, // fn-only
161
161
uniform, position, descriptor_set = 0 , binding = 0 , flat, invariant, // param-only
162
162
) ]
163
163
struct _Struct {
164
- #[ rust_gpu:: spirv (
164
+ #[ rust_gpu:: spirv_v0_9 (
165
165
sampler, block, sampled_image, generic_image_type, // struct-only
166
166
vertex, // fn-only
167
167
uniform, position, descriptor_set = 0 , binding = 0 , flat, invariant, // param-only
168
168
) ]
169
169
_field : ( ) ,
170
170
}
171
171
172
- #[ rust_gpu:: spirv (
172
+ #[ rust_gpu:: spirv_v0_9 (
173
173
sampler, block, sampled_image, generic_image_type, // struct-only
174
174
vertex, // fn-only
175
175
uniform, position, descriptor_set = 0 , binding = 0 , flat, invariant, // param-only
176
176
) ]
177
177
impl _Struct {
178
- #[ rust_gpu:: spirv (
178
+ #[ rust_gpu:: spirv_v0_9 (
179
179
sampler, block, sampled_image, generic_image_type, // struct-only
180
180
vertex, // fn-only
181
181
uniform, position, descriptor_set = 0 , binding = 0 , flat, invariant, // param-only
182
182
) ]
183
183
const _INHERENT_ASSOC_CONST: ( ) = ( ) ;
184
184
185
- #[ rust_gpu:: spirv (
185
+ #[ rust_gpu:: spirv_v0_9 (
186
186
sampler, block, sampled_image, generic_image_type, // struct-only
187
187
uniform, position, descriptor_set = 0 , binding = 0 , flat, invariant, // param-only
188
188
) ]
189
189
fn _inherent_method ( ) { }
190
190
}
191
191
192
- #[ rust_gpu:: spirv (
192
+ #[ rust_gpu:: spirv_v0_9 (
193
193
sampler, block, sampled_image, generic_image_type, // struct-only
194
194
vertex, // fn-only
195
195
uniform, position, descriptor_set = 0 , binding = 0 , flat, invariant, // param-only
196
196
) ]
197
197
trait _TraitAlias = Copy ;
198
198
199
- #[ rust_gpu:: spirv (
199
+ #[ rust_gpu:: spirv_v0_9 (
200
200
sampler, block, sampled_image, generic_image_type, // struct-only
201
201
vertex, // fn-only
202
202
uniform, position, descriptor_set = 0 , binding = 0 , flat, invariant, // param-only
203
203
) ]
204
204
trait _Trait {
205
- #[ rust_gpu:: spirv (
205
+ #[ rust_gpu:: spirv_v0_9 (
206
206
sampler, block, sampled_image, generic_image_type, // struct-only
207
207
vertex, // fn-only
208
208
uniform, position, descriptor_set = 0 , binding = 0 , flat, invariant, // param-only
209
209
) ]
210
210
type _AssocTy ;
211
211
212
- #[ rust_gpu:: spirv (
212
+ #[ rust_gpu:: spirv_v0_9 (
213
213
sampler, block, sampled_image, generic_image_type, // struct-only
214
214
vertex, // fn-only
215
215
uniform, position, descriptor_set = 0 , binding = 0 , flat, invariant, // param-only
216
216
) ]
217
217
const _TRAIT_ASSOC_CONST: ( ) ;
218
218
219
- #[ rust_gpu:: spirv (
219
+ #[ rust_gpu:: spirv_v0_9 (
220
220
sampler, block, sampled_image, generic_image_type, // struct-only
221
221
vertex, // fn-only
222
222
uniform, position, descriptor_set = 0 , binding = 0 , flat, invariant, // param-only
223
223
) ]
224
224
fn _trait_method ( ) ;
225
225
226
- #[ rust_gpu:: spirv (
226
+ #[ rust_gpu:: spirv_v0_9 (
227
227
sampler, block, sampled_image, generic_image_type, // struct-only
228
228
uniform, position, descriptor_set = 0 , binding = 0 , flat, invariant, // param-only
229
229
) ]
230
230
fn _trait_method_with_default ( ) { }
231
231
}
232
232
233
- #[ rust_gpu:: spirv (
233
+ #[ rust_gpu:: spirv_v0_9 (
234
234
sampler, block, sampled_image, generic_image_type, // struct-only
235
235
vertex, // fn-only
236
236
uniform, position, descriptor_set = 0 , binding = 0 , flat, invariant, // param-only
237
237
) ]
238
238
impl _Trait for ( ) {
239
- #[ rust_gpu:: spirv (
239
+ #[ rust_gpu:: spirv_v0_9 (
240
240
sampler, block, sampled_image, generic_image_type, // struct-only
241
241
vertex, // fn-only
242
242
uniform, position, descriptor_set = 0 , binding = 0 , flat, invariant, // param-only
243
243
) ]
244
244
type _AssocTy = ( ) ;
245
245
246
- #[ rust_gpu:: spirv (
246
+ #[ rust_gpu:: spirv_v0_9 (
247
247
sampler, block, sampled_image, generic_image_type, // struct-only
248
248
vertex, // fn-only
249
249
uniform, position, descriptor_set = 0 , binding = 0 , flat, invariant, // param-only
250
250
) ]
251
251
const _TRAIT_ASSOC_CONST: ( ) = ( ) ;
252
252
253
- #[ rust_gpu:: spirv (
253
+ #[ rust_gpu:: spirv_v0_9 (
254
254
sampler, block, sampled_image, generic_image_type, // struct-only
255
255
uniform, position, descriptor_set = 0 , binding = 0 , flat, invariant, // param-only
256
256
) ]
257
257
fn _trait_method ( ) { }
258
258
}
259
259
260
- #[ rust_gpu:: spirv (
260
+ #[ rust_gpu:: spirv_v0_9 (
261
261
sampler, block, sampled_image, generic_image_type, // struct-only
262
262
uniform, position, descriptor_set = 0 , binding = 0 , flat, invariant, // param-only
263
263
) ]
264
264
fn _fn(
265
- #[ rust_gpu:: spirv (
265
+ #[ rust_gpu:: spirv_v0_9 (
266
266
sampler, block, sampled_image, generic_image_type, // struct-only
267
267
vertex, // fn-only
268
268
) ]
269
269
_entry_param : ( ) ,
270
270
) {
271
- #[ rust_gpu:: spirv (
271
+ #[ rust_gpu:: spirv_v0_9 (
272
272
sampler, block, sampled_image, generic_image_type, // struct-only
273
273
vertex, // fn-only
274
274
uniform, position, descriptor_set = 0 , binding = 0 , flat, invariant, // param-only
275
275
) ]
276
276
let _statement = ( ) ;
277
277
278
- let _closure = #[ rust_gpu:: spirv (
278
+ let _closure = #[ rust_gpu:: spirv_v0_9 (
279
279
sampler, block, sampled_image, generic_image_type, // struct-only
280
280
vertex, // fn-only
281
281
uniform, position, descriptor_set = 0 , binding = 0 , flat, invariant, // param-only
282
282
) ]
283
283
|| { } ;
284
284
285
285
(
286
- #[ rust_gpu:: spirv (
286
+ #[ rust_gpu:: spirv_v0_9 (
287
287
sampler, block, sampled_image, generic_image_type, // struct-only
288
288
vertex, // fn-only
289
289
uniform, position, descriptor_set = 0 , binding = 0 , flat, invariant, // param-only
@@ -293,7 +293,7 @@ fn _fn(
293
293
) ;
294
294
295
295
match ( ) {
296
- #[ rust_gpu:: spirv (
296
+ #[ rust_gpu:: spirv_v0_9 (
297
297
sampler, block, sampled_image, generic_image_type, // struct-only
298
298
vertex, // fn-only
299
299
uniform, position, descriptor_set = 0 , binding = 0 , flat, invariant, // param-only
@@ -303,17 +303,17 @@ fn _fn(
303
303
}
304
304
305
305
fn _fn_with_generics<
306
- #[ rust_gpu:: spirv (
306
+ #[ rust_gpu:: spirv_v0_9 (
307
307
sampler, block, sampled_image, generic_image_type, // struct-only
308
308
vertex, // fn-only
309
309
uniform, position, descriptor_set = 0 , binding = 0 , flat, invariant, // param-only
310
310
) ] ' _lifetime_param,
311
- #[ rust_gpu:: spirv (
311
+ #[ rust_gpu:: spirv_v0_9 (
312
312
sampler, block, sampled_image, generic_image_type, // struct-only
313
313
vertex, // fn-only
314
314
uniform, position, descriptor_set = 0 , binding = 0 , flat, invariant, // param-only
315
315
) ] _TyParam,
316
- #[ rust_gpu:: spirv (
316
+ #[ rust_gpu:: spirv_v0_9 (
317
317
sampler, block, sampled_image, generic_image_type, // struct-only
318
318
vertex, // fn-only
319
319
uniform, position, descriptor_set = 0 , binding = 0 , flat, invariant, // param-only
0 commit comments