Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add failing tests for https://github.com/Rust-GPU/rust-gpu/issues/46 #165

Merged
merged 1 commit into from
Dec 13, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions tests/ui/lang/issue-46.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
// build-fail

use spirv_std::spirv;

#[derive(Default)]
struct Foo {
bar: bool,
baz: [[u32; 2]; 1],
}

#[spirv(fragment)]
pub fn main() {
let x = [[1; 2]; 1];
let y = [Foo::default(); 1];
}
40 changes: 40 additions & 0 deletions tests/ui/lang/issue-46.stderr
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
error: cannot cast between pointer types
from `*i32`
to `*[i32; 2]`
--> $DIR/issue-46.rs:13:13
|
13 | let x = [[1; 2]; 1];
| ^^^^^^^^^^^
|
note: used from within `issue_46::main`
--> $DIR/issue-46.rs:13:13
|
13 | let x = [[1; 2]; 1];
| ^^^^^^^^^^^
note: called by `main`
--> $DIR/issue-46.rs:12:8
|
12 | pub fn main() {
| ^^^^

error: cannot cast between pointer types
from `*[[u32; 2]; 1]`
to `*struct Foo { baz: [[u32; 2]; 1], bar: bool }`
--> $DIR/issue-46.rs:14:13
|
14 | let y = [Foo::default(); 1];
| ^^^^^^^^^^^^^^^^^^^
|
note: used from within `issue_46::main`
--> $DIR/issue-46.rs:14:13
|
14 | let y = [Foo::default(); 1];
| ^^^^^^^^^^^^^^^^^^^
note: called by `main`
--> $DIR/issue-46.rs:12:8
|
12 | pub fn main() {
| ^^^^

error: aborting due to 2 previous errors