rust/tests/ui/checked_unwrap.stderr

314 lines
10 KiB
Plaintext
Raw Normal View History

error: You checked before that `unwrap()` cannot fail. Instead of checking and unwrapping, it's better to use `if let` or `match`.
2018-12-09 23:27:19 -06:00
--> $DIR/checked_unwrap.rs:16:9
2018-10-06 11:18:06 -05:00
|
2018-12-09 23:27:19 -06:00
15 | if x.is_some() {
2018-10-06 11:18:06 -05:00
| ----------- the check is happening here
2018-12-09 23:27:19 -06:00
16 | x.unwrap(); // unnecessary
2018-10-06 11:18:06 -05:00
| ^^^^^^^^^^
|
2018-06-07 22:55:11 -05:00
note: lint level defined here
2018-12-09 23:27:19 -06:00
--> $DIR/checked_unwrap.rs:10:35
2018-10-06 11:18:06 -05:00
|
2018-12-09 23:27:19 -06:00
10 | #![deny(clippy::panicking_unwrap, clippy::unnecessary_unwrap)]
2018-10-06 11:18:06 -05:00
| ^^^^^^^^^^^^^^^^^^^^^^^^^^
error: This call to `unwrap()` will always panic.
2018-12-09 23:27:19 -06:00
--> $DIR/checked_unwrap.rs:18:9
|
2018-12-09 23:27:19 -06:00
15 | if x.is_some() {
| ----------- because of this check
...
2018-12-09 23:27:19 -06:00
18 | x.unwrap(); // will panic
| ^^^^^^^^^^
|
2018-06-08 13:38:39 -05:00
note: lint level defined here
2018-12-09 23:27:19 -06:00
--> $DIR/checked_unwrap.rs:10:9
|
2018-12-09 23:27:19 -06:00
10 | #![deny(clippy::panicking_unwrap, clippy::unnecessary_unwrap)]
| ^^^^^^^^^^^^^^^^^^^^^^^^
error: This call to `unwrap()` will always panic.
2018-12-09 23:27:19 -06:00
--> $DIR/checked_unwrap.rs:21:9
|
2018-12-09 23:27:19 -06:00
20 | if x.is_none() {
| ----------- because of this check
2018-12-09 23:27:19 -06:00
21 | x.unwrap(); // will panic
| ^^^^^^^^^^
error: You checked before that `unwrap()` cannot fail. Instead of checking and unwrapping, it's better to use `if let` or `match`.
2018-12-09 23:27:19 -06:00
--> $DIR/checked_unwrap.rs:23:9
2018-06-07 22:55:11 -05:00
|
2018-12-09 23:27:19 -06:00
20 | if x.is_none() {
2018-06-07 22:55:11 -05:00
| ----------- the check is happening here
...
2018-12-09 23:27:19 -06:00
23 | x.unwrap(); // unnecessary
2018-06-07 22:55:11 -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-12-09 23:27:19 -06:00
--> $DIR/checked_unwrap.rs:27:9
|
2018-12-09 23:27:19 -06:00
26 | if x.is_ok() {
2018-06-07 22:55:11 -05:00
| --------- the check is happening here
2018-12-09 23:27:19 -06:00
27 | x.unwrap(); // unnecessary
| ^^^^^^^^^^
error: This call to `unwrap_err()` will always panic.
2018-12-09 23:27:19 -06:00
--> $DIR/checked_unwrap.rs:28:9
|
2018-12-09 23:27:19 -06:00
26 | if x.is_ok() {
| --------- because of this check
2018-12-09 23:27:19 -06:00
27 | x.unwrap(); // unnecessary
28 | x.unwrap_err(); // will panic
| ^^^^^^^^^^^^^^
error: This call to `unwrap()` will always panic.
2018-12-09 23:27:19 -06:00
--> $DIR/checked_unwrap.rs:30:9
|
2018-12-09 23:27:19 -06:00
26 | if x.is_ok() {
| --------- because of this check
...
2018-12-09 23:27:19 -06:00
30 | x.unwrap(); // will panic
| ^^^^^^^^^^
error: You checked before that `unwrap_err()` cannot fail. Instead of checking and unwrapping, it's better to use `if let` or `match`.
2018-12-09 23:27:19 -06:00
--> $DIR/checked_unwrap.rs:31:9
|
2018-12-09 23:27:19 -06:00
26 | if x.is_ok() {
2018-06-07 22:55:11 -05:00
| --------- the check is happening here
...
2018-12-09 23:27:19 -06:00
31 | x.unwrap_err(); // unnecessary
| ^^^^^^^^^^^^^^
error: This call to `unwrap()` will always panic.
2018-12-09 23:27:19 -06:00
--> $DIR/checked_unwrap.rs:34:9
|
2018-12-09 23:27:19 -06:00
33 | if x.is_err() {
| ---------- because of this check
2018-12-09 23:27:19 -06:00
34 | x.unwrap(); // will panic
| ^^^^^^^^^^
error: You checked before that `unwrap_err()` cannot fail. Instead of checking and unwrapping, it's better to use `if let` or `match`.
2018-12-09 23:27:19 -06:00
--> $DIR/checked_unwrap.rs:35:9
|
2018-12-09 23:27:19 -06:00
33 | if x.is_err() {
2018-06-07 22:55:11 -05:00
| ---------- the check is happening here
2018-12-09 23:27:19 -06:00
34 | x.unwrap(); // will panic
35 | x.unwrap_err(); // unnecessary
| ^^^^^^^^^^^^^^
error: You checked before that `unwrap()` cannot fail. Instead of checking and unwrapping, it's better to use `if let` or `match`.
2018-12-09 23:27:19 -06:00
--> $DIR/checked_unwrap.rs:37:9
|
2018-12-09 23:27:19 -06:00
33 | if x.is_err() {
2018-06-07 22:55:11 -05:00
| ---------- the check is happening here
...
2018-12-09 23:27:19 -06:00
37 | x.unwrap(); // unnecessary
| ^^^^^^^^^^
error: This call to `unwrap_err()` will always panic.
2018-12-09 23:27:19 -06:00
--> $DIR/checked_unwrap.rs:38:9
|
2018-12-09 23:27:19 -06:00
33 | if x.is_err() {
| ---------- because of this check
...
2018-12-09 23:27:19 -06:00
38 | x.unwrap_err(); // will panic
| ^^^^^^^^^^^^^^
error: You checked before that `unwrap()` cannot fail. Instead of checking and unwrapping, it's better to use `if let` or `match`.
2018-12-09 23:27:19 -06:00
--> $DIR/checked_unwrap.rs:55:9
|
2018-12-09 23:27:19 -06:00
54 | if x.is_ok() && y.is_err() {
2018-06-07 22:55:11 -05:00
| --------- the check is happening here
2018-12-09 23:27:19 -06:00
55 | x.unwrap(); // unnecessary
| ^^^^^^^^^^
error: This call to `unwrap_err()` will always panic.
2018-12-09 23:27:19 -06:00
--> $DIR/checked_unwrap.rs:56:9
|
2018-12-09 23:27:19 -06:00
54 | if x.is_ok() && y.is_err() {
| --------- because of this check
2018-12-09 23:27:19 -06:00
55 | x.unwrap(); // unnecessary
56 | x.unwrap_err(); // will panic
| ^^^^^^^^^^^^^^
error: This call to `unwrap()` will always panic.
2018-12-09 23:27:19 -06:00
--> $DIR/checked_unwrap.rs:57:9
|
2018-12-09 23:27:19 -06:00
54 | if x.is_ok() && y.is_err() {
| ---------- because of this check
...
2018-12-09 23:27:19 -06:00
57 | y.unwrap(); // will panic
| ^^^^^^^^^^
error: You checked before that `unwrap_err()` cannot fail. Instead of checking and unwrapping, it's better to use `if let` or `match`.
2018-12-09 23:27:19 -06:00
--> $DIR/checked_unwrap.rs:58:9
|
2018-12-09 23:27:19 -06:00
54 | if x.is_ok() && y.is_err() {
2018-06-07 22:55:11 -05:00
| ---------- the check is happening here
...
2018-12-09 23:27:19 -06:00
58 | y.unwrap_err(); // unnecessary
| ^^^^^^^^^^^^^^
error: This call to `unwrap()` will always panic.
2018-12-09 23:27:19 -06:00
--> $DIR/checked_unwrap.rs:72:9
|
2018-12-09 23:27:19 -06:00
67 | if x.is_ok() || y.is_ok() {
| --------- because of this check
...
2018-12-09 23:27:19 -06:00
72 | x.unwrap(); // will panic
| ^^^^^^^^^^
error: You checked before that `unwrap_err()` cannot fail. Instead of checking and unwrapping, it's better to use `if let` or `match`.
2018-12-09 23:27:19 -06:00
--> $DIR/checked_unwrap.rs:73:9
|
2018-12-09 23:27:19 -06:00
67 | if x.is_ok() || y.is_ok() {
2018-06-07 22:55:11 -05:00
| --------- the check is happening here
...
2018-12-09 23:27:19 -06:00
73 | x.unwrap_err(); // unnecessary
| ^^^^^^^^^^^^^^
error: This call to `unwrap()` will always panic.
2018-12-09 23:27:19 -06:00
--> $DIR/checked_unwrap.rs:74:9
|
2018-12-09 23:27:19 -06:00
67 | if x.is_ok() || y.is_ok() {
| --------- because of this check
...
2018-12-09 23:27:19 -06:00
74 | y.unwrap(); // will panic
| ^^^^^^^^^^
error: You checked before that `unwrap_err()` cannot fail. Instead of checking and unwrapping, it's better to use `if let` or `match`.
2018-12-09 23:27:19 -06:00
--> $DIR/checked_unwrap.rs:75:9
|
2018-12-09 23:27:19 -06:00
67 | if x.is_ok() || y.is_ok() {
2018-06-07 22:55:11 -05:00
| --------- the check is happening here
...
2018-12-09 23:27:19 -06:00
75 | y.unwrap_err(); // unnecessary
| ^^^^^^^^^^^^^^
error: You checked before that `unwrap()` cannot fail. Instead of checking and unwrapping, it's better to use `if let` or `match`.
2018-12-09 23:27:19 -06:00
--> $DIR/checked_unwrap.rs:79:9
|
2018-12-09 23:27:19 -06:00
78 | if x.is_ok() && !(y.is_ok() || z.is_err()) {
2018-06-07 22:55:11 -05:00
| --------- the check is happening here
2018-12-09 23:27:19 -06:00
79 | x.unwrap(); // unnecessary
| ^^^^^^^^^^
error: This call to `unwrap_err()` will always panic.
2018-12-09 23:27:19 -06:00
--> $DIR/checked_unwrap.rs:80:9
|
2018-12-09 23:27:19 -06:00
78 | if x.is_ok() && !(y.is_ok() || z.is_err()) {
| --------- because of this check
2018-12-09 23:27:19 -06:00
79 | x.unwrap(); // unnecessary
80 | x.unwrap_err(); // will panic
| ^^^^^^^^^^^^^^
error: This call to `unwrap()` will always panic.
2018-12-09 23:27:19 -06:00
--> $DIR/checked_unwrap.rs:81:9
|
2018-12-09 23:27:19 -06:00
78 | if x.is_ok() && !(y.is_ok() || z.is_err()) {
| --------- because of this check
...
2018-12-09 23:27:19 -06:00
81 | y.unwrap(); // will panic
| ^^^^^^^^^^
error: You checked before that `unwrap_err()` cannot fail. Instead of checking and unwrapping, it's better to use `if let` or `match`.
2018-12-09 23:27:19 -06:00
--> $DIR/checked_unwrap.rs:82:9
|
2018-12-09 23:27:19 -06:00
78 | if x.is_ok() && !(y.is_ok() || z.is_err()) {
2018-06-07 22:55:11 -05:00
| --------- the check is happening here
...
2018-12-09 23:27:19 -06:00
82 | y.unwrap_err(); // unnecessary
| ^^^^^^^^^^^^^^
error: You checked before that `unwrap()` cannot fail. Instead of checking and unwrapping, it's better to use `if let` or `match`.
2018-12-09 23:27:19 -06:00
--> $DIR/checked_unwrap.rs:83:9
|
2018-12-09 23:27:19 -06:00
78 | if x.is_ok() && !(y.is_ok() || z.is_err()) {
2018-06-07 22:55:11 -05:00
| ---------- the check is happening here
...
2018-12-09 23:27:19 -06:00
83 | z.unwrap(); // unnecessary
| ^^^^^^^^^^
error: This call to `unwrap_err()` will always panic.
2018-12-09 23:27:19 -06:00
--> $DIR/checked_unwrap.rs:84:9
|
2018-12-09 23:27:19 -06:00
78 | if x.is_ok() && !(y.is_ok() || z.is_err()) {
| ---------- because of this check
...
2018-12-09 23:27:19 -06:00
84 | z.unwrap_err(); // will panic
| ^^^^^^^^^^^^^^
error: This call to `unwrap()` will always panic.
2018-12-09 23:27:19 -06:00
--> $DIR/checked_unwrap.rs:92:9
|
2018-12-09 23:27:19 -06:00
86 | if x.is_ok() || !(y.is_ok() && z.is_err()) {
| --------- because of this check
...
2018-12-09 23:27:19 -06:00
92 | x.unwrap(); // will panic
| ^^^^^^^^^^
error: You checked before that `unwrap_err()` cannot fail. Instead of checking and unwrapping, it's better to use `if let` or `match`.
2018-12-09 23:27:19 -06:00
--> $DIR/checked_unwrap.rs:93:9
|
2018-12-09 23:27:19 -06:00
86 | if x.is_ok() || !(y.is_ok() && z.is_err()) {
2018-06-07 22:55:11 -05:00
| --------- the check is happening here
...
2018-12-09 23:27:19 -06:00
93 | x.unwrap_err(); // unnecessary
| ^^^^^^^^^^^^^^
error: You checked before that `unwrap()` cannot fail. Instead of checking and unwrapping, it's better to use `if let` or `match`.
2018-12-09 23:27:19 -06:00
--> $DIR/checked_unwrap.rs:94:9
|
2018-12-09 23:27:19 -06:00
86 | if x.is_ok() || !(y.is_ok() && z.is_err()) {
2018-06-07 22:55:11 -05:00
| --------- the check is happening here
...
2018-12-09 23:27:19 -06:00
94 | y.unwrap(); // unnecessary
| ^^^^^^^^^^
error: This call to `unwrap_err()` will always panic.
2018-12-09 23:27:19 -06:00
--> $DIR/checked_unwrap.rs:95:9
|
2018-12-09 23:27:19 -06:00
86 | if x.is_ok() || !(y.is_ok() && z.is_err()) {
| --------- because of this check
...
2018-12-09 23:27:19 -06:00
95 | y.unwrap_err(); // will panic
| ^^^^^^^^^^^^^^
error: This call to `unwrap()` will always panic.
2018-12-09 23:27:19 -06:00
--> $DIR/checked_unwrap.rs:96:9
|
2018-12-09 23:27:19 -06:00
86 | if x.is_ok() || !(y.is_ok() && z.is_err()) {
| ---------- because of this check
...
2018-12-09 23:27:19 -06:00
96 | z.unwrap(); // will panic
| ^^^^^^^^^^
error: You checked before that `unwrap_err()` cannot fail. Instead of checking and unwrapping, it's better to use `if let` or `match`.
2018-12-09 23:27:19 -06:00
--> $DIR/checked_unwrap.rs:97:9
|
86 | if x.is_ok() || !(y.is_ok() && z.is_err()) {
| ---------- the check is happening here
2018-06-07 22:55:11 -05:00
...
2018-12-09 23:27:19 -06:00
97 | z.unwrap_err(); // unnecessary
| ^^^^^^^^^^^^^^
error: You checked before that `unwrap()` cannot fail. Instead of checking and unwrapping, it's better to use `if let` or `match`.
2018-12-09 23:27:19 -06:00
--> $DIR/checked_unwrap.rs:105:13
2018-10-06 11:18:06 -05:00
|
2018-12-09 23:27:19 -06:00
104 | if x.is_some() {
2018-10-06 11:18:06 -05:00
| ----------- the check is happening here
2018-12-09 23:27:19 -06:00
105 | x.unwrap(); // unnecessary
2018-10-06 11:18:06 -05:00
| ^^^^^^^^^^
error: This call to `unwrap()` will always panic.
2018-12-09 23:27:19 -06:00
--> $DIR/checked_unwrap.rs:107:13
|
2018-12-09 23:27:19 -06:00
104 | if x.is_some() {
| ----------- because of this check
...
2018-12-09 23:27:19 -06:00
107 | x.unwrap(); // will panic
| ^^^^^^^^^^
error: aborting due to 34 previous errors