While trying to port my game from 0.9 to 0.10, I getting this error:
I'm getting this error
error[E0277]: the trait bound `states::GameStates: Hash` is not satisfied
--> crates/game/src/states/mod.rs:18:10
|
18 | pub enum GameStates{
| ^^^^^^^^^^ the trait `Hash` is not implemented for `states::GameStates`
|
note: required by a bound in `States`
--> /home/set/.cargo/git/checkouts/bevy-f7ffde730c324c74/43ea6f2/crates/bevy_ecs/src/schedule/state.rs:40:68
|
40 | ...ne + PartialEq + Eq + Hash + Debug + Default {
| ^^^^ required by this bound in `States`
help: consider annotating `states::GameStates` with `#[derive(Hash)]`
|
18 | #[derive(Hash)]
|
error[E0277]: the trait bound `states::GameStates: Clone` is not satisfied
--> crates/game/src/states/mod.rs:18:10
|
18 | pub enum GameStates{
| ^^^^^^^^^^ the trait `Clone` is not implemented for `states::GameStates`
|
note: required by a bound in `States`
--> /home/set/.cargo/git/checkouts/bevy-f7ffde730c324c74/43ea6f2/crates/bevy_ecs/src/schedule/state.rs:40:43
|
40 | pub trait States: 'static + Send + Sync + Clone + PartialEq + Eq + Hash + Debug + Defa...
| ^^^^^ required by this bound in `States`
help: consider annotating `states::GameStates` with `#[derive(Clone)]`
|
18 | #[derive(Clone)]
but according to this example https://github.com/bevyengine/bevy-website/blob/cc3099aef6c30125d375ba363be4a3f5297cd880/content/news/2023-03-04-bevy-0.10/index.md#user-content-simpler-states there should not be hash and copy traits
my code is simple:
#[derive(States, PartialEq, Eq, Debug, Default)]
pub enum GameStates{
#[default]
Loader,
Init,
Menu,
Game,
Pause,
Test,
TestBullets,
Empty,
LavaBiome,
DungeonBiome
}