@@ -186,21 +186,19 @@ fn check_array(cx: &EarlyContext<'_>, expr: &ast::Expr) {
186
186
if let ast:: ExprKind :: Array ( ref array) = expr. node {
187
187
for element in array {
188
188
if let ast:: ExprKind :: Binary ( ref op, ref lhs, _) = element. node {
189
- if has_unary_equivalent ( op. node ) {
190
- if !differing_macro_contexts ( lhs. span , op. span ) {
191
- let space_span = lhs. span . between ( op. span ) ;
192
- if let Some ( space_snippet) = snippet_opt ( cx, space_span) {
193
- let lint_span = lhs. span . with_lo ( lhs. span . hi ( ) ) ;
194
- if space_snippet. contains ( '\n' ) {
195
- span_note_and_lint (
196
- cx,
197
- POSSIBLE_MISSING_COMMA ,
198
- lint_span,
199
- "possibly missing a comma here" ,
200
- lint_span,
201
- "to remove this lint, add a comma or write the expr in a single line" ,
202
- ) ;
203
- }
189
+ if has_unary_equivalent ( op. node ) && !differing_macro_contexts ( lhs. span , op. span ) {
190
+ let space_span = lhs. span . between ( op. span ) ;
191
+ if let Some ( space_snippet) = snippet_opt ( cx, space_span) {
192
+ let lint_span = lhs. span . with_lo ( lhs. span . hi ( ) ) ;
193
+ if space_snippet. contains ( '\n' ) {
194
+ span_note_and_lint (
195
+ cx,
196
+ POSSIBLE_MISSING_COMMA ,
197
+ lint_span,
198
+ "possibly missing a comma here" ,
199
+ lint_span,
200
+ "to remove this lint, add a comma or write the expr in a single line" ,
201
+ ) ;
204
202
}
205
203
}
206
204
}
0 commit comments