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

derive fails for structs with const generics #60

Open
MyK00L opened this issue Nov 19, 2023 · 0 comments
Open

derive fails for structs with const generics #60

MyK00L opened this issue Nov 19, 2023 · 0 comments

Comments

@MyK00L
Copy link

MyK00L commented Nov 19, 2023

trying to compile

#[derive(speedy::Readable)]
struct A<const S: usize> {
    a: [u8;S],
}

results in this error

 --> src/main.rs:3:12
  |
3 |     a: [u8;S],
  |            ^ not found in this scope

error[E0107]: missing generics for struct `A`
 --> src/main.rs:2:8
  |
2 | struct A<const S: usize> {
  |        ^ expected 1 generic argument
  |
note: struct defined here, with 1 generic parameter: `S`
 --> src/main.rs:2:8
  |
2 | struct A<const S: usize> {
  |        ^ --------------
help: add missing generic argument
  |
2 | struct A<S><const S: usize> {
  |         +++

Which I thought was very weird and funny before I finally understood it was inside code generated by a macro.

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

1 participant