about summary refs log tree commit diff
path: root/src/tools/clippy/tests/ui/manual_assert.edition2021.stderr
blob: 2e9c9045caae12809c8525012244f27a7f561e61 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
error: only a `panic!` in `if`-then statement
  --> tests/ui/manual_assert.rs:32:5
   |
LL | /     if !a.is_empty() {
LL | |
LL | |         panic!("qaqaq{:?}", a);
LL | |     }
   | |_____^
   |
   = note: `-D clippy::manual-assert` implied by `-D warnings`
   = help: to override `-D warnings` add `#[allow(clippy::manual_assert)]`
help: try instead
   |
LL -     if !a.is_empty() {
LL -
LL -         panic!("qaqaq{:?}", a);
LL -     }
LL +     assert!(a.is_empty(), "qaqaq{:?}", a);
   |

error: only a `panic!` in `if`-then statement
  --> tests/ui/manual_assert.rs:36:5
   |
LL | /     if !a.is_empty() {
LL | |
LL | |         panic!("qwqwq");
LL | |     }
   | |_____^
   |
help: try instead
   |
LL -     if !a.is_empty() {
LL -
LL -         panic!("qwqwq");
LL -     }
LL +     assert!(a.is_empty(), "qwqwq");
   |

error: only a `panic!` in `if`-then statement
  --> tests/ui/manual_assert.rs:54:5
   |
LL | /     if b.is_empty() {
LL | |
LL | |         panic!("panic1");
LL | |     }
   | |_____^
   |
help: try instead
   |
LL -     if b.is_empty() {
LL -
LL -         panic!("panic1");
LL -     }
LL +     assert!(!b.is_empty(), "panic1");
   |

error: only a `panic!` in `if`-then statement
  --> tests/ui/manual_assert.rs:58:5
   |
LL | /     if b.is_empty() && a.is_empty() {
LL | |
LL | |         panic!("panic2");
LL | |     }
   | |_____^
   |
help: try instead
   |
LL -     if b.is_empty() && a.is_empty() {
LL -
LL -         panic!("panic2");
LL -     }
LL +     assert!(!(b.is_empty() && a.is_empty()), "panic2");
   |

error: only a `panic!` in `if`-then statement
  --> tests/ui/manual_assert.rs:62:5
   |
LL | /     if a.is_empty() && !b.is_empty() {
LL | |
LL | |         panic!("panic3");
LL | |     }
   | |_____^
   |
help: try instead
   |
LL -     if a.is_empty() && !b.is_empty() {
LL -
LL -         panic!("panic3");
LL -     }
LL +     assert!(!(a.is_empty() && !b.is_empty()), "panic3");
   |

error: only a `panic!` in `if`-then statement
  --> tests/ui/manual_assert.rs:66:5
   |
LL | /     if b.is_empty() || a.is_empty() {
LL | |
LL | |         panic!("panic4");
LL | |     }
   | |_____^
   |
help: try instead
   |
LL -     if b.is_empty() || a.is_empty() {
LL -
LL -         panic!("panic4");
LL -     }
LL +     assert!(!(b.is_empty() || a.is_empty()), "panic4");
   |

error: only a `panic!` in `if`-then statement
  --> tests/ui/manual_assert.rs:70:5
   |
LL | /     if a.is_empty() || !b.is_empty() {
LL | |
LL | |         panic!("panic5");
LL | |     }
   | |_____^
   |
help: try instead
   |
LL -     if a.is_empty() || !b.is_empty() {
LL -
LL -         panic!("panic5");
LL -     }
LL +     assert!(!(a.is_empty() || !b.is_empty()), "panic5");
   |

error: only a `panic!` in `if`-then statement
  --> tests/ui/manual_assert.rs:74:5
   |
LL | /     if a.is_empty() {
LL | |
LL | |         panic!("with expansion {}", one!())
LL | |     }
   | |_____^
   |
help: try instead
   |
LL -     if a.is_empty() {
LL -
LL -         panic!("with expansion {}", one!())
LL -     }
LL +     assert!(!a.is_empty(), "with expansion {}", one!());
   |

error: only a `panic!` in `if`-then statement
  --> tests/ui/manual_assert.rs:87:5
   |
LL | /     if a > 2 {
LL | |
LL | |         // comment
LL | |         /* this is a
...  |
LL | |         panic!("panic with comment") // comment after `panic!`
LL | |     }
   | |_____^
   |
help: try instead
   |
LL -     if a > 2 {
LL -
LL -         // comment
LL -         /* this is a
LL -         multiline
LL -         comment */
LL -         /// Doc comment
LL -         panic!("panic with comment") // comment after `panic!`
LL -     }
LL +     assert!(a <= 2, "panic with comment");
   |

error: only a `panic!` in `if`-then statement
  --> tests/ui/manual_assert.rs:102:25
   |
LL |           const BAR: () = if N == 0 {
   |  _________________________^
LL | |
LL | |             panic!()
LL | |         };
   | |_________^
   |
help: try instead
   |
LL -         const BAR: () = if N == 0 {
LL -
LL -             panic!()
LL -         };
LL +         const BAR: () = assert!(N != 0, );
   |

error: only a `panic!` in `if`-then statement
  --> tests/ui/manual_assert.rs:116:5
   |
LL | /     if !is_x86_feature_detected!("ssse3") {
LL | |
LL | |         panic!("SSSE3 is not supported");
LL | |     }
   | |_____^
   |
help: try instead
   |
LL -     if !is_x86_feature_detected!("ssse3") {
LL -
LL -         panic!("SSSE3 is not supported");
LL -     }
LL +     assert!(is_x86_feature_detected!("ssse3"), "SSSE3 is not supported");
   |

error: aborting due to 11 previous errors