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

error: array lengths can't depend on generic parameters #50

Closed
jonathanstrong opened this issue Dec 31, 2019 · 5 comments
Closed

error: array lengths can't depend on generic parameters #50

jonathanstrong opened this issue Dec 31, 2019 · 5 comments

Comments

@jonathanstrong
Copy link

jonathanstrong commented Dec 31, 2019

ran into this error with nightly (via $ cargo check on master at 4ac62c2):

error: array lengths can't depend on generic parameters
   --> src/sgemm_kernel.rs:223:40
    |
223 |     let mut ab = [_mm256_setzero_ps(); MR];
    |                                        ^^
$ rustc --version
rustc 1.42.0-nightly (a9dd56ff9 2019-12-30)

haven't been able to make much headway in understanding what changed in rustc, but it seems likely this is a compiler bug.

It looks like substituting a const fn implemented on the struct does work (current implementation seems to rely on trait associated constants).

update: for a quick workaround, roll-back to nightly-2019-12-25 (ho ho ho!)

@azriel91
Copy link

Related issue: rust-lang/rust#67743

@norru
Copy link

norru commented Jan 13, 2020

Reproduced in:

  • (nightly) rustc 1.42.0-nightly (859764425 2020-01-07)

Works in:

  • (stable) rustc 1.40.0 (73528e339 2019-12-16)

@bluss
Copy link
Owner

bluss commented Jan 13, 2020

Thanks! As you know, this code compiles since Rust 1.28, so it's unfortunate that it is broken on nightly.

@vladbat00
Copy link

I was able to compile it on rustc 1.42.0-nightly (6d3f4e0aa 2020-01-25), Windows 10

@bluss
Copy link
Owner

bluss commented Mar 15, 2020

The issue has been fixed in Rust and is fixed in Rust 1.42. It will continue to be an issue (unless further changes are done in matrixmultiply) with older versions, but it is probably too late to matter now.

@bluss bluss closed this as completed Mar 15, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants