11error: You checked before that `unwrap()` cannot fail. Instead of checking and unwrapping, it's better to use `if let` or `match`.
2- --> $DIR/simple_conditionals.rs:7 :9
2+ --> $DIR/simple_conditionals.rs:15 :9
33 |
44LL | if x.is_some() {
55 | ----------- the check is happening here
@@ -13,7 +13,7 @@ LL | #![deny(clippy::panicking_unwrap, clippy::unnecessary_unwrap)]
1313 | ^^^^^^^^^^^^^^^^^^^^^^^^^^
1414
1515error: This call to `unwrap()` will always panic.
16- --> $DIR/simple_conditionals.rs:9 :9
16+ --> $DIR/simple_conditionals.rs:17 :9
1717 |
1818LL | if x.is_some() {
1919 | ----------- because of this check
@@ -28,15 +28,15 @@ LL | #![deny(clippy::panicking_unwrap, clippy::unnecessary_unwrap)]
2828 | ^^^^^^^^^^^^^^^^^^^^^^^^
2929
3030error: This call to `unwrap()` will always panic.
31- --> $DIR/simple_conditionals.rs:12 :9
31+ --> $DIR/simple_conditionals.rs:20 :9
3232 |
3333LL | if x.is_none() {
3434 | ----------- because of this check
3535LL | x.unwrap(); // will panic
3636 | ^^^^^^^^^^
3737
3838error: You checked before that `unwrap()` cannot fail. Instead of checking and unwrapping, it's better to use `if let` or `match`.
39- --> $DIR/simple_conditionals.rs:14 :9
39+ --> $DIR/simple_conditionals.rs:22 :9
4040 |
4141LL | if x.is_none() {
4242 | ----------- the check is happening here
@@ -45,15 +45,26 @@ LL | x.unwrap(); // unnecessary
4545 | ^^^^^^^^^^
4646
4747error: You checked before that `unwrap()` cannot fail. Instead of checking and unwrapping, it's better to use `if let` or `match`.
48- --> $DIR/simple_conditionals.rs:18:9
48+ --> $DIR/simple_conditionals.rs:7:13
49+ |
50+ LL | if $a.is_some() {
51+ | ------------ the check is happening here
52+ LL | $a.unwrap(); // unnecessary
53+ | ^^^^^^^^^^^
54+ ...
55+ LL | m!(x);
56+ | ------ in this macro invocation
57+
58+ error: You checked before that `unwrap()` cannot fail. Instead of checking and unwrapping, it's better to use `if let` or `match`.
59+ --> $DIR/simple_conditionals.rs:27:9
4960 |
5061LL | if x.is_ok() {
5162 | --------- the check is happening here
5263LL | x.unwrap(); // unnecessary
5364 | ^^^^^^^^^^
5465
5566error: This call to `unwrap_err()` will always panic.
56- --> $DIR/simple_conditionals.rs:19 :9
67+ --> $DIR/simple_conditionals.rs:28 :9
5768 |
5869LL | if x.is_ok() {
5970 | --------- because of this check
@@ -62,7 +73,7 @@ LL | x.unwrap_err(); // will panic
6273 | ^^^^^^^^^^^^^^
6374
6475error: This call to `unwrap()` will always panic.
65- --> $DIR/simple_conditionals.rs:21 :9
76+ --> $DIR/simple_conditionals.rs:30 :9
6677 |
6778LL | if x.is_ok() {
6879 | --------- because of this check
@@ -71,7 +82,7 @@ LL | x.unwrap(); // will panic
7182 | ^^^^^^^^^^
7283
7384error: You checked before that `unwrap_err()` cannot fail. Instead of checking and unwrapping, it's better to use `if let` or `match`.
74- --> $DIR/simple_conditionals.rs:22 :9
85+ --> $DIR/simple_conditionals.rs:31 :9
7586 |
7687LL | if x.is_ok() {
7788 | --------- the check is happening here
@@ -80,15 +91,15 @@ LL | x.unwrap_err(); // unnecessary
8091 | ^^^^^^^^^^^^^^
8192
8293error: This call to `unwrap()` will always panic.
83- --> $DIR/simple_conditionals.rs:25 :9
94+ --> $DIR/simple_conditionals.rs:34 :9
8495 |
8596LL | if x.is_err() {
8697 | ---------- because of this check
8798LL | x.unwrap(); // will panic
8899 | ^^^^^^^^^^
89100
90101error: You checked before that `unwrap_err()` cannot fail. Instead of checking and unwrapping, it's better to use `if let` or `match`.
91- --> $DIR/simple_conditionals.rs:26 :9
102+ --> $DIR/simple_conditionals.rs:35 :9
92103 |
93104LL | if x.is_err() {
94105 | ---------- the check is happening here
@@ -97,7 +108,7 @@ LL | x.unwrap_err(); // unnecessary
97108 | ^^^^^^^^^^^^^^
98109
99110error: You checked before that `unwrap()` cannot fail. Instead of checking and unwrapping, it's better to use `if let` or `match`.
100- --> $DIR/simple_conditionals.rs:28 :9
111+ --> $DIR/simple_conditionals.rs:37 :9
101112 |
102113LL | if x.is_err() {
103114 | ---------- the check is happening here
@@ -106,13 +117,13 @@ LL | x.unwrap(); // unnecessary
106117 | ^^^^^^^^^^
107118
108119error: This call to `unwrap_err()` will always panic.
109- --> $DIR/simple_conditionals.rs:29 :9
120+ --> $DIR/simple_conditionals.rs:38 :9
110121 |
111122LL | if x.is_err() {
112123 | ---------- because of this check
113124...
114125LL | x.unwrap_err(); // will panic
115126 | ^^^^^^^^^^^^^^
116127
117- error: aborting due to 12 previous errors
128+ error: aborting due to 13 previous errors
118129
0 commit comments