rust/tests/ui/checked_unwrap/complex_conditionals.stderr

210 lines
7.3 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`.
--> $DIR/complex_conditionals.rs:8:9
2018-10-06 11:18:06 -05:00
|
LL | if x.is_ok() && y.is_err() {
| --------- the check is happening here
2018-12-27 09:57:55 -06:00
LL | x.unwrap(); // unnecessary
2018-10-06 11:18:06 -05:00
| ^^^^^^^^^^
|
2020-01-31 13:21:10 -06:00
note: the lint level is defined here
--> $DIR/complex_conditionals.rs:1:35
2018-10-06 11:18:06 -05:00
|
2018-12-27 09:57:55 -06:00
LL | #![deny(clippy::panicking_unwrap, clippy::unnecessary_unwrap)]
2018-10-06 11:18:06 -05:00
| ^^^^^^^^^^^^^^^^^^^^^^^^^^
error: This call to `unwrap_err()` will always panic.
--> $DIR/complex_conditionals.rs:9:9
|
LL | if x.is_ok() && y.is_err() {
| --------- because of this check
2018-12-27 09:57:55 -06:00
LL | x.unwrap(); // unnecessary
LL | x.unwrap_err(); // will panic
| ^^^^^^^^^^^^^^
|
2020-01-31 13:21:10 -06:00
note: the lint level is defined here
--> $DIR/complex_conditionals.rs:1:9
|
LL | #![deny(clippy::panicking_unwrap, clippy::unnecessary_unwrap)]
| ^^^^^^^^^^^^^^^^^^^^^^^^
error: This call to `unwrap()` will always panic.
--> $DIR/complex_conditionals.rs:10:9
|
2018-12-27 09:57:55 -06:00
LL | if x.is_ok() && y.is_err() {
| ---------- because of this check
...
2018-12-27 09:57:55 -06:00
LL | 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`.
--> $DIR/complex_conditionals.rs:11:9
|
2018-12-27 09:57:55 -06:00
LL | if x.is_ok() && y.is_err() {
2018-06-07 22:55:11 -05:00
| ---------- the check is happening here
...
2018-12-27 09:57:55 -06:00
LL | y.unwrap_err(); // unnecessary
| ^^^^^^^^^^^^^^
error: This call to `unwrap()` will always panic.
--> $DIR/complex_conditionals.rs:25:9
|
2018-12-27 09:57:55 -06:00
LL | if x.is_ok() || y.is_ok() {
| --------- because of this check
...
2018-12-27 09:57:55 -06:00
LL | 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`.
--> $DIR/complex_conditionals.rs:26:9
|
2018-12-27 09:57:55 -06:00
LL | if x.is_ok() || y.is_ok() {
2018-06-07 22:55:11 -05:00
| --------- the check is happening here
...
2018-12-27 09:57:55 -06:00
LL | x.unwrap_err(); // unnecessary
| ^^^^^^^^^^^^^^
error: This call to `unwrap()` will always panic.
--> $DIR/complex_conditionals.rs:27:9
|
2018-12-27 09:57:55 -06:00
LL | if x.is_ok() || y.is_ok() {
| --------- because of this check
...
2018-12-27 09:57:55 -06:00
LL | 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`.
--> $DIR/complex_conditionals.rs:28:9
|
2018-12-27 09:57:55 -06:00
LL | if x.is_ok() || y.is_ok() {
2018-06-07 22:55:11 -05:00
| --------- the check is happening here
...
2018-12-27 09:57:55 -06:00
LL | 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`.
--> $DIR/complex_conditionals.rs:32:9
|
2018-12-27 09:57:55 -06:00
LL | 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-27 09:57:55 -06:00
LL | x.unwrap(); // unnecessary
| ^^^^^^^^^^
error: This call to `unwrap_err()` will always panic.
--> $DIR/complex_conditionals.rs:33:9
|
2018-12-27 09:57:55 -06:00
LL | if x.is_ok() && !(y.is_ok() || z.is_err()) {
| --------- because of this check
2018-12-27 09:57:55 -06:00
LL | x.unwrap(); // unnecessary
LL | x.unwrap_err(); // will panic
| ^^^^^^^^^^^^^^
error: This call to `unwrap()` will always panic.
--> $DIR/complex_conditionals.rs:34:9
|
2018-12-27 09:57:55 -06:00
LL | if x.is_ok() && !(y.is_ok() || z.is_err()) {
| --------- because of this check
...
2018-12-27 09:57:55 -06:00
LL | 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`.
--> $DIR/complex_conditionals.rs:35:9
|
2018-12-27 09:57:55 -06:00
LL | 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-27 09:57:55 -06:00
LL | 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`.
--> $DIR/complex_conditionals.rs:36:9
|
2018-12-27 09:57:55 -06:00
LL | 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-27 09:57:55 -06:00
LL | z.unwrap(); // unnecessary
| ^^^^^^^^^^
error: This call to `unwrap_err()` will always panic.
--> $DIR/complex_conditionals.rs:37:9
|
2018-12-27 09:57:55 -06:00
LL | if x.is_ok() && !(y.is_ok() || z.is_err()) {
| ---------- because of this check
...
2018-12-27 09:57:55 -06:00
LL | z.unwrap_err(); // will panic
| ^^^^^^^^^^^^^^
error: This call to `unwrap()` will always panic.
--> $DIR/complex_conditionals.rs:45:9
|
2018-12-27 09:57:55 -06:00
LL | if x.is_ok() || !(y.is_ok() && z.is_err()) {
| --------- because of this check
...
2018-12-27 09:57:55 -06:00
LL | 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`.
--> $DIR/complex_conditionals.rs:46:9
|
2018-12-27 09:57:55 -06:00
LL | 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-27 09:57:55 -06:00
LL | 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`.
--> $DIR/complex_conditionals.rs:47:9
|
2018-12-27 09:57:55 -06:00
LL | 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-27 09:57:55 -06:00
LL | y.unwrap(); // unnecessary
| ^^^^^^^^^^
error: This call to `unwrap_err()` will always panic.
--> $DIR/complex_conditionals.rs:48:9
|
2018-12-27 09:57:55 -06:00
LL | if x.is_ok() || !(y.is_ok() && z.is_err()) {
| --------- because of this check
...
2018-12-27 09:57:55 -06:00
LL | y.unwrap_err(); // will panic
| ^^^^^^^^^^^^^^
error: This call to `unwrap()` will always panic.
--> $DIR/complex_conditionals.rs:49:9
|
2018-12-27 09:57:55 -06:00
LL | if x.is_ok() || !(y.is_ok() && z.is_err()) {
| ---------- because of this check
...
2018-12-27 09:57:55 -06:00
LL | 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`.
--> $DIR/complex_conditionals.rs:50:9
2018-12-09 23:27:19 -06:00
|
2018-12-27 09:57:55 -06:00
LL | if x.is_ok() || !(y.is_ok() && z.is_err()) {
2018-12-09 23:27:19 -06:00
| ---------- the check is happening here
2018-06-07 22:55:11 -05:00
...
2018-12-27 09:57:55 -06:00
LL | z.unwrap_err(); // unnecessary
2018-12-09 23:27:19 -06:00
| ^^^^^^^^^^^^^^
error: You checked before that `unwrap()` cannot fail. Instead of checking and unwrapping, it's better to use `if let` or `match`.
--> $DIR/complex_conditionals.rs:58:13
2018-12-27 09:57:55 -06:00
|
LL | if x.is_some() {
| ----------- the check is happening here
LL | x.unwrap(); // unnecessary
| ^^^^^^^^^^
error: This call to `unwrap()` will always panic.
--> $DIR/complex_conditionals.rs:60:13
2018-12-27 09:57:55 -06:00
|
LL | if x.is_some() {
| ----------- because of this check
...
2018-12-27 09:57:55 -06:00
LL | x.unwrap(); // will panic
| ^^^^^^^^^^
error: aborting due to 22 previous errors