]> git.lizzy.rs Git - rust.git/blob - src/tools/clippy/tests/ui/checked_unwrap/simple_conditionals.stderr
Rollup merge of #102353 - bjorn3:allow_rustix_use_libc, r=Mark-Simulacrum
[rust.git] / src / tools / clippy / tests / ui / checked_unwrap / simple_conditionals.stderr
1 error: called `unwrap` on `x` after checking its variant with `is_some`
2   --> $DIR/simple_conditionals.rs:40:9
3    |
4 LL |     if x.is_some() {
5    |     -------------- help: try: `if let Some(..) = x`
6 LL |         x.unwrap(); // unnecessary
7    |         ^^^^^^^^^^
8    |
9 note: the lint level is defined here
10   --> $DIR/simple_conditionals.rs:2:35
11    |
12 LL | #![deny(clippy::panicking_unwrap, clippy::unnecessary_unwrap)]
13    |                                   ^^^^^^^^^^^^^^^^^^^^^^^^^^
14
15 error: called `expect` on `x` after checking its variant with `is_some`
16   --> $DIR/simple_conditionals.rs:41:9
17    |
18 LL |     if x.is_some() {
19    |     -------------- help: try: `if let Some(..) = x`
20 LL |         x.unwrap(); // unnecessary
21 LL |         x.expect("an error message"); // unnecessary
22    |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
23
24 error: this call to `unwrap()` will always panic
25   --> $DIR/simple_conditionals.rs:43:9
26    |
27 LL |     if x.is_some() {
28    |        ----------- because of this check
29 ...
30 LL |         x.unwrap(); // will panic
31    |         ^^^^^^^^^^
32    |
33 note: the lint level is defined here
34   --> $DIR/simple_conditionals.rs:2:9
35    |
36 LL | #![deny(clippy::panicking_unwrap, clippy::unnecessary_unwrap)]
37    |         ^^^^^^^^^^^^^^^^^^^^^^^^
38
39 error: this call to `expect()` will always panic
40   --> $DIR/simple_conditionals.rs:44:9
41    |
42 LL |     if x.is_some() {
43    |        ----------- because of this check
44 ...
45 LL |         x.expect("an error message"); // will panic
46    |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
47
48 error: this call to `unwrap()` will always panic
49   --> $DIR/simple_conditionals.rs:47:9
50    |
51 LL |     if x.is_none() {
52    |        ----------- because of this check
53 LL |         x.unwrap(); // will panic
54    |         ^^^^^^^^^^
55
56 error: called `unwrap` on `x` after checking its variant with `is_none`
57   --> $DIR/simple_conditionals.rs:49:9
58    |
59 LL |     if x.is_none() {
60    |     -------------- help: try: `if let Some(..) = x`
61 ...
62 LL |         x.unwrap(); // unnecessary
63    |         ^^^^^^^^^^
64
65 error: called `unwrap` on `x` after checking its variant with `is_some`
66   --> $DIR/simple_conditionals.rs:8:13
67    |
68 LL |         if $a.is_some() {
69    |         --------------- help: try: `if let Some(..) = x`
70 LL |             $a.unwrap(); // unnecessary
71    |             ^^^^^^^^^^^
72 ...
73 LL |     m!(x);
74    |     ----- in this macro invocation
75    |
76    = note: this error originates in the macro `m` (in Nightly builds, run with -Z macro-backtrace for more info)
77
78 error: called `unwrap` on `x` after checking its variant with `is_ok`
79   --> $DIR/simple_conditionals.rs:57:9
80    |
81 LL |     if x.is_ok() {
82    |     ------------ help: try: `if let Ok(..) = x`
83 LL |         x.unwrap(); // unnecessary
84    |         ^^^^^^^^^^
85
86 error: called `expect` on `x` after checking its variant with `is_ok`
87   --> $DIR/simple_conditionals.rs:58:9
88    |
89 LL |     if x.is_ok() {
90    |     ------------ help: try: `if let Ok(..) = x`
91 LL |         x.unwrap(); // unnecessary
92 LL |         x.expect("an error message"); // unnecessary
93    |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
94
95 error: this call to `unwrap_err()` will always panic
96   --> $DIR/simple_conditionals.rs:59:9
97    |
98 LL |     if x.is_ok() {
99    |        --------- because of this check
100 ...
101 LL |         x.unwrap_err(); // will panic
102    |         ^^^^^^^^^^^^^^
103
104 error: this call to `unwrap()` will always panic
105   --> $DIR/simple_conditionals.rs:61:9
106    |
107 LL |     if x.is_ok() {
108    |        --------- because of this check
109 ...
110 LL |         x.unwrap(); // will panic
111    |         ^^^^^^^^^^
112
113 error: this call to `expect()` will always panic
114   --> $DIR/simple_conditionals.rs:62:9
115    |
116 LL |     if x.is_ok() {
117    |        --------- because of this check
118 ...
119 LL |         x.expect("an error message"); // will panic
120    |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
121
122 error: called `unwrap_err` on `x` after checking its variant with `is_ok`
123   --> $DIR/simple_conditionals.rs:63:9
124    |
125 LL |     if x.is_ok() {
126    |     ------------ help: try: `if let Err(..) = x`
127 ...
128 LL |         x.unwrap_err(); // unnecessary
129    |         ^^^^^^^^^^^^^^
130
131 error: this call to `unwrap()` will always panic
132   --> $DIR/simple_conditionals.rs:66:9
133    |
134 LL |     if x.is_err() {
135    |        ---------- because of this check
136 LL |         x.unwrap(); // will panic
137    |         ^^^^^^^^^^
138
139 error: called `unwrap_err` on `x` after checking its variant with `is_err`
140   --> $DIR/simple_conditionals.rs:67:9
141    |
142 LL |     if x.is_err() {
143    |     ------------- help: try: `if let Err(..) = x`
144 LL |         x.unwrap(); // will panic
145 LL |         x.unwrap_err(); // unnecessary
146    |         ^^^^^^^^^^^^^^
147
148 error: called `unwrap` on `x` after checking its variant with `is_err`
149   --> $DIR/simple_conditionals.rs:69:9
150    |
151 LL |     if x.is_err() {
152    |     ------------- help: try: `if let Ok(..) = x`
153 ...
154 LL |         x.unwrap(); // unnecessary
155    |         ^^^^^^^^^^
156
157 error: this call to `unwrap_err()` will always panic
158   --> $DIR/simple_conditionals.rs:70:9
159    |
160 LL |     if x.is_err() {
161    |        ---------- because of this check
162 ...
163 LL |         x.unwrap_err(); // will panic
164    |         ^^^^^^^^^^^^^^
165
166 error: aborting due to 17 previous errors
167