2018-05-27 17:02:38 -05:00
|
|
|
error: You checked before that `unwrap()` cannot fail. Instead of checking and unwrapping, it's better to use `if let` or `match`.
|
2018-06-08 11:12:01 -05:00
|
|
|
--> $DIR/checked_unwrap.rs:7:9
|
2018-05-27 17:02:38 -05:00
|
|
|
|
|
2018-06-08 11:12:01 -05:00
|
|
|
6 | if x.is_some() {
|
2018-06-07 22:55:11 -05:00
|
|
|
| ----------- the check is happening here
|
2018-06-08 11:12:01 -05:00
|
|
|
7 | x.unwrap(); // unnecessary
|
2018-05-27 17:02:38 -05:00
|
|
|
| ^^^^^^^^^^
|
|
|
|
|
|
2018-06-07 22:55:11 -05:00
|
|
|
note: lint level defined here
|
2018-06-08 13:38:39 -05:00
|
|
|
--> $DIR/checked_unwrap.rs:1:27
|
2018-05-27 17:02:38 -05:00
|
|
|
|
|
2018-06-08 13:38:39 -05:00
|
|
|
1 | #![deny(panicking_unwrap, unnecessary_unwrap)]
|
|
|
|
| ^^^^^^^^^^^^^^^^^^
|
2018-05-27 17:02:38 -05:00
|
|
|
|
2018-06-08 11:12:01 -05:00
|
|
|
error: This call to `unwrap()` will always panic.
|
|
|
|
--> $DIR/checked_unwrap.rs:9:9
|
|
|
|
|
|
|
|
|
6 | if x.is_some() {
|
|
|
|
| ----------- because of this check
|
|
|
|
...
|
|
|
|
9 | x.unwrap(); // will panic
|
|
|
|
| ^^^^^^^^^^
|
2018-06-08 13:38:39 -05:00
|
|
|
|
|
|
|
|
note: lint level defined here
|
|
|
|
--> $DIR/checked_unwrap.rs:1:9
|
|
|
|
|
|
|
|
|
1 | #![deny(panicking_unwrap, unnecessary_unwrap)]
|
|
|
|
| ^^^^^^^^^^^^^^^^
|
2018-06-08 11:12:01 -05:00
|
|
|
|
|
|
|
error: This call to `unwrap()` will always panic.
|
|
|
|
--> $DIR/checked_unwrap.rs:12:9
|
|
|
|
|
|
|
|
|
11 | if x.is_none() {
|
|
|
|
| ----------- because of this check
|
|
|
|
12 | x.unwrap(); // will panic
|
|
|
|
| ^^^^^^^^^^
|
|
|
|
|
2018-05-27 17:02:38 -05:00
|
|
|
error: You checked before that `unwrap()` cannot fail. Instead of checking and unwrapping, it's better to use `if let` or `match`.
|
2018-06-08 11:12:01 -05:00
|
|
|
--> $DIR/checked_unwrap.rs:14:9
|
2018-06-07 22:55:11 -05:00
|
|
|
|
|
2018-06-08 11:12:01 -05:00
|
|
|
11 | if x.is_none() {
|
2018-06-07 22:55:11 -05:00
|
|
|
| ----------- the check is happening here
|
|
|
|
...
|
2018-06-08 11:12:01 -05:00
|
|
|
14 | x.unwrap(); // unnecessary
|
2018-06-07 22:55:11 -05:00
|
|
|
| ^^^^^^^^^^
|
2018-05-27 17:02:38 -05:00
|
|
|
|
|
|
|
error: You checked before that `unwrap()` cannot fail. Instead of checking and unwrapping, it's better to use `if let` or `match`.
|
2018-06-08 11:12:01 -05:00
|
|
|
--> $DIR/checked_unwrap.rs:18:9
|
2018-05-27 17:02:38 -05:00
|
|
|
|
|
2018-06-08 11:12:01 -05:00
|
|
|
17 | if x.is_ok() {
|
2018-06-07 22:55:11 -05:00
|
|
|
| --------- the check is happening here
|
2018-06-08 11:12:01 -05:00
|
|
|
18 | x.unwrap(); // unnecessary
|
|
|
|
| ^^^^^^^^^^
|
|
|
|
|
|
|
|
error: This call to `unwrap_err()` will always panic.
|
|
|
|
--> $DIR/checked_unwrap.rs:19:9
|
|
|
|
|
|
|
|
|
17 | if x.is_ok() {
|
|
|
|
| --------- because of this check
|
|
|
|
18 | x.unwrap(); // unnecessary
|
|
|
|
19 | x.unwrap_err(); // will panic
|
|
|
|
| ^^^^^^^^^^^^^^
|
|
|
|
|
|
|
|
error: This call to `unwrap()` will always panic.
|
|
|
|
--> $DIR/checked_unwrap.rs:21:9
|
|
|
|
|
|
|
|
|
17 | if x.is_ok() {
|
|
|
|
| --------- because of this check
|
|
|
|
...
|
|
|
|
21 | x.unwrap(); // will panic
|
2018-05-27 17:02:38 -05:00
|
|
|
| ^^^^^^^^^^
|
|
|
|
|
|
|
|
error: You checked before that `unwrap_err()` cannot fail. Instead of checking and unwrapping, it's better to use `if let` or `match`.
|
2018-06-08 11:12:01 -05:00
|
|
|
--> $DIR/checked_unwrap.rs:22:9
|
2018-05-27 17:02:38 -05:00
|
|
|
|
|
2018-06-08 11:12:01 -05:00
|
|
|
17 | if x.is_ok() {
|
2018-06-07 22:55:11 -05:00
|
|
|
| --------- the check is happening here
|
|
|
|
...
|
2018-06-08 11:12:01 -05:00
|
|
|
22 | x.unwrap_err(); // unnecessary
|
2018-05-27 17:02:38 -05:00
|
|
|
| ^^^^^^^^^^^^^^
|
|
|
|
|
2018-06-08 11:12:01 -05:00
|
|
|
error: This call to `unwrap()` will always panic.
|
|
|
|
--> $DIR/checked_unwrap.rs:25:9
|
|
|
|
|
|
|
|
|
24 | if x.is_err() {
|
|
|
|
| ---------- because of this check
|
|
|
|
25 | x.unwrap(); // will panic
|
|
|
|
| ^^^^^^^^^^
|
|
|
|
|
2018-05-27 17:02:38 -05:00
|
|
|
error: You checked before that `unwrap_err()` cannot fail. Instead of checking and unwrapping, it's better to use `if let` or `match`.
|
2018-06-08 11:12:01 -05:00
|
|
|
--> $DIR/checked_unwrap.rs:26:9
|
2018-05-27 17:02:38 -05:00
|
|
|
|
|
2018-06-08 11:12:01 -05:00
|
|
|
24 | if x.is_err() {
|
2018-06-07 22:55:11 -05:00
|
|
|
| ---------- the check is happening here
|
2018-06-08 11:12:01 -05:00
|
|
|
25 | x.unwrap(); // will panic
|
|
|
|
26 | x.unwrap_err(); // unnecessary
|
2018-05-27 17:02:38 -05:00
|
|
|
| ^^^^^^^^^^^^^^
|
|
|
|
|
|
|
|
error: You checked before that `unwrap()` cannot fail. Instead of checking and unwrapping, it's better to use `if let` or `match`.
|
2018-06-08 11:12:01 -05:00
|
|
|
--> $DIR/checked_unwrap.rs:28:9
|
2018-05-27 17:02:38 -05:00
|
|
|
|
|
2018-06-08 11:12:01 -05:00
|
|
|
24 | if x.is_err() {
|
2018-06-07 22:55:11 -05:00
|
|
|
| ---------- the check is happening here
|
|
|
|
...
|
2018-06-08 11:12:01 -05:00
|
|
|
28 | x.unwrap(); // unnecessary
|
2018-05-27 17:02:38 -05:00
|
|
|
| ^^^^^^^^^^
|
|
|
|
|
2018-06-08 11:12:01 -05:00
|
|
|
error: This call to `unwrap_err()` will always panic.
|
|
|
|
--> $DIR/checked_unwrap.rs:29:9
|
|
|
|
|
|
|
|
|
24 | if x.is_err() {
|
|
|
|
| ---------- because of this check
|
|
|
|
...
|
|
|
|
29 | x.unwrap_err(); // will panic
|
|
|
|
| ^^^^^^^^^^^^^^
|
|
|
|
|
2018-05-27 17:02:38 -05:00
|
|
|
error: You checked before that `unwrap()` cannot fail. Instead of checking and unwrapping, it's better to use `if let` or `match`.
|
2018-06-08 11:12:01 -05:00
|
|
|
--> $DIR/checked_unwrap.rs:46:9
|
2018-05-27 17:02:38 -05:00
|
|
|
|
|
2018-06-08 11:12:01 -05:00
|
|
|
45 | if x.is_ok() && y.is_err() {
|
2018-06-07 22:55:11 -05:00
|
|
|
| --------- the check is happening here
|
2018-06-08 11:12:01 -05:00
|
|
|
46 | x.unwrap(); // unnecessary
|
|
|
|
| ^^^^^^^^^^
|
|
|
|
|
|
|
|
error: This call to `unwrap_err()` will always panic.
|
|
|
|
--> $DIR/checked_unwrap.rs:47:9
|
|
|
|
|
|
|
|
|
45 | if x.is_ok() && y.is_err() {
|
|
|
|
| --------- because of this check
|
|
|
|
46 | x.unwrap(); // unnecessary
|
|
|
|
47 | x.unwrap_err(); // will panic
|
|
|
|
| ^^^^^^^^^^^^^^
|
|
|
|
|
|
|
|
error: This call to `unwrap()` will always panic.
|
|
|
|
--> $DIR/checked_unwrap.rs:48:9
|
|
|
|
|
|
|
|
|
45 | if x.is_ok() && y.is_err() {
|
|
|
|
| ---------- because of this check
|
|
|
|
...
|
|
|
|
48 | y.unwrap(); // will panic
|
2018-05-27 17:02:38 -05:00
|
|
|
| ^^^^^^^^^^
|
|
|
|
|
|
|
|
error: You checked before that `unwrap_err()` cannot fail. Instead of checking and unwrapping, it's better to use `if let` or `match`.
|
2018-06-08 11:12:01 -05:00
|
|
|
--> $DIR/checked_unwrap.rs:49:9
|
2018-05-27 17:02:38 -05:00
|
|
|
|
|
2018-06-08 11:12:01 -05:00
|
|
|
45 | if x.is_ok() && y.is_err() {
|
2018-06-07 22:55:11 -05:00
|
|
|
| ---------- the check is happening here
|
2018-06-08 11:12:01 -05:00
|
|
|
...
|
|
|
|
49 | y.unwrap_err(); // unnecessary
|
2018-05-27 17:02:38 -05:00
|
|
|
| ^^^^^^^^^^^^^^
|
|
|
|
|
2018-06-08 11:12:01 -05:00
|
|
|
error: This call to `unwrap()` will always panic.
|
|
|
|
--> $DIR/checked_unwrap.rs:63:9
|
|
|
|
|
|
|
|
|
58 | if x.is_ok() || y.is_ok() {
|
|
|
|
| --------- because of this check
|
|
|
|
...
|
|
|
|
63 | x.unwrap(); // will panic
|
|
|
|
| ^^^^^^^^^^
|
|
|
|
|
2018-05-27 17:02:38 -05:00
|
|
|
error: You checked before that `unwrap_err()` cannot fail. Instead of checking and unwrapping, it's better to use `if let` or `match`.
|
2018-06-08 11:12:01 -05:00
|
|
|
--> $DIR/checked_unwrap.rs:64:9
|
2018-05-27 17:02:38 -05:00
|
|
|
|
|
2018-06-08 11:12:01 -05:00
|
|
|
58 | if x.is_ok() || y.is_ok() {
|
2018-06-07 22:55:11 -05:00
|
|
|
| --------- the check is happening here
|
|
|
|
...
|
2018-06-08 11:12:01 -05:00
|
|
|
64 | x.unwrap_err(); // unnecessary
|
2018-05-27 17:02:38 -05:00
|
|
|
| ^^^^^^^^^^^^^^
|
|
|
|
|
2018-06-08 11:12:01 -05:00
|
|
|
error: This call to `unwrap()` will always panic.
|
|
|
|
--> $DIR/checked_unwrap.rs:65:9
|
|
|
|
|
|
|
|
|
58 | if x.is_ok() || y.is_ok() {
|
|
|
|
| --------- because of this check
|
|
|
|
...
|
|
|
|
65 | y.unwrap(); // will panic
|
|
|
|
| ^^^^^^^^^^
|
|
|
|
|
2018-05-27 17:02:38 -05:00
|
|
|
error: You checked before that `unwrap_err()` cannot fail. Instead of checking and unwrapping, it's better to use `if let` or `match`.
|
2018-06-08 11:12:01 -05:00
|
|
|
--> $DIR/checked_unwrap.rs:66:9
|
2018-05-27 17:02:38 -05:00
|
|
|
|
|
2018-06-08 11:12:01 -05:00
|
|
|
58 | if x.is_ok() || y.is_ok() {
|
2018-06-07 22:55:11 -05:00
|
|
|
| --------- the check is happening here
|
|
|
|
...
|
2018-06-08 11:12:01 -05:00
|
|
|
66 | y.unwrap_err(); // unnecessary
|
2018-05-27 17:02:38 -05:00
|
|
|
| ^^^^^^^^^^^^^^
|
|
|
|
|
|
|
|
error: You checked before that `unwrap()` cannot fail. Instead of checking and unwrapping, it's better to use `if let` or `match`.
|
2018-06-08 11:12:01 -05:00
|
|
|
--> $DIR/checked_unwrap.rs:70:9
|
2018-05-27 17:02:38 -05:00
|
|
|
|
|
2018-06-08 11:12:01 -05:00
|
|
|
69 | if x.is_ok() && !(y.is_ok() || z.is_err()) {
|
2018-06-07 22:55:11 -05:00
|
|
|
| --------- the check is happening here
|
2018-06-08 11:12:01 -05:00
|
|
|
70 | x.unwrap(); // unnecessary
|
|
|
|
| ^^^^^^^^^^
|
|
|
|
|
|
|
|
error: This call to `unwrap_err()` will always panic.
|
|
|
|
--> $DIR/checked_unwrap.rs:71:9
|
|
|
|
|
|
|
|
|
69 | if x.is_ok() && !(y.is_ok() || z.is_err()) {
|
|
|
|
| --------- because of this check
|
|
|
|
70 | x.unwrap(); // unnecessary
|
|
|
|
71 | x.unwrap_err(); // will panic
|
|
|
|
| ^^^^^^^^^^^^^^
|
|
|
|
|
|
|
|
error: This call to `unwrap()` will always panic.
|
|
|
|
--> $DIR/checked_unwrap.rs:72:9
|
|
|
|
|
|
|
|
|
69 | if x.is_ok() && !(y.is_ok() || z.is_err()) {
|
|
|
|
| --------- because of this check
|
|
|
|
...
|
|
|
|
72 | y.unwrap(); // will panic
|
2018-05-27 17:02:38 -05:00
|
|
|
| ^^^^^^^^^^
|
|
|
|
|
|
|
|
error: You checked before that `unwrap_err()` cannot fail. Instead of checking and unwrapping, it's better to use `if let` or `match`.
|
2018-06-08 11:12:01 -05:00
|
|
|
--> $DIR/checked_unwrap.rs:73:9
|
2018-05-27 17:02:38 -05:00
|
|
|
|
|
2018-06-08 11:12:01 -05:00
|
|
|
69 | if x.is_ok() && !(y.is_ok() || z.is_err()) {
|
2018-06-07 22:55:11 -05:00
|
|
|
| --------- the check is happening here
|
2018-06-08 11:12:01 -05:00
|
|
|
...
|
|
|
|
73 | y.unwrap_err(); // unnecessary
|
2018-05-27 17:02:38 -05:00
|
|
|
| ^^^^^^^^^^^^^^
|
|
|
|
|
|
|
|
error: You checked before that `unwrap()` cannot fail. Instead of checking and unwrapping, it's better to use `if let` or `match`.
|
2018-06-08 11:12:01 -05:00
|
|
|
--> $DIR/checked_unwrap.rs:74:9
|
2018-05-27 17:02:38 -05:00
|
|
|
|
|
2018-06-08 11:12:01 -05:00
|
|
|
69 | if x.is_ok() && !(y.is_ok() || z.is_err()) {
|
2018-06-07 22:55:11 -05:00
|
|
|
| ---------- the check is happening here
|
|
|
|
...
|
2018-06-08 11:12:01 -05:00
|
|
|
74 | z.unwrap(); // unnecessary
|
|
|
|
| ^^^^^^^^^^
|
|
|
|
|
|
|
|
error: This call to `unwrap_err()` will always panic.
|
|
|
|
--> $DIR/checked_unwrap.rs:75:9
|
|
|
|
|
|
|
|
|
69 | if x.is_ok() && !(y.is_ok() || z.is_err()) {
|
|
|
|
| ---------- because of this check
|
|
|
|
...
|
|
|
|
75 | z.unwrap_err(); // will panic
|
|
|
|
| ^^^^^^^^^^^^^^
|
|
|
|
|
|
|
|
error: This call to `unwrap()` will always panic.
|
|
|
|
--> $DIR/checked_unwrap.rs:83:9
|
|
|
|
|
|
|
|
|
77 | if x.is_ok() || !(y.is_ok() && z.is_err()) {
|
|
|
|
| --------- because of this check
|
|
|
|
...
|
|
|
|
83 | x.unwrap(); // will panic
|
2018-05-27 17:02:38 -05:00
|
|
|
| ^^^^^^^^^^
|
|
|
|
|
|
|
|
error: You checked before that `unwrap_err()` cannot fail. Instead of checking and unwrapping, it's better to use `if let` or `match`.
|
2018-06-08 11:12:01 -05:00
|
|
|
--> $DIR/checked_unwrap.rs:84:9
|
2018-05-27 17:02:38 -05:00
|
|
|
|
|
2018-06-08 11:12:01 -05:00
|
|
|
77 | if x.is_ok() || !(y.is_ok() && z.is_err()) {
|
2018-06-07 22:55:11 -05:00
|
|
|
| --------- the check is happening here
|
|
|
|
...
|
2018-06-08 11:12:01 -05:00
|
|
|
84 | x.unwrap_err(); // unnecessary
|
2018-05-27 17:02:38 -05:00
|
|
|
| ^^^^^^^^^^^^^^
|
|
|
|
|
|
|
|
error: You checked before that `unwrap()` cannot fail. Instead of checking and unwrapping, it's better to use `if let` or `match`.
|
2018-06-08 11:12:01 -05:00
|
|
|
--> $DIR/checked_unwrap.rs:85:9
|
2018-05-27 17:02:38 -05:00
|
|
|
|
|
2018-06-08 11:12:01 -05:00
|
|
|
77 | if x.is_ok() || !(y.is_ok() && z.is_err()) {
|
2018-06-07 22:55:11 -05:00
|
|
|
| --------- the check is happening here
|
|
|
|
...
|
2018-06-08 11:12:01 -05:00
|
|
|
85 | y.unwrap(); // unnecessary
|
|
|
|
| ^^^^^^^^^^
|
|
|
|
|
|
|
|
error: This call to `unwrap_err()` will always panic.
|
|
|
|
--> $DIR/checked_unwrap.rs:86:9
|
|
|
|
|
|
|
|
|
77 | if x.is_ok() || !(y.is_ok() && z.is_err()) {
|
|
|
|
| --------- because of this check
|
|
|
|
...
|
|
|
|
86 | y.unwrap_err(); // will panic
|
|
|
|
| ^^^^^^^^^^^^^^
|
|
|
|
|
|
|
|
error: This call to `unwrap()` will always panic.
|
|
|
|
--> $DIR/checked_unwrap.rs:87:9
|
|
|
|
|
|
|
|
|
77 | if x.is_ok() || !(y.is_ok() && z.is_err()) {
|
|
|
|
| ---------- because of this check
|
|
|
|
...
|
|
|
|
87 | z.unwrap(); // will panic
|
2018-05-27 17:02:38 -05:00
|
|
|
| ^^^^^^^^^^
|
|
|
|
|
|
|
|
error: You checked before that `unwrap_err()` cannot fail. Instead of checking and unwrapping, it's better to use `if let` or `match`.
|
2018-06-08 11:12:01 -05:00
|
|
|
--> $DIR/checked_unwrap.rs:88:9
|
2018-05-27 17:02:38 -05:00
|
|
|
|
|
2018-06-08 11:12:01 -05:00
|
|
|
77 | if x.is_ok() || !(y.is_ok() && z.is_err()) {
|
2018-06-07 22:55:11 -05:00
|
|
|
| ---------- the check is happening here
|
|
|
|
...
|
2018-06-08 11:12:01 -05:00
|
|
|
88 | z.unwrap_err(); // unnecessary
|
2018-05-27 17:02:38 -05:00
|
|
|
| ^^^^^^^^^^^^^^
|
|
|
|
|
|
|
|
error: You checked before that `unwrap()` cannot fail. Instead of checking and unwrapping, it's better to use `if let` or `match`.
|
2018-06-08 11:12:01 -05:00
|
|
|
--> $DIR/checked_unwrap.rs:96:13
|
2018-05-27 17:02:38 -05:00
|
|
|
|
|
2018-06-08 11:12:01 -05:00
|
|
|
95 | if x.is_some() {
|
2018-06-07 22:55:11 -05:00
|
|
|
| ----------- the check is happening here
|
2018-06-08 11:12:01 -05:00
|
|
|
96 | x.unwrap(); // unnecessary
|
|
|
|
| ^^^^^^^^^^
|
|
|
|
|
|
|
|
error: This call to `unwrap()` will always panic.
|
|
|
|
--> $DIR/checked_unwrap.rs:98:13
|
|
|
|
|
|
|
|
|
95 | if x.is_some() {
|
|
|
|
| ----------- because of this check
|
|
|
|
...
|
|
|
|
98 | x.unwrap(); // will panic
|
2018-05-27 17:02:38 -05:00
|
|
|
| ^^^^^^^^^^
|
|
|
|
|
2018-06-08 11:12:01 -05:00
|
|
|
error: aborting due to 34 previous errors
|
2018-05-27 17:02:38 -05:00
|
|
|
|