File tree Expand file tree Collapse file tree 2 files changed +26
-0
lines changed Expand file tree Collapse file tree 2 files changed +26
-0
lines changed Original file line number Diff line number Diff line change
1
+ // Test that using `(a..b).contains(&x)`, which is starting to get used
2
+ // in `core` (see https://github.com/rust-lang/rust/pull/87723), cannot
3
+ // cause a fatal error, but at most a zombie or SPIR-V validation error.
4
+
5
+ // build-fail
6
+
7
+ // HACK(eddyb) this allows CI (older?) `spirv-val` output to also work.
8
+ // normalize-stderr-test " %\d+ = OpVariable %\w+ Function\n\n" -> ""
9
+
10
+ use spirv_std as _;
11
+
12
+ fn has_two_decimal_digits ( x : u32 ) -> bool {
13
+ ( 10 ..100 ) . contains ( & x)
14
+ }
15
+
16
+ #[ spirv( fragment) ]
17
+ pub fn main ( i : u32 , o : & mut bool ) {
18
+ * o = has_two_decimal_digits ( i) ;
19
+ }
Original file line number Diff line number Diff line change
1
+ error: error:0:0 - In Logical addressing, variables may not allocate a pointer type
2
+ |
3
+ = note: spirv-val failed
4
+ = note: module `$TEST_BUILD_DIR/lang/core/ops/range-contains.stage-id.spv.dir/module`
5
+
6
+ error: aborting due to previous error
7
+
You can’t perform that action at this time.
0 commit comments