PistonDevelopers / piston

A modular game engine written in Rust
https://www.piston.rs
MIT License
4.62k stars 234 forks source link

An issue with import pistion_window version 0.120.0 into fresh rust project #1379

Closed mehrdaddolatkhah closed 2 years ago

mehrdaddolatkhah commented 2 years ago

Hi Guys,

When I try to import piston_window = "0.120.0", that is the last version in this time, and try to cargo update and then cargo build I got these error messages:

Compiling pistoncore-input v1.0.1
error[E0658]: or-patterns syntax is experimental
  --> /Users/mehrdad/.cargo/registry/src/github.com-1ecc6299db9ec823/pistoncore-input-1.0.1/src/keyboard.rs:67:34
   |
67 |                 Button::Keyboard(Key::LCtrl | Key::RCtrl) => self.insert(ModifierKey::CTRL),
   |                                  ^^^^^^^^^^^^^^^^^^^^^^^
   |
   = note: see issue #54883 <https://github.com/rust-lang/rust/issues/54883> for more information

error[E0658]: or-patterns syntax is experimental
  --> /Users/mehrdad/.cargo/registry/src/github.com-1ecc6299db9ec823/pistoncore-input-1.0.1/src/keyboard.rs:68:34
   |
68 |                 Button::Keyboard(Key::LShift | Key::RShift) => self.insert(ModifierKey::SHIFT),
   |                                  ^^^^^^^^^^^^^^^^^^^^^^^^^
   |
   = note: see issue #54883 <https://github.com/rust-lang/rust/issues/54883> for more information

error[E0658]: or-patterns syntax is experimental
  --> /Users/mehrdad/.cargo/registry/src/github.com-1ecc6299db9ec823/pistoncore-input-1.0.1/src/keyboard.rs:69:34
   |
69 |                 Button::Keyboard(Key::LAlt | Key::RAlt) => self.insert(ModifierKey::ALT),
   |                                  ^^^^^^^^^^^^^^^^^^^^^
   |
   = note: see issue #54883 <https://github.com/rust-lang/rust/issues/54883> for more information

error[E0658]: or-patterns syntax is experimental
  --> /Users/mehrdad/.cargo/registry/src/github.com-1ecc6299db9ec823/pistoncore-input-1.0.1/src/keyboard.rs:70:34
   |
70 |                 Button::Keyboard(Key::LGui | Key::RGui) => self.insert(ModifierKey::GUI),
   |                                  ^^^^^^^^^^^^^^^^^^^^^
   |
   = note: see issue #54883 <https://github.com/rust-lang/rust/issues/54883> for more information

error[E0658]: or-patterns syntax is experimental
  --> /Users/mehrdad/.cargo/registry/src/github.com-1ecc6299db9ec823/pistoncore-input-1.0.1/src/keyboard.rs:76:34
   |
76 |                 Button::Keyboard(Key::LCtrl | Key::RCtrl) => self.remove(ModifierKey::CTRL),
   |                                  ^^^^^^^^^^^^^^^^^^^^^^^
   |
   = note: see issue #54883 <https://github.com/rust-lang/rust/issues/54883> for more information

error[E0658]: or-patterns syntax is experimental
  --> /Users/mehrdad/.cargo/registry/src/github.com-1ecc6299db9ec823/pistoncore-input-1.0.1/src/keyboard.rs:77:34
   |
77 |                 Button::Keyboard(Key::LShift | Key::RShift) => self.remove(ModifierKey::SHIFT),
   |                                  ^^^^^^^^^^^^^^^^^^^^^^^^^
   |
   = note: see issue #54883 <https://github.com/rust-lang/rust/issues/54883> for more information

error[E0658]: or-patterns syntax is experimental
  --> /Users/mehrdad/.cargo/registry/src/github.com-1ecc6299db9ec823/pistoncore-input-1.0.1/src/keyboard.rs:78:34
   |
78 |                 Button::Keyboard(Key::LAlt | Key::RAlt) => self.remove(ModifierKey::ALT),
   |                                  ^^^^^^^^^^^^^^^^^^^^^
   |
   = note: see issue #54883 <https://github.com/rust-lang/rust/issues/54883> for more information

error[E0658]: or-patterns syntax is experimental
  --> /Users/mehrdad/.cargo/registry/src/github.com-1ecc6299db9ec823/pistoncore-input-1.0.1/src/keyboard.rs:79:34
   |
79 |                 Button::Keyboard(Key::LGui | Key::RGui) => self.remove(ModifierKey::GUI),
   |                                  ^^^^^^^^^^^^^^^^^^^^^
   |
   = note: see issue #54883 <https://github.com/rust-lang/rust/issues/54883> for more information

error: aborting due to 8 previous errors

For more information about this error, try `rustc --explain E0658`.
error: could not compile `pistoncore-input`

To learn more, run the command again with --verbose.

May please guide me on how I could fix this error. thank you

hint: I used an apple silicon laptop, is it possible this error occurred in this specific device?

mehrdaddolatkhah commented 2 years ago

Hey guys,

after getting some hands from my friend in the Iranian Rustland group in Iran. we found out I have 2 rustc on my machine. so after completely uninstalling Rust and related stuff to it and reinstall again. everything is working fine