2021-09-08 14:31:47 +00:00
|
|
|
error: called `unwrap` on `x` after checking its variant with `is_some`
|
2020-05-11 18:23:47 +00:00
|
|
|
--> $DIR/simple_conditionals.rs:39:9
|
2019-07-15 19:27:44 +00:00
|
|
|
|
|
|
|
|
LL | if x.is_some() {
|
2021-09-08 14:31:47 +00:00
|
|
|
| -------------- help: try: `if let Some(..) = x`
|
2019-07-15 19:27:44 +00:00
|
|
|
LL | x.unwrap(); // unnecessary
|
|
|
|
| ^^^^^^^^^^
|
|
|
|
|
|
2020-01-31 19:21:10 +00:00
|
|
|
note: the lint level is defined here
|
2019-07-15 19:27:44 +00:00
|
|
|
--> $DIR/simple_conditionals.rs:1:35
|
|
|
|
|
|
|
|
|
LL | #![deny(clippy::panicking_unwrap, clippy::unnecessary_unwrap)]
|
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
2021-09-08 14:31:47 +00:00
|
|
|
error: called `expect` on `x` after checking its variant with `is_some`
|
|
|
|
--> $DIR/simple_conditionals.rs:40:9
|
|
|
|
|
|
|
|
|
LL | if x.is_some() {
|
|
|
|
| -------------- help: try: `if let Some(..) = x`
|
|
|
|
LL | x.unwrap(); // unnecessary
|
|
|
|
LL | x.expect("an error message"); // unnecessary
|
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
2020-08-11 13:43:21 +00:00
|
|
|
error: this call to `unwrap()` will always panic
|
2021-09-08 14:31:47 +00:00
|
|
|
--> $DIR/simple_conditionals.rs:42:9
|
2019-07-15 19:27:44 +00:00
|
|
|
|
|
|
|
|
LL | if x.is_some() {
|
|
|
|
| ----------- because of this check
|
|
|
|
...
|
|
|
|
LL | x.unwrap(); // will panic
|
|
|
|
| ^^^^^^^^^^
|
|
|
|
|
|
2020-01-31 19:21:10 +00:00
|
|
|
note: the lint level is defined here
|
2019-07-15 19:27:44 +00:00
|
|
|
--> $DIR/simple_conditionals.rs:1:9
|
|
|
|
|
|
|
|
|
LL | #![deny(clippy::panicking_unwrap, clippy::unnecessary_unwrap)]
|
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
2021-09-08 14:31:47 +00:00
|
|
|
error: this call to `expect()` will always panic
|
|
|
|
--> $DIR/simple_conditionals.rs:43:9
|
|
|
|
|
|
|
|
|
LL | if x.is_some() {
|
|
|
|
| ----------- because of this check
|
|
|
|
...
|
|
|
|
LL | x.expect("an error message"); // will panic
|
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
2020-08-11 13:43:21 +00:00
|
|
|
error: this call to `unwrap()` will always panic
|
2021-09-08 14:31:47 +00:00
|
|
|
--> $DIR/simple_conditionals.rs:46:9
|
2019-07-15 19:27:44 +00:00
|
|
|
|
|
|
|
|
LL | if x.is_none() {
|
|
|
|
| ----------- because of this check
|
|
|
|
LL | x.unwrap(); // will panic
|
|
|
|
| ^^^^^^^^^^
|
|
|
|
|
2021-09-08 14:31:47 +00:00
|
|
|
error: called `unwrap` on `x` after checking its variant with `is_none`
|
|
|
|
--> $DIR/simple_conditionals.rs:48:9
|
2019-07-15 19:27:44 +00:00
|
|
|
|
|
|
|
|
LL | if x.is_none() {
|
2021-09-08 14:31:47 +00:00
|
|
|
| -------------- help: try: `if let Some(..) = x`
|
2019-07-15 19:27:44 +00:00
|
|
|
...
|
|
|
|
LL | x.unwrap(); // unnecessary
|
|
|
|
| ^^^^^^^^^^
|
|
|
|
|
2021-09-08 14:31:47 +00:00
|
|
|
error: called `unwrap` on `x` after checking its variant with `is_some`
|
2020-02-04 20:38:26 +00:00
|
|
|
--> $DIR/simple_conditionals.rs:7:13
|
|
|
|
|
|
|
|
|
LL | if $a.is_some() {
|
2021-09-08 14:31:47 +00:00
|
|
|
| --------------- help: try: `if let Some(..) = x`
|
2020-02-04 20:38:26 +00:00
|
|
|
LL | $a.unwrap(); // unnecessary
|
|
|
|
| ^^^^^^^^^^^
|
|
|
|
...
|
|
|
|
LL | m!(x);
|
2021-10-14 18:28:30 +00:00
|
|
|
| ----- in this macro invocation
|
2020-02-07 03:34:06 +00:00
|
|
|
|
|
2021-02-13 19:52:25 +00:00
|
|
|
= note: this error originates in the macro `m` (in Nightly builds, run with -Z macro-backtrace for more info)
|
2020-02-04 20:38:26 +00:00
|
|
|
|
2021-09-08 14:31:47 +00:00
|
|
|
error: called `unwrap` on `x` after checking its variant with `is_ok`
|
|
|
|
--> $DIR/simple_conditionals.rs:56:9
|
2019-07-15 19:27:44 +00:00
|
|
|
|
|
|
|
|
LL | if x.is_ok() {
|
2021-09-08 14:31:47 +00:00
|
|
|
| ------------ help: try: `if let Ok(..) = x`
|
2019-07-15 19:27:44 +00:00
|
|
|
LL | x.unwrap(); // unnecessary
|
|
|
|
| ^^^^^^^^^^
|
|
|
|
|
2021-09-08 14:31:47 +00:00
|
|
|
error: called `expect` on `x` after checking its variant with `is_ok`
|
|
|
|
--> $DIR/simple_conditionals.rs:57:9
|
|
|
|
|
|
|
|
|
LL | if x.is_ok() {
|
|
|
|
| ------------ help: try: `if let Ok(..) = x`
|
|
|
|
LL | x.unwrap(); // unnecessary
|
|
|
|
LL | x.expect("an error message"); // unnecessary
|
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
2020-08-11 13:43:21 +00:00
|
|
|
error: this call to `unwrap_err()` will always panic
|
2021-09-08 14:31:47 +00:00
|
|
|
--> $DIR/simple_conditionals.rs:58:9
|
2019-07-15 19:27:44 +00:00
|
|
|
|
|
|
|
|
LL | if x.is_ok() {
|
|
|
|
| --------- because of this check
|
2021-09-08 14:31:47 +00:00
|
|
|
...
|
2019-07-15 19:27:44 +00:00
|
|
|
LL | x.unwrap_err(); // will panic
|
|
|
|
| ^^^^^^^^^^^^^^
|
|
|
|
|
2020-08-11 13:43:21 +00:00
|
|
|
error: this call to `unwrap()` will always panic
|
2021-09-08 14:31:47 +00:00
|
|
|
--> $DIR/simple_conditionals.rs:60:9
|
2019-07-15 19:27:44 +00:00
|
|
|
|
|
|
|
|
LL | if x.is_ok() {
|
|
|
|
| --------- because of this check
|
|
|
|
...
|
|
|
|
LL | x.unwrap(); // will panic
|
|
|
|
| ^^^^^^^^^^
|
|
|
|
|
2021-09-08 14:31:47 +00:00
|
|
|
error: this call to `expect()` will always panic
|
|
|
|
--> $DIR/simple_conditionals.rs:61:9
|
|
|
|
|
|
|
|
|
LL | if x.is_ok() {
|
|
|
|
| --------- because of this check
|
|
|
|
...
|
|
|
|
LL | x.expect("an error message"); // will panic
|
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
|
|
|
error: called `unwrap_err` on `x` after checking its variant with `is_ok`
|
|
|
|
--> $DIR/simple_conditionals.rs:62:9
|
2019-07-15 19:27:44 +00:00
|
|
|
|
|
|
|
|
LL | if x.is_ok() {
|
2021-09-08 14:31:47 +00:00
|
|
|
| ------------ help: try: `if let Err(..) = x`
|
2019-07-15 19:27:44 +00:00
|
|
|
...
|
|
|
|
LL | x.unwrap_err(); // unnecessary
|
|
|
|
| ^^^^^^^^^^^^^^
|
|
|
|
|
2020-08-11 13:43:21 +00:00
|
|
|
error: this call to `unwrap()` will always panic
|
2021-09-08 14:31:47 +00:00
|
|
|
--> $DIR/simple_conditionals.rs:65:9
|
2019-07-15 19:27:44 +00:00
|
|
|
|
|
|
|
|
LL | if x.is_err() {
|
|
|
|
| ---------- because of this check
|
|
|
|
LL | x.unwrap(); // will panic
|
|
|
|
| ^^^^^^^^^^
|
|
|
|
|
2021-09-08 14:31:47 +00:00
|
|
|
error: called `unwrap_err` on `x` after checking its variant with `is_err`
|
|
|
|
--> $DIR/simple_conditionals.rs:66:9
|
2019-07-15 19:27:44 +00:00
|
|
|
|
|
|
|
|
LL | if x.is_err() {
|
2021-09-08 14:31:47 +00:00
|
|
|
| ------------- help: try: `if let Err(..) = x`
|
2019-07-15 19:27:44 +00:00
|
|
|
LL | x.unwrap(); // will panic
|
|
|
|
LL | x.unwrap_err(); // unnecessary
|
|
|
|
| ^^^^^^^^^^^^^^
|
|
|
|
|
2021-09-08 14:31:47 +00:00
|
|
|
error: called `unwrap` on `x` after checking its variant with `is_err`
|
|
|
|
--> $DIR/simple_conditionals.rs:68:9
|
2019-07-15 19:27:44 +00:00
|
|
|
|
|
|
|
|
LL | if x.is_err() {
|
2021-09-08 14:31:47 +00:00
|
|
|
| ------------- help: try: `if let Ok(..) = x`
|
2019-07-15 19:27:44 +00:00
|
|
|
...
|
|
|
|
LL | x.unwrap(); // unnecessary
|
|
|
|
| ^^^^^^^^^^
|
|
|
|
|
2020-08-11 13:43:21 +00:00
|
|
|
error: this call to `unwrap_err()` will always panic
|
2021-09-08 14:31:47 +00:00
|
|
|
--> $DIR/simple_conditionals.rs:69:9
|
2019-07-15 19:27:44 +00:00
|
|
|
|
|
|
|
|
LL | if x.is_err() {
|
|
|
|
| ---------- because of this check
|
|
|
|
...
|
|
|
|
LL | x.unwrap_err(); // will panic
|
|
|
|
| ^^^^^^^^^^^^^^
|
|
|
|
|
2021-09-08 14:31:47 +00:00
|
|
|
error: aborting due to 17 previous errors
|
2019-07-15 19:27:44 +00:00
|
|
|
|