Skip to content

Commit cd67487

Browse files
committed
Revert "Fixed for loop problem, corrected all occurences that got linted"
This reverts commit 6626295.
1 parent 6626295 commit cd67487

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

55 files changed

+148
-149
lines changed

clippy_lints/src/assertions_on_constants.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ impl<'tcx> LateLintPass<'tcx> for AssertionsOnConstants {
6161
&format!("`assert!(false, {})` should probably be replaced", panic_message),
6262
None,
6363
&format!("use `panic!({})` or `unreachable!({})`", panic_message, panic_message),
64-
);
64+
)
6565
};
6666

6767
if let Some(debug_assert_span) = is_expn_of(e.span, "debug_assert") {

clippy_lints/src/attrs.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -277,7 +277,7 @@ impl<'tcx> LateLintPass<'tcx> for Attributes {
277277

278278
fn check_item(&mut self, cx: &LateContext<'tcx>, item: &'tcx Item<'_>) {
279279
if is_relevant_item(cx, item) {
280-
check_attrs(cx, item.span, item.ident.name, &item.attrs);
280+
check_attrs(cx, item.span, item.ident.name, &item.attrs)
281281
}
282282
match item.kind {
283283
ItemKind::ExternCrate(..) | ItemKind::Use(..) => {
@@ -353,13 +353,13 @@ impl<'tcx> LateLintPass<'tcx> for Attributes {
353353

354354
fn check_impl_item(&mut self, cx: &LateContext<'tcx>, item: &'tcx ImplItem<'_>) {
355355
if is_relevant_impl(cx, item) {
356-
check_attrs(cx, item.span, item.ident.name, &item.attrs);
356+
check_attrs(cx, item.span, item.ident.name, &item.attrs)
357357
}
358358
}
359359

360360
fn check_trait_item(&mut self, cx: &LateContext<'tcx>, item: &'tcx TraitItem<'_>) {
361361
if is_relevant_trait(cx, item) {
362-
check_attrs(cx, item.span, item.ident.name, &item.attrs);
362+
check_attrs(cx, item.span, item.ident.name, &item.attrs)
363363
}
364364
}
365365
}

clippy_lints/src/bit_mask.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -115,9 +115,9 @@ impl<'tcx> LateLintPass<'tcx> for BitMask {
115115
if let ExprKind::Binary(cmp, left, right) = &e.kind {
116116
if cmp.node.is_comparison() {
117117
if let Some(cmp_opt) = fetch_int_literal(cx, right) {
118-
check_compare(cx, left, cmp.node, cmp_opt, e.span);
118+
check_compare(cx, left, cmp.node, cmp_opt, e.span)
119119
} else if let Some(cmp_val) = fetch_int_literal(cx, left) {
120-
check_compare(cx, right, invert_cmp(cmp.node), cmp_val, e.span);
120+
check_compare(cx, right, invert_cmp(cmp.node), cmp_val, e.span)
121121
}
122122
}
123123
}
@@ -171,7 +171,7 @@ fn check_compare(cx: &LateContext<'_>, bit_op: &Expr<'_>, cmp_op: BinOpKind, cmp
171171
}
172172
fetch_int_literal(cx, right)
173173
.or_else(|| fetch_int_literal(cx, left))
174-
.map_or((), |mask| check_bit_mask(cx, op.node, cmp_op, mask, cmp_value, span));
174+
.map_or((), |mask| check_bit_mask(cx, op.node, cmp_op, mask, cmp_value, span))
175175
}
176176
}
177177

clippy_lints/src/booleans.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ impl<'tcx> LateLintPass<'tcx> for NonminimalBool {
6666
_: Span,
6767
_: HirId,
6868
) {
69-
NonminimalBoolVisitor { cx }.visit_body(body);
69+
NonminimalBoolVisitor { cx }.visit_body(body)
7070
}
7171
}
7272

@@ -184,7 +184,7 @@ impl<'a, 'tcx, 'v> SuggestContext<'a, 'tcx, 'v> {
184184
Term(n) => {
185185
let terminal = self.terminals[n as usize];
186186
if let Some(str) = simplify_not(self.cx, terminal) {
187-
self.output.push_str(&str);
187+
self.output.push_str(&str)
188188
} else {
189189
self.output.push('!');
190190
let snip = snippet_opt(self.cx, terminal.span)?;
@@ -452,7 +452,7 @@ impl<'a, 'tcx> Visitor<'tcx> for NonminimalBoolVisitor<'a, 'tcx> {
452452
}
453453
match &e.kind {
454454
ExprKind::Binary(binop, _, _) if binop.node == BinOpKind::Or || binop.node == BinOpKind::And => {
455-
self.bool_expr(e);
455+
self.bool_expr(e)
456456
},
457457
ExprKind::Unary(UnOp::UnNot, inner) => {
458458
if self.cx.typeck_results().node_types()[inner.hir_id].is_bool() {

clippy_lints/src/collapsible_if.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ declare_lint_pass!(CollapsibleIf => [COLLAPSIBLE_IF, COLLAPSIBLE_ELSE_IF]);
9292
impl EarlyLintPass for CollapsibleIf {
9393
fn check_expr(&mut self, cx: &EarlyContext<'_>, expr: &ast::Expr) {
9494
if !expr.span.from_expansion() {
95-
check_if(cx, expr);
95+
check_if(cx, expr)
9696
}
9797
}
9898
}

clippy_lints/src/comparison_chain.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@ impl<'tcx> LateLintPass<'tcx> for ComparisonChain {
118118
"`if` chain can be rewritten with `match`",
119119
None,
120120
"Consider rewriting the `if` chain to use `cmp` and `match`.",
121-
);
121+
)
122122
}
123123
}
124124

clippy_lints/src/eq_op.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,7 @@ impl<'tcx> LateLintPass<'tcx> for EqOp {
156156
vec![(left.span, lsnip), (right.span, rsnip)],
157157
);
158158
},
159-
);
159+
)
160160
} else if lcpy
161161
&& !rcpy
162162
&& implements_trait(cx, lty, trait_id, &[cx.typeck_results().expr_ty(right).into()])
@@ -175,7 +175,7 @@ impl<'tcx> LateLintPass<'tcx> for EqOp {
175175
Applicability::MaybeIncorrect, // FIXME #2597
176176
);
177177
},
178-
);
178+
)
179179
} else if !lcpy
180180
&& rcpy
181181
&& implements_trait(cx, cx.typeck_results().expr_ty(left), trait_id, &[rty.into()])
@@ -194,7 +194,7 @@ impl<'tcx> LateLintPass<'tcx> for EqOp {
194194
Applicability::MaybeIncorrect, // FIXME #2597
195195
);
196196
},
197-
);
197+
)
198198
}
199199
},
200200
// &foo == bar
@@ -218,7 +218,7 @@ impl<'tcx> LateLintPass<'tcx> for EqOp {
218218
Applicability::MaybeIncorrect, // FIXME #2597
219219
);
220220
},
221-
);
221+
)
222222
}
223223
},
224224
// foo == &bar
@@ -236,7 +236,7 @@ impl<'tcx> LateLintPass<'tcx> for EqOp {
236236
rsnip,
237237
Applicability::MaybeIncorrect, // FIXME #2597
238238
);
239-
});
239+
})
240240
}
241241
},
242242
_ => {},

clippy_lints/src/eta_reduction.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ impl<'tcx> LateLintPass<'tcx> for EtaReduction {
7474
match expr.kind {
7575
ExprKind::Call(_, args) | ExprKind::MethodCall(_, _, args, _) => {
7676
for arg in args {
77-
check_closure(cx, arg);
77+
check_closure(cx, arg)
7878
}
7979
},
8080
_ => (),

clippy_lints/src/eval_order_dependence.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ impl<'a, 'tcx> DivergenceVisitor<'a, 'tcx> {
116116
self.visit_expr(e);
117117
for arm in arms {
118118
if let Some(Guard::If(if_expr)) = arm.guard {
119-
self.visit_expr(if_expr);
119+
self.visit_expr(if_expr)
120120
}
121121
// make sure top level arm expressions aren't linted
122122
self.maybe_walk_expr(&*arm.body);

clippy_lints/src/functions.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -270,7 +270,7 @@ impl<'tcx> LateLintPass<'tcx> for Functions {
270270
_,
271271
)
272272
| intravisit::FnKind::ItemFn(_, _, hir::FnHeader { abi: Abi::Rust, .. }, _, _) => {
273-
self.check_arg_number(cx, decl, span.with_hi(decl.output.span().hi()));
273+
self.check_arg_number(cx, decl, span.with_hi(decl.output.span().hi()))
274274
},
275275
_ => {},
276276
}
@@ -434,7 +434,7 @@ impl<'tcx> Functions {
434434
TOO_MANY_LINES,
435435
span,
436436
&format!("this function has too many lines ({}/{})", line_count, self.max_lines),
437-
);
437+
)
438438
}
439439
}
440440

@@ -707,7 +707,7 @@ impl<'a, 'tcx> intravisit::Visitor<'tcx> for StaticMutVisitor<'a, 'tcx> {
707707
}
708708
},
709709
Assign(ref target, ..) | AssignOp(_, ref target, _) | AddrOf(_, hir::Mutability::Mut, ref target) => {
710-
self.mutates_static |= is_mutated_static(self.cx, target);
710+
self.mutates_static |= is_mutated_static(self.cx, target)
711711
},
712712
_ => {},
713713
}

clippy_lints/src/future_not_send.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ impl<'tcx> LateLintPass<'tcx> for FutureNotSend {
101101
));
102102
}
103103
}
104-
});
104+
})
105105
},
106106
);
107107
}

clippy_lints/src/infinite_iter.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ impl<'tcx> LateLintPass<'tcx> for InfiniteIter {
5353
return;
5454
},
5555
};
56-
span_lint(cx, lint, expr.span, msg);
56+
span_lint(cx, lint, expr.span, msg)
5757
}
5858
}
5959

clippy_lints/src/inherent_impl.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -85,8 +85,8 @@ impl<'tcx> LateLintPass<'tcx> for MultipleInherentImpl {
8585
|diag| {
8686
diag.span_note(*initial_span, "first implementation here");
8787
},
88-
);
89-
});
88+
)
89+
})
9090
}
9191
}
9292
}

clippy_lints/src/len_zero.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -256,9 +256,9 @@ fn check_cmp(cx: &LateContext<'_>, span: Span, method: &Expr<'_>, lit: &Expr<'_>
256256
}
257257
}
258258

259-
check_len(cx, span, method_path.ident.name, args, &lit.node, op, compare_to);
259+
check_len(cx, span, method_path.ident.name, args, &lit.node, op, compare_to)
260260
} else {
261-
check_empty_expr(cx, span, method, lit, op);
261+
check_empty_expr(cx, span, method, lit, op)
262262
}
263263
}
264264

clippy_lints/src/let_underscore.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,7 @@ impl<'tcx> LateLintPass<'tcx> for LetUnderscore {
143143
None,
144144
"consider using an underscore-prefixed named \
145145
binding or dropping explicitly with `std::mem::drop`"
146-
);
146+
)
147147
} else if implements_drop {
148148
span_lint_and_help(
149149
cx,
@@ -153,7 +153,7 @@ impl<'tcx> LateLintPass<'tcx> for LetUnderscore {
153153
None,
154154
"consider using an underscore-prefixed named \
155155
binding or dropping explicitly with `std::mem::drop`"
156-
);
156+
)
157157
} else if is_must_use_ty(cx, cx.typeck_results().expr_ty(init)) {
158158
span_lint_and_help(
159159
cx,
@@ -162,7 +162,7 @@ impl<'tcx> LateLintPass<'tcx> for LetUnderscore {
162162
"non-binding let on an expression with `#[must_use]` type",
163163
None,
164164
"consider explicitly using expression value"
165-
);
165+
)
166166
} else if is_must_use_func_call(cx, init) {
167167
span_lint_and_help(
168168
cx,
@@ -171,7 +171,7 @@ impl<'tcx> LateLintPass<'tcx> for LetUnderscore {
171171
"non-binding let on a result of a `#[must_use]` function",
172172
None,
173173
"consider explicitly using function result"
174-
);
174+
)
175175
}
176176
}
177177
}

clippy_lints/src/lifetimes.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -205,7 +205,7 @@ fn could_use_elision<'tcx>(
205205
output_visitor.visit_ty(ty);
206206
}
207207
for lt in named_generics {
208-
input_visitor.visit_generic_param(lt);
208+
input_visitor.visit_generic_param(lt)
209209
}
210210

211211
if input_visitor.abort() || output_visitor.abort() {
@@ -460,7 +460,7 @@ impl<'tcx> Visitor<'tcx> for LifetimeChecker {
460460
// `'b` in `'a: 'b` is useless unless used elsewhere in
461461
// a non-lifetime bound
462462
if let GenericParamKind::Type { .. } = param.kind {
463-
walk_generic_param(self, param);
463+
walk_generic_param(self, param)
464464
}
465465
}
466466
fn nested_visit_map(&mut self) -> NestedVisitorMap<Self::Map> {

clippy_lints/src/literal_representation.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -229,7 +229,7 @@ impl EarlyLintPass for LiteralDigitGrouping {
229229
}
230230

231231
if let ExprKind::Lit(ref lit) = expr.kind {
232-
self.check_lit(cx, lit);
232+
self.check_lit(cx, lit)
233233
}
234234
}
235235
}
@@ -292,7 +292,7 @@ impl LiteralDigitGrouping {
292292
}
293293
};
294294
if should_warn {
295-
warning_type.display(num_lit.format(), cx, lit.span);
295+
warning_type.display(num_lit.format(), cx, lit.span)
296296
}
297297
}
298298
}
@@ -422,7 +422,7 @@ impl EarlyLintPass for DecimalLiteralRepresentation {
422422
}
423423

424424
if let ExprKind::Lit(ref lit) = expr.kind {
425-
self.check_lit(cx, lit);
425+
self.check_lit(cx, lit)
426426
}
427427
}
428428
}
@@ -444,7 +444,7 @@ impl DecimalLiteralRepresentation {
444444
let hex = format!("{:#X}", val);
445445
let num_lit = NumericLiteral::new(&hex, num_lit.suffix, false);
446446
let _ = Self::do_lint(num_lit.integer).map_err(|warning_type| {
447-
warning_type.display(num_lit.format(), cx, lit.span);
447+
warning_type.display(num_lit.format(), cx, lit.span)
448448
});
449449
}
450450
}

0 commit comments

Comments
 (0)