-
Notifications
You must be signed in to change notification settings - Fork 3.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
8eec261
commit b8a8ef2
Showing
14 changed files
with
98 additions
and
106 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
31 changes: 14 additions & 17 deletions
31
listings/ch06-enums-and-pattern-matching/no-listing-10-non-exhaustive-match/output.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,25 +1,22 @@ | ||
$ cargo run | ||
Compiling enums v0.1.0 (file:///projects/enums) | ||
error[E0004]: non-exhaustive patterns: `None` not covered | ||
--> src/main.rs:3:15 | ||
| | ||
3 | match x { | ||
| ^ pattern `None` not covered | ||
| | ||
--> src/main.rs:3:15 | ||
| | ||
3 | match x { | ||
| ^ pattern `None` not covered | ||
| | ||
note: `Option<i32>` defined here | ||
--> /Users/carolnichols/.rustup/toolchains/1.71-aarch64-apple-darwin/lib/rustlib/src/rust/library/core/src/option.rs:567:5 | ||
| | ||
563 | pub enum Option<T> { | ||
| ------------------ | ||
... | ||
567 | None, | ||
| ^^^^ not covered | ||
= note: the matched value is of type `Option<i32>` | ||
--> /rustc/d5c2e9c342b358556da91d61ed4133f6f50fc0c3/library/core/src/option.rs:563:1 | ||
::: /rustc/d5c2e9c342b358556da91d61ed4133f6f50fc0c3/library/core/src/option.rs:567:5 | ||
| | ||
= note: not covered | ||
= note: the matched value is of type `Option<i32>` | ||
help: ensure that all possible cases are being handled by adding a match arm with a wildcard pattern or an explicit pattern as shown | ||
| | ||
4 ~ Some(i) => Some(i + 1), | ||
5 ~ None => todo!(), | ||
| | ||
| | ||
4 ~ Some(i) => Some(i + 1), | ||
5 ~ None => todo!(), | ||
| | ||
|
||
For more information about this error, try `rustc --explain E0004`. | ||
error: could not compile `enums` (bin "enums") due to previous error |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
11 changes: 6 additions & 5 deletions
11
listings/ch16-fearless-concurrency/listing-16-13/output.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,16 @@ | ||
$ cargo run | ||
Compiling shared-state v0.1.0 (file:///projects/shared-state) | ||
error[E0382]: use of moved value: `counter` | ||
--> src/main.rs:9:36 | ||
error[E0382]: borrow of moved value: `counter` | ||
--> src/main.rs:21:29 | ||
| | ||
5 | let counter = Mutex::new(0); | ||
| ------- move occurs because `counter` has type `Mutex<i32>`, which does not implement the `Copy` trait | ||
... | ||
9 | let handle = thread::spawn(move || { | ||
| ^^^^^^^ value moved into closure here, in previous iteration of loop | ||
10 | let mut num = counter.lock().unwrap(); | ||
| ------- use occurs due to use in closure | ||
| ------- value moved into closure here, in previous iteration of loop | ||
... | ||
21 | println!("Result: {}", *counter.lock().unwrap()); | ||
| ^^^^^^^^^^^^^^ value borrowed here after move | ||
|
||
For more information about this error, try `rustc --explain E0382`. | ||
error: could not compile `shared-state` (bin "shared-state") due to previous error |
46 changes: 20 additions & 26 deletions
46
listings/ch16-fearless-concurrency/listing-16-14/output.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,34 +1,28 @@ | ||
$ cargo run | ||
Compiling shared-state v0.1.0 (file:///projects/shared-state) | ||
error[E0277]: `Rc<Mutex<i32>>` cannot be sent between threads safely | ||
--> src/main.rs:11:36 | ||
| | ||
11 | let handle = thread::spawn(move || { | ||
| ------------- ^------ | ||
| | | | ||
| ______________________|_____________within this `[closure@src/main.rs:11:36: 11:43]` | ||
| | | | ||
| | required by a bound introduced by this call | ||
12 | | let mut num = counter.lock().unwrap(); | ||
13 | | | ||
14 | | *num += 1; | ||
15 | | }); | ||
| |_________^ `Rc<Mutex<i32>>` cannot be sent between threads safely | ||
| | ||
= help: within `[closure@src/main.rs:11:36: 11:43]`, the trait `Send` is not implemented for `Rc<Mutex<i32>>` | ||
--> src/main.rs:11:36 | ||
| | ||
11 | let handle = thread::spawn(move || { | ||
| ------------- ^------ | ||
| | | | ||
| ______________________|_____________within this `[closure@src/main.rs:11:36: 11:43]` | ||
| | | | ||
| | required by a bound introduced by this call | ||
12 | | let mut num = counter.lock().unwrap(); | ||
13 | | | ||
14 | | *num += 1; | ||
15 | | }); | ||
| |_________^ `Rc<Mutex<i32>>` cannot be sent between threads safely | ||
| | ||
= help: within `[closure@src/main.rs:11:36: 11:43]`, the trait `Send` is not implemented for `Rc<Mutex<i32>>` | ||
note: required because it's used within this closure | ||
--> src/main.rs:11:36 | ||
| | ||
11 | let handle = thread::spawn(move || { | ||
| ^^^^^^^ | ||
--> src/main.rs:11:36 | ||
| | ||
11 | let handle = thread::spawn(move || { | ||
| ^^^^^^^ | ||
note: required by a bound in `spawn` | ||
--> /Users/carolnichols/.rustup/toolchains/1.71-aarch64-apple-darwin/lib/rustlib/src/rust/library/std/src/thread/mod.rs:683:8 | ||
| | ||
680 | pub fn spawn<F, T>(f: F) -> JoinHandle<T> | ||
| ----- required by a bound in this function | ||
... | ||
683 | F: Send + 'static, | ||
| ^^^^ required by this bound in `spawn` | ||
--> /rustc/d5c2e9c342b358556da91d61ed4133f6f50fc0c3/library/std/src/thread/mod.rs:680:1 | ||
|
||
For more information about this error, try `rustc --explain E0277`. | ||
error: could not compile `shared-state` (bin "shared-state") due to previous error |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,15 @@ | ||
$ cargo check | ||
Checking hello v0.1.0 (file:///projects/hello) | ||
error[E0507]: cannot move out of `worker.thread` which is behind a mutable reference | ||
--> src/lib.rs:52:13 | ||
| | ||
52 | worker.thread.join().unwrap(); | ||
| ^^^^^^^^^^^^^ ------ `worker.thread` moved due to this method call | ||
| | | ||
| move occurs because `worker.thread` has type `JoinHandle<()>`, which does not implement the `Copy` trait | ||
| | ||
--> src/lib.rs:52:13 | ||
| | ||
52 | worker.thread.join().unwrap(); | ||
| ^^^^^^^^^^^^^ ------ `worker.thread` moved due to this method call | ||
| | | ||
| move occurs because `worker.thread` has type `JoinHandle<()>`, which does not implement the `Copy` trait | ||
| | ||
note: `JoinHandle::<T>::join` takes ownership of the receiver `self`, which moves `worker.thread` | ||
--> /Users/carolnichols/.rustup/toolchains/1.71-aarch64-apple-darwin/lib/rustlib/src/rust/library/std/src/thread/mod.rs:1560:17 | ||
| | ||
1560 | pub fn join(self) -> Result<T> { | ||
| ^^^^ | ||
--> /rustc/d5c2e9c342b358556da91d61ed4133f6f50fc0c3/library/std/src/thread/mod.rs:1570:17 | ||
|
||
For more information about this error, try `rustc --explain E0507`. | ||
error: could not compile `hello` (lib) due to previous error |
21 changes: 9 additions & 12 deletions
21
listings/ch20-web-server/no-listing-04-update-worker-definition/output.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
1.71 | ||
1.72 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters