Open vimyang opened 2 weeks ago
I tried your code and it works fine for me with both 0.7 and 0.8, x64 Windows 11.
Try deleting your Cargo.lock
file and see if that helps, it might contain some incompatible dependency.
What OS and version are you using? x64 or ARM?
Thank you for your reply. My system is mac m1 arm. I plan to delete the Cargo.lock file and verify it. If you have any questions, please consult me. Thank you 🙏
code: https://github.com/yangmingming/learn_rust/tree/error
git checkout origin/error
cd druid
cargo run --bin radio
Even if the version in Cargo.toml is modified to v0.8.1, the version in the regenerated Cargo.lock is still v0.8.3
[dependencies]
druid = "0.8.1"
error msg
(base) xxxxxxx@xxxxxxx druid % cargo run --bin radio
Compiling druid-shell v0.8.3
ls Building [=======================> ] 175/178: druid-shell
error[E0533]: expected value, found struct variant `KbKey::Character`
--> /Users/xxxxxxx/.cargo/registry/src/index.crates.io-6f17d22bba15001f/druid-shell-0.8.3/src/backend/mac/keyboard.rs:316:21
|
316 | KbKey::Character(characters)
| ^^^^^^^^^^^^^^^^ not a value
error[E0533]: expected value, found struct variant `KbKey::Character`
--> /Users/xxxxxxx/.cargo/registry/src/index.crates.io-6f17d22bba15001f/druid-shell-0.8.3/src/backend/mac/keyboard.rs:320:25
|
320 | KbKey::Character(chars_ignoring)
| ^^^^^^^^^^^^^^^^ not a value
error[E0164]: expected tuple struct or tuple variant, found struct variant `KbKey::Character`
--> /Users/xxxxxxx/.cargo/registry/src/index.crates.io-6f17d22bba15001f/druid-shell-0.8.3/src/backend/mac/menu.rs:123:13
|
123 | KbKey::Character(t) => t,
| ^^^^^^^^^^^^^^^^^^^ not a tuple struct or tuple variant
error[E0164]: expected tuple struct or tuple variant, found struct variant `KbKey::Character`
--> /Users/xxxxxxx/.cargo/registry/src/index.crates.io-6f17d22bba15001f/druid-shell-0.8.3/src/hotkey.rs:97:16
|
97 | if let KbKey::Character(s) = &self.key {
| ^^^^^^^^^^^^^^^^^^^ not a tuple struct or tuple variant
error[E0533]: expected value, found struct variant `KbKey::Character`
--> /Users/xxxxxxx/.cargo/registry/src/index.crates.io-6f17d22bba15001f/druid-shell-0.8.3/src/keyboard.rs:219:9
|
219 | KbKey::Character(self.into())
| ^^^^^^^^^^^^^^^^ not a value
error[E0164]: expected tuple struct or tuple variant, found struct variant `KbKey::Character`
--> /Users/xxxxxxx/.cargo/registry/src/index.crates.io-6f17d22bba15001f/druid-shell-0.8.3/src/text.rs:473:9
|
473 | KbKey::Character(c) if !event.mods.ctrl() && !event.mods.meta() && !event.mods.alt() => {
| ^^^^^^^^^^^^^^^^^^^ not a tuple struct or tuple variant
Some errors have detailed explanations: E0164, E0533.
For more information about an error, try `rustc --explain E0164`.
error: could not compile `druid-shell` (lib) due to 6 previous errors
(base) xxxxxxx@Baidu-xxxxxxx druid %
When I was using druid version 0.7.0, the code worked fine.
But when I modify my 0.8.3, I get an error that has nothing to do with my code, as follows
I tried the following operations, and it still didn’t solve the problem after re-running it.
Thanks ~
run command
the code