mirror of
https://github.com/rust-lang-cn/book-cn.git
synced 2025-01-23 23:50:25 +08:00
25 lines
757 B
Plaintext
25 lines
757 B
Plaintext
|
$ cargo build
|
||
|
Compiling libc v0.2.86
|
||
|
Compiling getrandom v0.2.2
|
||
|
Compiling cfg-if v1.0.0
|
||
|
Compiling ppv-lite86 v0.2.10
|
||
|
Compiling rand_core v0.6.2
|
||
|
Compiling rand_chacha v0.3.0
|
||
|
Compiling rand v0.8.3
|
||
|
Compiling guessing_game v0.1.0 (file:///projects/guessing_game)
|
||
|
error[E0308]: mismatched types
|
||
|
--> src/main.rs:22:21
|
||
|
|
|
||
|
22 | match guess.cmp(&secret_number) {
|
||
|
| ^^^^^^^^^^^^^^ expected struct `String`, found integer
|
||
|
|
|
||
|
= note: expected reference `&String`
|
||
|
found reference `&{integer}`
|
||
|
|
||
|
error: aborting due to previous error
|
||
|
|
||
|
For more information about this error, try `rustc --explain E0308`.
|
||
|
error: could not compile `guessing_game`
|
||
|
|
||
|
To learn more, run the command again with --verbose.
|