2021-09-08 16:31:47 +02:00
|
|
|
error: called `unwrap` on `x` after checking its variant with `is_ok`
|
2024-02-27 15:25:18 +01:00
|
|
|
--> tests/ui/checked_unwrap/complex_conditionals.rs:13:9
|
2018-10-06 09:18:06 -07:00
|
|
|
|
|
2019-07-15 21:27:44 +02:00
|
|
|
LL | if x.is_ok() && y.is_err() {
|
|
|
|
| --------- the check is happening here
|
2023-08-24 21:32:12 +02:00
|
|
|
LL | // unnecessary
|
|
|
|
LL | x.unwrap();
|
2018-10-06 09:18:06 -07:00
|
|
|
| ^^^^^^^^^^
|
|
|
|
|
|
2022-09-22 20:04:22 +04:00
|
|
|
= help: try using `if let` or `match`
|
2020-01-31 20:21:10 +01:00
|
|
|
note: the lint level is defined here
|
2024-02-27 15:25:18 +01:00
|
|
|
--> tests/ui/checked_unwrap/complex_conditionals.rs:1:35
|
2018-10-06 09:18:06 -07:00
|
|
|
|
|
2018-12-27 16:57:55 +01:00
|
|
|
LL | #![deny(clippy::panicking_unwrap, clippy::unnecessary_unwrap)]
|
2018-10-06 09:18:06 -07:00
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^
|
2018-05-28 00:02:38 +02:00
|
|
|
|
2020-08-11 15:43:21 +02:00
|
|
|
error: this call to `unwrap_err()` will always panic
|
2024-02-27 15:25:18 +01:00
|
|
|
--> tests/ui/checked_unwrap/complex_conditionals.rs:16:9
|
2018-06-08 18:12:01 +02:00
|
|
|
|
|
2019-07-15 21:27:44 +02:00
|
|
|
LL | if x.is_ok() && y.is_err() {
|
2018-06-08 18:12:01 +02:00
|
|
|
| --------- because of this check
|
2023-08-24 21:32:12 +02:00
|
|
|
...
|
|
|
|
LL | x.unwrap_err();
|
2018-06-08 18:12:01 +02:00
|
|
|
| ^^^^^^^^^^^^^^
|
2018-05-28 00:02:38 +02:00
|
|
|
|
|
2020-01-31 20:21:10 +01:00
|
|
|
note: the lint level is defined here
|
2024-02-27 15:25:18 +01:00
|
|
|
--> tests/ui/checked_unwrap/complex_conditionals.rs:1:9
|
2018-06-08 18:12:01 +02:00
|
|
|
|
|
2019-07-15 21:27:44 +02:00
|
|
|
LL | #![deny(clippy::panicking_unwrap, clippy::unnecessary_unwrap)]
|
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^
|
2018-06-08 18:12:01 +02:00
|
|
|
|
2020-08-11 15:43:21 +02:00
|
|
|
error: this call to `unwrap()` will always panic
|
2024-02-27 15:25:18 +01:00
|
|
|
--> tests/ui/checked_unwrap/complex_conditionals.rs:19:9
|
2018-06-08 18:12:01 +02:00
|
|
|
|
|
2018-12-27 16:57:55 +01:00
|
|
|
LL | if x.is_ok() && y.is_err() {
|
2018-06-08 18:12:01 +02:00
|
|
|
| ---------- because of this check
|
|
|
|
...
|
2023-08-24 21:32:12 +02:00
|
|
|
LL | y.unwrap();
|
2018-05-28 00:02:38 +02:00
|
|
|
| ^^^^^^^^^^
|
|
|
|
|
2021-09-08 16:31:47 +02:00
|
|
|
error: called `unwrap_err` on `y` after checking its variant with `is_err`
|
2024-02-27 15:25:18 +01:00
|
|
|
--> tests/ui/checked_unwrap/complex_conditionals.rs:22:9
|
2018-05-28 00:02:38 +02:00
|
|
|
|
|
2018-12-27 16:57:55 +01:00
|
|
|
LL | if x.is_ok() && y.is_err() {
|
2018-06-08 05:55:11 +02:00
|
|
|
| ---------- the check is happening here
|
2018-06-08 18:12:01 +02:00
|
|
|
...
|
2023-08-24 21:32:12 +02:00
|
|
|
LL | y.unwrap_err();
|
2018-05-28 00:02:38 +02:00
|
|
|
| ^^^^^^^^^^^^^^
|
2021-09-08 16:31:47 +02:00
|
|
|
|
|
|
|
|
= help: try using `if let` or `match`
|
2018-05-28 00:02:38 +02:00
|
|
|
|
2020-08-11 15:43:21 +02:00
|
|
|
error: this call to `unwrap()` will always panic
|
2024-02-27 15:25:18 +01:00
|
|
|
--> tests/ui/checked_unwrap/complex_conditionals.rs:38:9
|
2018-06-08 18:12:01 +02:00
|
|
|
|
|
2018-12-27 16:57:55 +01:00
|
|
|
LL | if x.is_ok() || y.is_ok() {
|
2018-06-08 18:12:01 +02:00
|
|
|
| --------- because of this check
|
|
|
|
...
|
2023-08-24 21:32:12 +02:00
|
|
|
LL | x.unwrap();
|
2018-06-08 18:12:01 +02:00
|
|
|
| ^^^^^^^^^^
|
|
|
|
|
2021-09-08 16:31:47 +02:00
|
|
|
error: called `unwrap_err` on `x` after checking its variant with `is_ok`
|
2024-02-27 15:25:18 +01:00
|
|
|
--> tests/ui/checked_unwrap/complex_conditionals.rs:41:9
|
2018-05-28 00:02:38 +02:00
|
|
|
|
|
2018-12-27 16:57:55 +01:00
|
|
|
LL | if x.is_ok() || y.is_ok() {
|
2018-06-08 05:55:11 +02:00
|
|
|
| --------- the check is happening here
|
|
|
|
...
|
2023-08-24 21:32:12 +02:00
|
|
|
LL | x.unwrap_err();
|
2018-05-28 00:02:38 +02:00
|
|
|
| ^^^^^^^^^^^^^^
|
2021-09-08 16:31:47 +02:00
|
|
|
|
|
|
|
|
= help: try using `if let` or `match`
|
2018-05-28 00:02:38 +02:00
|
|
|
|
2020-08-11 15:43:21 +02:00
|
|
|
error: this call to `unwrap()` will always panic
|
2024-02-27 15:25:18 +01:00
|
|
|
--> tests/ui/checked_unwrap/complex_conditionals.rs:44:9
|
2018-06-08 18:12:01 +02:00
|
|
|
|
|
2018-12-27 16:57:55 +01:00
|
|
|
LL | if x.is_ok() || y.is_ok() {
|
2018-06-08 18:12:01 +02:00
|
|
|
| --------- because of this check
|
|
|
|
...
|
2023-08-24 21:32:12 +02:00
|
|
|
LL | y.unwrap();
|
2018-06-08 18:12:01 +02:00
|
|
|
| ^^^^^^^^^^
|
|
|
|
|
2021-09-08 16:31:47 +02:00
|
|
|
error: called `unwrap_err` on `y` after checking its variant with `is_ok`
|
2024-02-27 15:25:18 +01:00
|
|
|
--> tests/ui/checked_unwrap/complex_conditionals.rs:47:9
|
2018-05-28 00:02:38 +02:00
|
|
|
|
|
2018-12-27 16:57:55 +01:00
|
|
|
LL | if x.is_ok() || y.is_ok() {
|
2018-06-08 05:55:11 +02:00
|
|
|
| --------- the check is happening here
|
|
|
|
...
|
2023-08-24 21:32:12 +02:00
|
|
|
LL | y.unwrap_err();
|
2018-05-28 00:02:38 +02:00
|
|
|
| ^^^^^^^^^^^^^^
|
2021-09-08 16:31:47 +02:00
|
|
|
|
|
|
|
|
= help: try using `if let` or `match`
|
2018-05-28 00:02:38 +02:00
|
|
|
|
2021-09-08 16:31:47 +02:00
|
|
|
error: called `unwrap` on `x` after checking its variant with `is_ok`
|
2024-02-27 15:25:18 +01:00
|
|
|
--> tests/ui/checked_unwrap/complex_conditionals.rs:53:9
|
2018-05-28 00:02:38 +02:00
|
|
|
|
|
2018-12-27 16:57:55 +01:00
|
|
|
LL | if x.is_ok() && !(y.is_ok() || z.is_err()) {
|
2018-06-08 05:55:11 +02:00
|
|
|
| --------- the check is happening here
|
2023-08-24 21:32:12 +02:00
|
|
|
LL | // unnecessary
|
|
|
|
LL | x.unwrap();
|
2018-06-08 18:12:01 +02:00
|
|
|
| ^^^^^^^^^^
|
2021-09-08 16:31:47 +02:00
|
|
|
|
|
|
|
|
= help: try using `if let` or `match`
|
2018-06-08 18:12:01 +02:00
|
|
|
|
2020-08-11 15:43:21 +02:00
|
|
|
error: this call to `unwrap_err()` will always panic
|
2024-02-27 15:25:18 +01:00
|
|
|
--> tests/ui/checked_unwrap/complex_conditionals.rs:56:9
|
2018-06-08 18:12:01 +02:00
|
|
|
|
|
2018-12-27 16:57:55 +01:00
|
|
|
LL | if x.is_ok() && !(y.is_ok() || z.is_err()) {
|
2018-06-08 18:12:01 +02:00
|
|
|
| --------- because of this check
|
2023-08-24 21:32:12 +02:00
|
|
|
...
|
|
|
|
LL | x.unwrap_err();
|
2018-06-08 18:12:01 +02:00
|
|
|
| ^^^^^^^^^^^^^^
|
|
|
|
|
2020-08-11 15:43:21 +02:00
|
|
|
error: this call to `unwrap()` will always panic
|
2024-02-27 15:25:18 +01:00
|
|
|
--> tests/ui/checked_unwrap/complex_conditionals.rs:59:9
|
2018-06-08 18:12:01 +02:00
|
|
|
|
|
2018-12-27 16:57:55 +01:00
|
|
|
LL | if x.is_ok() && !(y.is_ok() || z.is_err()) {
|
2018-06-08 18:12:01 +02:00
|
|
|
| --------- because of this check
|
|
|
|
...
|
2023-08-24 21:32:12 +02:00
|
|
|
LL | y.unwrap();
|
2018-05-28 00:02:38 +02:00
|
|
|
| ^^^^^^^^^^
|
|
|
|
|
2021-09-08 16:31:47 +02:00
|
|
|
error: called `unwrap_err` on `y` after checking its variant with `is_ok`
|
2024-02-27 15:25:18 +01:00
|
|
|
--> tests/ui/checked_unwrap/complex_conditionals.rs:62:9
|
2018-05-28 00:02:38 +02:00
|
|
|
|
|
2018-12-27 16:57:55 +01:00
|
|
|
LL | if x.is_ok() && !(y.is_ok() || z.is_err()) {
|
2018-06-08 05:55:11 +02:00
|
|
|
| --------- the check is happening here
|
2018-06-08 18:12:01 +02:00
|
|
|
...
|
2023-08-24 21:32:12 +02:00
|
|
|
LL | y.unwrap_err();
|
2018-05-28 00:02:38 +02:00
|
|
|
| ^^^^^^^^^^^^^^
|
2021-09-08 16:31:47 +02:00
|
|
|
|
|
|
|
|
= help: try using `if let` or `match`
|
2018-05-28 00:02:38 +02:00
|
|
|
|
2021-09-08 16:31:47 +02:00
|
|
|
error: called `unwrap` on `z` after checking its variant with `is_err`
|
2024-02-27 15:25:18 +01:00
|
|
|
--> tests/ui/checked_unwrap/complex_conditionals.rs:65:9
|
2018-05-28 00:02:38 +02:00
|
|
|
|
|
2018-12-27 16:57:55 +01:00
|
|
|
LL | if x.is_ok() && !(y.is_ok() || z.is_err()) {
|
2018-06-08 05:55:11 +02:00
|
|
|
| ---------- the check is happening here
|
|
|
|
...
|
2023-08-24 21:32:12 +02:00
|
|
|
LL | z.unwrap();
|
2018-06-08 18:12:01 +02:00
|
|
|
| ^^^^^^^^^^
|
2021-09-08 16:31:47 +02:00
|
|
|
|
|
|
|
|
= help: try using `if let` or `match`
|
2018-06-08 18:12:01 +02:00
|
|
|
|
2020-08-11 15:43:21 +02:00
|
|
|
error: this call to `unwrap_err()` will always panic
|
2024-02-27 15:25:18 +01:00
|
|
|
--> tests/ui/checked_unwrap/complex_conditionals.rs:68:9
|
2018-06-08 18:12:01 +02:00
|
|
|
|
|
2018-12-27 16:57:55 +01:00
|
|
|
LL | if x.is_ok() && !(y.is_ok() || z.is_err()) {
|
2018-06-08 18:12:01 +02:00
|
|
|
| ---------- because of this check
|
|
|
|
...
|
2023-08-24 21:32:12 +02:00
|
|
|
LL | z.unwrap_err();
|
2018-06-08 18:12:01 +02:00
|
|
|
| ^^^^^^^^^^^^^^
|
|
|
|
|
2020-08-11 15:43:21 +02:00
|
|
|
error: this call to `unwrap()` will always panic
|
2024-02-27 15:25:18 +01:00
|
|
|
--> tests/ui/checked_unwrap/complex_conditionals.rs:78:9
|
2018-06-08 18:12:01 +02:00
|
|
|
|
|
2018-12-27 16:57:55 +01:00
|
|
|
LL | if x.is_ok() || !(y.is_ok() && z.is_err()) {
|
2018-06-08 18:12:01 +02:00
|
|
|
| --------- because of this check
|
|
|
|
...
|
2023-08-24 21:32:12 +02:00
|
|
|
LL | x.unwrap();
|
2018-05-28 00:02:38 +02:00
|
|
|
| ^^^^^^^^^^
|
|
|
|
|
2021-09-08 16:31:47 +02:00
|
|
|
error: called `unwrap_err` on `x` after checking its variant with `is_ok`
|
2024-02-27 15:25:18 +01:00
|
|
|
--> tests/ui/checked_unwrap/complex_conditionals.rs:81:9
|
2018-05-28 00:02:38 +02:00
|
|
|
|
|
2018-12-27 16:57:55 +01:00
|
|
|
LL | if x.is_ok() || !(y.is_ok() && z.is_err()) {
|
2018-06-08 05:55:11 +02:00
|
|
|
| --------- the check is happening here
|
|
|
|
...
|
2023-08-24 21:32:12 +02:00
|
|
|
LL | x.unwrap_err();
|
2018-05-28 00:02:38 +02:00
|
|
|
| ^^^^^^^^^^^^^^
|
2021-09-08 16:31:47 +02:00
|
|
|
|
|
|
|
|
= help: try using `if let` or `match`
|
2018-05-28 00:02:38 +02:00
|
|
|
|
2021-09-08 16:31:47 +02:00
|
|
|
error: called `unwrap` on `y` after checking its variant with `is_ok`
|
2024-02-27 15:25:18 +01:00
|
|
|
--> tests/ui/checked_unwrap/complex_conditionals.rs:84:9
|
2018-05-28 00:02:38 +02:00
|
|
|
|
|
2018-12-27 16:57:55 +01:00
|
|
|
LL | if x.is_ok() || !(y.is_ok() && z.is_err()) {
|
2018-06-08 05:55:11 +02:00
|
|
|
| --------- the check is happening here
|
|
|
|
...
|
2023-08-24 21:32:12 +02:00
|
|
|
LL | y.unwrap();
|
2018-06-08 18:12:01 +02:00
|
|
|
| ^^^^^^^^^^
|
2021-09-08 16:31:47 +02:00
|
|
|
|
|
|
|
|
= help: try using `if let` or `match`
|
2018-06-08 18:12:01 +02:00
|
|
|
|
2020-08-11 15:43:21 +02:00
|
|
|
error: this call to `unwrap_err()` will always panic
|
2024-02-27 15:25:18 +01:00
|
|
|
--> tests/ui/checked_unwrap/complex_conditionals.rs:87:9
|
2018-06-08 18:12:01 +02:00
|
|
|
|
|
2018-12-27 16:57:55 +01:00
|
|
|
LL | if x.is_ok() || !(y.is_ok() && z.is_err()) {
|
2018-06-08 18:12:01 +02:00
|
|
|
| --------- because of this check
|
|
|
|
...
|
2023-08-24 21:32:12 +02:00
|
|
|
LL | y.unwrap_err();
|
2018-06-08 18:12:01 +02:00
|
|
|
| ^^^^^^^^^^^^^^
|
|
|
|
|
2020-08-11 15:43:21 +02:00
|
|
|
error: this call to `unwrap()` will always panic
|
2024-02-27 15:25:18 +01:00
|
|
|
--> tests/ui/checked_unwrap/complex_conditionals.rs:90:9
|
2018-06-08 18:12:01 +02:00
|
|
|
|
|
2018-12-27 16:57:55 +01:00
|
|
|
LL | if x.is_ok() || !(y.is_ok() && z.is_err()) {
|
2018-06-08 18:12:01 +02:00
|
|
|
| ---------- because of this check
|
|
|
|
...
|
2023-08-24 21:32:12 +02:00
|
|
|
LL | z.unwrap();
|
2018-05-28 00:02:38 +02:00
|
|
|
| ^^^^^^^^^^
|
|
|
|
|
2021-09-08 16:31:47 +02:00
|
|
|
error: called `unwrap_err` on `z` after checking its variant with `is_err`
|
2024-02-27 15:25:18 +01:00
|
|
|
--> tests/ui/checked_unwrap/complex_conditionals.rs:93:9
|
2018-12-10 06:27:19 +01:00
|
|
|
|
|
2018-12-27 16:57:55 +01:00
|
|
|
LL | if x.is_ok() || !(y.is_ok() && z.is_err()) {
|
2018-12-10 06:27:19 +01:00
|
|
|
| ---------- the check is happening here
|
2018-06-08 05:55:11 +02:00
|
|
|
...
|
2023-08-24 21:32:12 +02:00
|
|
|
LL | z.unwrap_err();
|
2018-12-10 06:27:19 +01:00
|
|
|
| ^^^^^^^^^^^^^^
|
2021-09-08 16:31:47 +02:00
|
|
|
|
|
|
|
|
= help: try using `if let` or `match`
|
2018-05-28 00:02:38 +02:00
|
|
|
|
2020-03-18 15:24:48 +01:00
|
|
|
error: aborting due to 20 previous errors
|
2018-05-28 00:02:38 +02:00
|
|
|
|