mirror of https://github.com/KaiserY/trpl-zh-cn
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
32 lines
1.3 KiB
32 lines
1.3 KiB
3 years ago
|
$ 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<()>>`
|
||
2 years ago
|
|
|
||
|
note: the method `join` exists on the type `JoinHandle<()>`
|
||
2 months ago
|
--> /rustc/eeb90cda1969383f56a2637cbd3037bdf598841c/library/std/src/thread/mod.rs:1778:5
|
||
2 years ago
|
help: consider using `Option::expect` to unwrap the `JoinHandle<()>` value, panicking if the value is an `Option::None`
|
||
|
|
|
||
|
52 | worker.thread.expect("REASON").join().unwrap();
|
||
|
| +++++++++++++++++
|
||
3 years ago
|
|
||
|
error[E0308]: mismatched types
|
||
|
--> src/lib.rs:72:22
|
||
|
|
|
||
|
72 | Worker { id, thread }
|
||
7 months ago
|
| ^^^^^^ expected `Option<JoinHandle<()>>`, found `JoinHandle<_>`
|
||
3 years ago
|
|
|
||
|
= note: expected enum `Option<JoinHandle<()>>`
|
||
|
found struct `JoinHandle<_>`
|
||
|
help: try wrapping the expression in `Some`
|
||
|
|
|
||
2 years ago
|
72 | Worker { id, thread: Some(thread) }
|
||
|
| +++++++++++++ +
|
||
3 years ago
|
|
||
|
Some errors have detailed explanations: E0308, E0599.
|
||
|
For more information about an error, try `rustc --explain E0308`.
|
||
7 months ago
|
error: could not compile `hello` (lib) due to 2 previous errors
|