]> git.lizzy.rs Git - rust.git/blob - tests/ui/checked_unwrap/complex_conditionals.stderr
Auto merge of #68717 - petrochenkov:stabexpat, r=varkor
[rust.git] / tests / ui / checked_unwrap / complex_conditionals.stderr
1 error: You checked before that `unwrap()` cannot fail. Instead of checking and unwrapping, it's better to use `if let` or `match`.
2   --> $DIR/complex_conditionals.rs:8:9
3    |
4 LL |     if x.is_ok() && y.is_err() {
5    |        --------- the check is happening here
6 LL |         x.unwrap(); // unnecessary
7    |         ^^^^^^^^^^
8    |
9 note: the lint level is defined here
10   --> $DIR/complex_conditionals.rs:1:35
11    |
12 LL | #![deny(clippy::panicking_unwrap, clippy::unnecessary_unwrap)]
13    |                                   ^^^^^^^^^^^^^^^^^^^^^^^^^^
14
15 error: This call to `unwrap_err()` will always panic.
16   --> $DIR/complex_conditionals.rs:9:9
17    |
18 LL |     if x.is_ok() && y.is_err() {
19    |        --------- because of this check
20 LL |         x.unwrap(); // unnecessary
21 LL |         x.unwrap_err(); // will panic
22    |         ^^^^^^^^^^^^^^
23    |
24 note: the lint level is defined here
25   --> $DIR/complex_conditionals.rs:1:9
26    |
27 LL | #![deny(clippy::panicking_unwrap, clippy::unnecessary_unwrap)]
28    |         ^^^^^^^^^^^^^^^^^^^^^^^^
29
30 error: This call to `unwrap()` will always panic.
31   --> $DIR/complex_conditionals.rs:10:9
32    |
33 LL |     if x.is_ok() && y.is_err() {
34    |                     ---------- because of this check
35 ...
36 LL |         y.unwrap(); // will panic
37    |         ^^^^^^^^^^
38
39 error: You checked before that `unwrap_err()` cannot fail. Instead of checking and unwrapping, it's better to use `if let` or `match`.
40   --> $DIR/complex_conditionals.rs:11:9
41    |
42 LL |     if x.is_ok() && y.is_err() {
43    |                     ---------- the check is happening here
44 ...
45 LL |         y.unwrap_err(); // unnecessary
46    |         ^^^^^^^^^^^^^^
47
48 error: This call to `unwrap()` will always panic.
49   --> $DIR/complex_conditionals.rs:25:9
50    |
51 LL |     if x.is_ok() || y.is_ok() {
52    |        --------- because of this check
53 ...
54 LL |         x.unwrap(); // will panic
55    |         ^^^^^^^^^^
56
57 error: You checked before that `unwrap_err()` cannot fail. Instead of checking and unwrapping, it's better to use `if let` or `match`.
58   --> $DIR/complex_conditionals.rs:26:9
59    |
60 LL |     if x.is_ok() || y.is_ok() {
61    |        --------- the check is happening here
62 ...
63 LL |         x.unwrap_err(); // unnecessary
64    |         ^^^^^^^^^^^^^^
65
66 error: This call to `unwrap()` will always panic.
67   --> $DIR/complex_conditionals.rs:27:9
68    |
69 LL |     if x.is_ok() || y.is_ok() {
70    |                     --------- because of this check
71 ...
72 LL |         y.unwrap(); // will panic
73    |         ^^^^^^^^^^
74
75 error: You checked before that `unwrap_err()` cannot fail. Instead of checking and unwrapping, it's better to use `if let` or `match`.
76   --> $DIR/complex_conditionals.rs:28:9
77    |
78 LL |     if x.is_ok() || y.is_ok() {
79    |                     --------- the check is happening here
80 ...
81 LL |         y.unwrap_err(); // unnecessary
82    |         ^^^^^^^^^^^^^^
83
84 error: You checked before that `unwrap()` cannot fail. Instead of checking and unwrapping, it's better to use `if let` or `match`.
85   --> $DIR/complex_conditionals.rs:32:9
86    |
87 LL |     if x.is_ok() && !(y.is_ok() || z.is_err()) {
88    |        --------- the check is happening here
89 LL |         x.unwrap(); // unnecessary
90    |         ^^^^^^^^^^
91
92 error: This call to `unwrap_err()` will always panic.
93   --> $DIR/complex_conditionals.rs:33:9
94    |
95 LL |     if x.is_ok() && !(y.is_ok() || z.is_err()) {
96    |        --------- because of this check
97 LL |         x.unwrap(); // unnecessary
98 LL |         x.unwrap_err(); // will panic
99    |         ^^^^^^^^^^^^^^
100
101 error: This call to `unwrap()` will always panic.
102   --> $DIR/complex_conditionals.rs:34:9
103    |
104 LL |     if x.is_ok() && !(y.is_ok() || z.is_err()) {
105    |                       --------- because of this check
106 ...
107 LL |         y.unwrap(); // will panic
108    |         ^^^^^^^^^^
109
110 error: You checked before that `unwrap_err()` cannot fail. Instead of checking and unwrapping, it's better to use `if let` or `match`.
111   --> $DIR/complex_conditionals.rs:35:9
112    |
113 LL |     if x.is_ok() && !(y.is_ok() || z.is_err()) {
114    |                       --------- the check is happening here
115 ...
116 LL |         y.unwrap_err(); // unnecessary
117    |         ^^^^^^^^^^^^^^
118
119 error: You checked before that `unwrap()` cannot fail. Instead of checking and unwrapping, it's better to use `if let` or `match`.
120   --> $DIR/complex_conditionals.rs:36:9
121    |
122 LL |     if x.is_ok() && !(y.is_ok() || z.is_err()) {
123    |                                    ---------- the check is happening here
124 ...
125 LL |         z.unwrap(); // unnecessary
126    |         ^^^^^^^^^^
127
128 error: This call to `unwrap_err()` will always panic.
129   --> $DIR/complex_conditionals.rs:37:9
130    |
131 LL |     if x.is_ok() && !(y.is_ok() || z.is_err()) {
132    |                                    ---------- because of this check
133 ...
134 LL |         z.unwrap_err(); // will panic
135    |         ^^^^^^^^^^^^^^
136
137 error: This call to `unwrap()` will always panic.
138   --> $DIR/complex_conditionals.rs:45:9
139    |
140 LL |     if x.is_ok() || !(y.is_ok() && z.is_err()) {
141    |        --------- because of this check
142 ...
143 LL |         x.unwrap(); // will panic
144    |         ^^^^^^^^^^
145
146 error: You checked before that `unwrap_err()` cannot fail. Instead of checking and unwrapping, it's better to use `if let` or `match`.
147   --> $DIR/complex_conditionals.rs:46:9
148    |
149 LL |     if x.is_ok() || !(y.is_ok() && z.is_err()) {
150    |        --------- the check is happening here
151 ...
152 LL |         x.unwrap_err(); // unnecessary
153    |         ^^^^^^^^^^^^^^
154
155 error: You checked before that `unwrap()` cannot fail. Instead of checking and unwrapping, it's better to use `if let` or `match`.
156   --> $DIR/complex_conditionals.rs:47:9
157    |
158 LL |     if x.is_ok() || !(y.is_ok() && z.is_err()) {
159    |                       --------- the check is happening here
160 ...
161 LL |         y.unwrap(); // unnecessary
162    |         ^^^^^^^^^^
163
164 error: This call to `unwrap_err()` will always panic.
165   --> $DIR/complex_conditionals.rs:48:9
166    |
167 LL |     if x.is_ok() || !(y.is_ok() && z.is_err()) {
168    |                       --------- because of this check
169 ...
170 LL |         y.unwrap_err(); // will panic
171    |         ^^^^^^^^^^^^^^
172
173 error: This call to `unwrap()` will always panic.
174   --> $DIR/complex_conditionals.rs:49:9
175    |
176 LL |     if x.is_ok() || !(y.is_ok() && z.is_err()) {
177    |                                    ---------- because of this check
178 ...
179 LL |         z.unwrap(); // will panic
180    |         ^^^^^^^^^^
181
182 error: You checked before that `unwrap_err()` cannot fail. Instead of checking and unwrapping, it's better to use `if let` or `match`.
183   --> $DIR/complex_conditionals.rs:50:9
184    |
185 LL |     if x.is_ok() || !(y.is_ok() && z.is_err()) {
186    |                                    ---------- the check is happening here
187 ...
188 LL |         z.unwrap_err(); // unnecessary
189    |         ^^^^^^^^^^^^^^
190
191 error: aborting due to 20 previous errors
192