rust/tests/ui/checked_unwrap/complex_conditionals.stderr

212 lines
6.5 KiB
Plaintext

error: called `unwrap` on `x` after checking its variant with `is_ok`
--> $DIR/complex_conditionals.rs:12:9
|
LL | if x.is_ok() && y.is_err() {
| --------- the check is happening here
LL | x.unwrap(); // unnecessary
| ^^^^^^^^^^
|
= help: try using `if let` or `match`
note: the lint level is defined here
--> $DIR/complex_conditionals.rs:1:35
|
LL | #![deny(clippy::panicking_unwrap, clippy::unnecessary_unwrap)]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^
error: this call to `unwrap_err()` will always panic
--> $DIR/complex_conditionals.rs:13:9
|
LL | if x.is_ok() && y.is_err() {
| --------- because of this check
LL | x.unwrap(); // unnecessary
LL | x.unwrap_err(); // will panic
| ^^^^^^^^^^^^^^
|
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:14:9
|
LL | if x.is_ok() && y.is_err() {
| ---------- because of this check
...
LL | y.unwrap(); // will panic
| ^^^^^^^^^^
error: called `unwrap_err` on `y` after checking its variant with `is_err`
--> $DIR/complex_conditionals.rs:15:9
|
LL | if x.is_ok() && y.is_err() {
| ---------- the check is happening here
...
LL | y.unwrap_err(); // unnecessary
| ^^^^^^^^^^^^^^
|
= help: try using `if let` or `match`
error: this call to `unwrap()` will always panic
--> $DIR/complex_conditionals.rs:29:9
|
LL | if x.is_ok() || y.is_ok() {
| --------- because of this check
...
LL | x.unwrap(); // will panic
| ^^^^^^^^^^
error: called `unwrap_err` on `x` after checking its variant with `is_ok`
--> $DIR/complex_conditionals.rs:30:9
|
LL | if x.is_ok() || y.is_ok() {
| --------- the check is happening here
...
LL | x.unwrap_err(); // unnecessary
| ^^^^^^^^^^^^^^
|
= help: try using `if let` or `match`
error: this call to `unwrap()` will always panic
--> $DIR/complex_conditionals.rs:31:9
|
LL | if x.is_ok() || y.is_ok() {
| --------- because of this check
...
LL | y.unwrap(); // will panic
| ^^^^^^^^^^
error: called `unwrap_err` on `y` after checking its variant with `is_ok`
--> $DIR/complex_conditionals.rs:32:9
|
LL | if x.is_ok() || y.is_ok() {
| --------- the check is happening here
...
LL | y.unwrap_err(); // unnecessary
| ^^^^^^^^^^^^^^
|
= help: try using `if let` or `match`
error: called `unwrap` on `x` after checking its variant with `is_ok`
--> $DIR/complex_conditionals.rs:36:9
|
LL | if x.is_ok() && !(y.is_ok() || z.is_err()) {
| --------- the check is happening here
LL | x.unwrap(); // unnecessary
| ^^^^^^^^^^
|
= help: try using `if let` or `match`
error: this call to `unwrap_err()` will always panic
--> $DIR/complex_conditionals.rs:37:9
|
LL | if x.is_ok() && !(y.is_ok() || z.is_err()) {
| --------- because of this check
LL | x.unwrap(); // unnecessary
LL | x.unwrap_err(); // will panic
| ^^^^^^^^^^^^^^
error: this call to `unwrap()` will always panic
--> $DIR/complex_conditionals.rs:38:9
|
LL | if x.is_ok() && !(y.is_ok() || z.is_err()) {
| --------- because of this check
...
LL | y.unwrap(); // will panic
| ^^^^^^^^^^
error: called `unwrap_err` on `y` after checking its variant with `is_ok`
--> $DIR/complex_conditionals.rs:39:9
|
LL | if x.is_ok() && !(y.is_ok() || z.is_err()) {
| --------- the check is happening here
...
LL | y.unwrap_err(); // unnecessary
| ^^^^^^^^^^^^^^
|
= help: try using `if let` or `match`
error: called `unwrap` on `z` after checking its variant with `is_err`
--> $DIR/complex_conditionals.rs:40:9
|
LL | if x.is_ok() && !(y.is_ok() || z.is_err()) {
| ---------- the check is happening here
...
LL | z.unwrap(); // unnecessary
| ^^^^^^^^^^
|
= help: try using `if let` or `match`
error: this call to `unwrap_err()` will always panic
--> $DIR/complex_conditionals.rs:41:9
|
LL | if x.is_ok() && !(y.is_ok() || z.is_err()) {
| ---------- because of this check
...
LL | z.unwrap_err(); // will panic
| ^^^^^^^^^^^^^^
error: this call to `unwrap()` will always panic
--> $DIR/complex_conditionals.rs:49:9
|
LL | if x.is_ok() || !(y.is_ok() && z.is_err()) {
| --------- because of this check
...
LL | x.unwrap(); // will panic
| ^^^^^^^^^^
error: called `unwrap_err` on `x` after checking its variant with `is_ok`
--> $DIR/complex_conditionals.rs:50:9
|
LL | if x.is_ok() || !(y.is_ok() && z.is_err()) {
| --------- the check is happening here
...
LL | x.unwrap_err(); // unnecessary
| ^^^^^^^^^^^^^^
|
= help: try using `if let` or `match`
error: called `unwrap` on `y` after checking its variant with `is_ok`
--> $DIR/complex_conditionals.rs:51:9
|
LL | if x.is_ok() || !(y.is_ok() && z.is_err()) {
| --------- the check is happening here
...
LL | y.unwrap(); // unnecessary
| ^^^^^^^^^^
|
= help: try using `if let` or `match`
error: this call to `unwrap_err()` will always panic
--> $DIR/complex_conditionals.rs:52:9
|
LL | if x.is_ok() || !(y.is_ok() && z.is_err()) {
| --------- because of this check
...
LL | y.unwrap_err(); // will panic
| ^^^^^^^^^^^^^^
error: this call to `unwrap()` will always panic
--> $DIR/complex_conditionals.rs:53:9
|
LL | if x.is_ok() || !(y.is_ok() && z.is_err()) {
| ---------- because of this check
...
LL | z.unwrap(); // will panic
| ^^^^^^^^^^
error: called `unwrap_err` on `z` after checking its variant with `is_err`
--> $DIR/complex_conditionals.rs:54:9
|
LL | if x.is_ok() || !(y.is_ok() && z.is_err()) {
| ---------- the check is happening here
...
LL | z.unwrap_err(); // unnecessary
| ^^^^^^^^^^^^^^
|
= help: try using `if let` or `match`
error: aborting due to 20 previous errors