Peternator7 / strum

A small rust library for adding custom derives to enums
https://crates.io/crates/strum
MIT License
1.8k stars 151 forks source link

fix: use core not std to allow no_std to compile #325

Closed ripytide closed 10 months ago

ripytide commented 10 months ago

Getting a compile error on no_std for the new v0.26.0 release:

> cargo check
error[E0433]: failed to resolve: use of undeclared crate or module `std`
   --> strum/src/lib.rs:226:25
    |
226 | pub trait VariantArray: std::marker::Sized + 'static {
    |                         ^^^ use of undeclared crate or module `std`
    |
help: consider importing this module
    |
33  + use core::marker;
    |
help: if you import `marker`, refer to it directly
    |
226 - pub trait VariantArray: std::marker::Sized + 'static {
226 + pub trait VariantArray: marker::Sized + 'static {
    |

For more information about this error, try `rustc --explain E0433`.
error: could not compile `strum` (lib) due to 1 previous error

The fix was to use core not std. I'm surprised this sort of thing isn't caught by CI tests?

Peternator7 commented 10 months ago

just pushed 0.26.1 to fix it. Thanks for catching this.