]> git.lizzy.rs Git - rust.git/blob - src/tools/clippy/tests/ui/manual_assert.edition2021.stderr
Rollup merge of #102072 - scottmcm:ptr-alignment-type, r=thomcc
[rust.git] / src / tools / clippy / tests / ui / manual_assert.edition2021.stderr
1 error: only a `panic!` in `if`-then statement
2   --> $DIR/manual_assert.rs:31:5
3    |
4 LL | /     if !a.is_empty() {
5 LL | |         panic!("qaqaq{:?}", a);
6 LL | |     }
7    | |_____^
8    |
9    = note: `-D clippy::manual-assert` implied by `-D warnings`
10 help: try instead
11    |
12 LL |     assert!(a.is_empty(), "qaqaq{:?}", a);
13    |
14
15 error: only a `panic!` in `if`-then statement
16   --> $DIR/manual_assert.rs:34:5
17    |
18 LL | /     if !a.is_empty() {
19 LL | |         panic!("qwqwq");
20 LL | |     }
21    | |_____^
22    |
23 help: try instead
24    |
25 LL |     assert!(a.is_empty(), "qwqwq");
26    |
27
28 error: only a `panic!` in `if`-then statement
29   --> $DIR/manual_assert.rs:51:5
30    |
31 LL | /     if b.is_empty() {
32 LL | |         panic!("panic1");
33 LL | |     }
34    | |_____^
35    |
36 help: try instead
37    |
38 LL |     assert!(!b.is_empty(), "panic1");
39    |
40
41 error: only a `panic!` in `if`-then statement
42   --> $DIR/manual_assert.rs:54:5
43    |
44 LL | /     if b.is_empty() && a.is_empty() {
45 LL | |         panic!("panic2");
46 LL | |     }
47    | |_____^
48    |
49 help: try instead
50    |
51 LL |     assert!(!(b.is_empty() && a.is_empty()), "panic2");
52    |
53
54 error: only a `panic!` in `if`-then statement
55   --> $DIR/manual_assert.rs:57:5
56    |
57 LL | /     if a.is_empty() && !b.is_empty() {
58 LL | |         panic!("panic3");
59 LL | |     }
60    | |_____^
61    |
62 help: try instead
63    |
64 LL |     assert!(!(a.is_empty() && !b.is_empty()), "panic3");
65    |
66
67 error: only a `panic!` in `if`-then statement
68   --> $DIR/manual_assert.rs:60:5
69    |
70 LL | /     if b.is_empty() || a.is_empty() {
71 LL | |         panic!("panic4");
72 LL | |     }
73    | |_____^
74    |
75 help: try instead
76    |
77 LL |     assert!(!(b.is_empty() || a.is_empty()), "panic4");
78    |
79
80 error: only a `panic!` in `if`-then statement
81   --> $DIR/manual_assert.rs:63:5
82    |
83 LL | /     if a.is_empty() || !b.is_empty() {
84 LL | |         panic!("panic5");
85 LL | |     }
86    | |_____^
87    |
88 help: try instead
89    |
90 LL |     assert!(!(a.is_empty() || !b.is_empty()), "panic5");
91    |
92
93 error: only a `panic!` in `if`-then statement
94   --> $DIR/manual_assert.rs:66:5
95    |
96 LL | /     if a.is_empty() {
97 LL | |         panic!("with expansion {}", one!())
98 LL | |     }
99    | |_____^
100    |
101 help: try instead
102    |
103 LL |     assert!(!a.is_empty(), "with expansion {}", one!());
104    |
105
106 error: only a `panic!` in `if`-then statement
107   --> $DIR/manual_assert.rs:73:5
108    |
109 LL | /     if a > 2 {
110 LL | |         // comment
111 LL | |         /* this is a
112 LL | |         multiline
113 ...  |
114 LL | |         panic!("panic with comment") // comment after `panic!`
115 LL | |     }
116    | |_____^
117    |
118 help: try instead
119    |
120 LL |     assert!(!(a > 2), "panic with comment");
121    |
122
123 error: aborting due to 9 previous errors
124