EmbarkStudios/rust-gpu

Investigate clippy failure on example-shader with glam

repi opened this issue · 3 comments

repi commented

Running clippy on example-shader after the glam conversion in #149 results in:

     Compiling example-shader v0.1.0 (/home/runner/work/rust-gpu/rust-gpu/examples/example-shader)
  error: constant runtime array value

https://github.com/EmbarkStudios/rust-gpu/pull/149/checks?check_run_id=1326417262

it is from our codegen but not sure how we are getting it and needs further investigation

The actual failure is due to panicking with a string, and strings are not supported yet. I added a quick ignored test as a reminder to implement it eventually.

// TODO: Implement strings to make this compile
#[test]
#[ignore]
fn panic() {
val(r#"
#[allow(unused_attributes)]
#[spirv(fragment)]
pub fn main() {
panic!("aaa");
}
"#);
}

But for why clippy generates code that panics with a string, but normal builds don't, that I have no idea on. I tried investigating for a few hours, and came up with nothing.

repi commented

I think I managed to get this problem also when building the shader in debug (so not using --release), which likely introduces debug asserts with strings also

I think this is probably fixed with eddyb's work