Closed chanced closed 6 months ago
A more minimal example
#[derive(Snafu)]
pub struct Foo<const N: i32> {}
This code does not compile with the derive macro present, with the following error. If you take away the derive macro, it compiles normally
error[E0412]: cannot find type `N` in this scope
--> src/main.rs:4:22
|
4 | pub struct Foo<const N: i32> {}
| ^ not found in this scope
error[E0747]: unresolved item provided when a constant was expected
--> src/main.rs:4:22
|
4 | pub struct Foo<const N: i32> {}
| ^
|
help: if this generic argument was intended as a const parameter, surround it with braces
|
4 | pub struct Foo<const { N }: i32> {}
| + +
See #438
I'm moving one of my libs over to snafu but I've run into an issue with an error that uses const generics. It compiles if I remove the
Snafu
derive.