mirror of
https://github.com/KaiserY/trpl-zh-cn
synced 2024-11-15 13:31:20 +08:00
25 lines
886 B
Plaintext
Executable File
25 lines
886 B
Plaintext
Executable File
$ cargo check
|
|
Checking hello v0.1.0 (file:///projects/hello)
|
|
error[E0599]: no method named `join` found for enum `Option` in the current scope
|
|
--> src/lib.rs:52:27
|
|
|
|
|
52 | worker.thread.join().unwrap();
|
|
| ^^^^ method not found in `Option<JoinHandle<()>>`
|
|
|
|
error[E0308]: mismatched types
|
|
--> src/lib.rs:72:22
|
|
|
|
|
72 | Worker { id, thread }
|
|
| ^^^^^^ expected enum `Option`, found struct `JoinHandle`
|
|
|
|
|
= note: expected enum `Option<JoinHandle<()>>`
|
|
found struct `JoinHandle<_>`
|
|
help: try wrapping the expression in `Some`
|
|
|
|
|
72 | Worker { id, Some(thread) }
|
|
| +++++ +
|
|
|
|
Some errors have detailed explanations: E0308, E0599.
|
|
For more information about an error, try `rustc --explain E0308`.
|
|
error: could not compile `hello` due to 2 previous errors
|