File tree 2 files changed +55
-0
lines changed
2 files changed +55
-0
lines changed Original file line number Diff line number Diff line change
1
+ // build-fail
2
+
3
+ use spirv_std:: spirv;
4
+
5
+ #[ derive( Default ) ]
6
+ struct Foo {
7
+ bar : bool ,
8
+ baz : [ [ u32 ; 2 ] ; 1 ] ,
9
+ }
10
+
11
+ #[ spirv( fragment) ]
12
+ pub fn main ( ) {
13
+ let x = [ [ 1 ; 2 ] ; 1 ] ;
14
+ let y = [ Foo :: default ( ) ; 1 ] ;
15
+ }
Original file line number Diff line number Diff line change
1
+ error: cannot cast between pointer types
2
+ from `*i32`
3
+ to `*[i32; 2]`
4
+ --> $DIR/issue-46.rs:13:13
5
+ |
6
+ 13 | let x = [[1; 2]; 1];
7
+ | ^^^^^^^^^^^
8
+ |
9
+ note: used from within `issue_46::main`
10
+ --> $DIR/issue-46.rs:13:13
11
+ |
12
+ 13 | let x = [[1; 2]; 1];
13
+ | ^^^^^^^^^^^
14
+ note: called by `main`
15
+ --> $DIR/issue-46.rs:12:8
16
+ |
17
+ 12 | pub fn main() {
18
+ | ^^^^
19
+
20
+ error: cannot cast between pointer types
21
+ from `*[[u32; 2]; 1]`
22
+ to `*struct Foo { baz: [[u32; 2]; 1], bar: bool }`
23
+ --> $DIR/issue-46.rs:14:13
24
+ |
25
+ 14 | let y = [Foo::default(); 1];
26
+ | ^^^^^^^^^^^^^^^^^^^
27
+ |
28
+ note: used from within `issue_46::main`
29
+ --> $DIR/issue-46.rs:14:13
30
+ |
31
+ 14 | let y = [Foo::default(); 1];
32
+ | ^^^^^^^^^^^^^^^^^^^
33
+ note: called by `main`
34
+ --> $DIR/issue-46.rs:12:8
35
+ |
36
+ 12 | pub fn main() {
37
+ | ^^^^
38
+
39
+ error: aborting due to 2 previous errors
40
+
You can’t perform that action at this time.
0 commit comments