Skip to content

Commit cd4abf9

Browse files
committed
Auto merge of #7268 - mbartlett21:update_semi, r=Manishearth
Move `semicolon_if_nothing_returned` to `pedantic` This moves the `semicolon_if_nothing_returned` lint to `pedantic` category. I had done #7148, but on the master branch, and Github doesn't seem to let me change that, so here's another PR changelog: Move [`semicolon_if_nothing_returned`] lint into `pedantic` category.
2 parents a248648 + bcebea6 commit cd4abf9

Some content is hidden

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

70 files changed

+154
-153
lines changed

clippy_lints/src/assertions_on_constants.rs

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

6969
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
@@ -273,7 +273,7 @@ impl<'tcx> LateLintPass<'tcx> for Attributes {
273273
fn check_item(&mut self, cx: &LateContext<'tcx>, item: &'tcx Item<'_>) {
274274
let attrs = cx.tcx.hir().attrs(item.hir_id());
275275
if is_relevant_item(cx, item) {
276-
check_attrs(cx, item.span, item.ident.name, attrs)
276+
check_attrs(cx, item.span, item.ident.name, attrs);
277277
}
278278
match item.kind {
279279
ItemKind::ExternCrate(..) | ItemKind::Use(..) => {
@@ -343,13 +343,13 @@ impl<'tcx> LateLintPass<'tcx> for Attributes {
343343

344344
fn check_impl_item(&mut self, cx: &LateContext<'tcx>, item: &'tcx ImplItem<'_>) {
345345
if is_relevant_impl(cx, item) {
346-
check_attrs(cx, item.span, item.ident.name, cx.tcx.hir().attrs(item.hir_id()))
346+
check_attrs(cx, item.span, item.ident.name, cx.tcx.hir().attrs(item.hir_id()));
347347
}
348348
}
349349

350350
fn check_trait_item(&mut self, cx: &LateContext<'tcx>, item: &'tcx TraitItem<'_>) {
351351
if is_relevant_trait(cx, item) {
352-
check_attrs(cx, item.span, item.ident.name, cx.tcx.hir().attrs(item.hir_id()))
352+
check_attrs(cx, item.span, item.ident.name, cx.tcx.hir().attrs(item.hir_id()));
353353
}
354354
}
355355
}

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::Not, 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
@@ -120,7 +120,7 @@ impl<'tcx> LateLintPass<'tcx> for ComparisonChain {
120120
"`if` chain can be rewritten with `match`",
121121
None,
122122
"consider rewriting the `if` chain to use `cmp` and `match`",
123-
)
123+
);
124124
}
125125
}
126126

clippy_lints/src/copies.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -476,7 +476,7 @@ fn emit_branches_sharing_code_lint(
476476
}
477477

478478
suggestions.push(("end", span, suggestion.to_string()));
479-
add_expr_note = !cx.typeck_results().expr_ty(if_expr).is_unit()
479+
add_expr_note = !cx.typeck_results().expr_ty(if_expr).is_unit();
480480
}
481481

482482
let add_optional_msgs = |diag: &mut DiagnosticBuilder<'_>| {

clippy_lints/src/default_numeric_fallback.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -181,9 +181,9 @@ impl<'a, 'tcx> Visitor<'tcx> for NumericFallbackVisitor<'a, 'tcx> {
181181
match stmt.kind {
182182
StmtKind::Local(local) => {
183183
if local.ty.is_some() {
184-
self.ty_bounds.push(TyBound::Any)
184+
self.ty_bounds.push(TyBound::Any);
185185
} else {
186-
self.ty_bounds.push(TyBound::Nothing)
186+
self.ty_bounds.push(TyBound::Nothing);
187187
}
188188
},
189189

clippy_lints/src/double_comparison.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -70,16 +70,16 @@ impl<'tcx> DoubleComparisons {
7070
#[rustfmt::skip]
7171
match (op, lkind, rkind) {
7272
(BinOpKind::Or, BinOpKind::Eq, BinOpKind::Lt) | (BinOpKind::Or, BinOpKind::Lt, BinOpKind::Eq) => {
73-
lint_double_comparison!(<=)
73+
lint_double_comparison!(<=);
7474
},
7575
(BinOpKind::Or, BinOpKind::Eq, BinOpKind::Gt) | (BinOpKind::Or, BinOpKind::Gt, BinOpKind::Eq) => {
76-
lint_double_comparison!(>=)
76+
lint_double_comparison!(>=);
7777
},
7878
(BinOpKind::Or, BinOpKind::Lt, BinOpKind::Gt) | (BinOpKind::Or, BinOpKind::Gt, BinOpKind::Lt) => {
79-
lint_double_comparison!(!=)
79+
lint_double_comparison!(!=);
8080
},
8181
(BinOpKind::And, BinOpKind::Le, BinOpKind::Ge) | (BinOpKind::And, BinOpKind::Ge, BinOpKind::Le) => {
82-
lint_double_comparison!(==)
82+
lint_double_comparison!(==);
8383
},
8484
_ => (),
8585
};

clippy_lints/src/entry.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -469,7 +469,7 @@ impl<'tcx> Visitor<'tcx> for InsertSearcher<'_, 'tcx> {
469469
let mut is_map_used = self.is_map_used;
470470
for arm in arms {
471471
if let Some(Guard::If(guard) | Guard::IfLet(_, guard)) = arm.guard {
472-
self.visit_non_tail_expr(guard)
472+
self.visit_non_tail_expr(guard);
473473
}
474474
is_map_used |= self.visit_cond_arm(arm.body);
475475
}

0 commit comments

Comments
 (0)