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 confusingly when there are no non-disabled variants #7

Closed
PokeJofeJr4th opened this issue Jul 1, 2023 · 0 comments
Closed
Labels
bug Something isn't working

Comments

@PokeJofeJr4th
Copy link
Owner

The following error message is given:

error[E0392]: parameter `T` is never used
  --> strum_tests\tests\enum_map.rs:15:10
   |
15 | #[derive(EnumMap)]
   |          ^^^^^^^ unused parameter
   |
   = help: consider removing `T`, referring to it in a field, or using a marker such as `std::marker::PhantomData`
   = help: if you intended `T` to be a const parameter, use `const T: usize` instead
   = note: this error originates in the derive macro `EnumMap` (in Nightly builds, run with -Z macro-backtrace for more info)

Since type T is not exposed to the end user, this is not a useful error message. The EnumMap derive should check if the enum is empty and either return its own error explaining what's going on or remove the generic parameter.

@PokeJofeJr4th PokeJofeJr4th added the bug Something isn't working label Jul 1, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant