mirror of
https://github.com/rust-lang/rust-clippy
synced 2024-11-27 23:20:39 +00:00
make cargo test pass, again
This commit is contained in:
parent
a7c3301b58
commit
a57445d4d6
1 changed files with 5 additions and 5 deletions
|
@ -72,7 +72,7 @@ declare_clippy_lint! {
|
||||||
///
|
///
|
||||||
/// ### Why is this bad?
|
/// ### Why is this bad?
|
||||||
///
|
///
|
||||||
/// Some may prefer if the semicolon is outside if a block is only one
|
/// Some may prefer if the semicolon is outside if a block is only one
|
||||||
/// expression, as this allows rustfmt to make it singleline. In the case that
|
/// expression, as this allows rustfmt to make it singleline. In the case that
|
||||||
/// it isn't, it should be inside.
|
/// it isn't, it should be inside.
|
||||||
/// Take a look at both `semicolon_inside_block` and `semicolon_outside_block` for alternatives.
|
/// Take a look at both `semicolon_inside_block` and `semicolon_outside_block` for alternatives.
|
||||||
|
@ -125,14 +125,14 @@ impl LateLintPass<'_> for SemicolonBlock {
|
||||||
..
|
..
|
||||||
} = stmt else { return };
|
} = stmt else { return };
|
||||||
semicolon_outside_block(cx, block, expr, span);
|
semicolon_outside_block(cx, block, expr, span);
|
||||||
semicolon_outside_block_if_singleline_check_outside(cx, block, expr, stmt.span)
|
semicolon_outside_block_if_singleline_check_outside(cx, block, expr, stmt.span);
|
||||||
},
|
},
|
||||||
StmtKind::Semi(Expr {
|
StmtKind::Semi(Expr {
|
||||||
kind: ExprKind::Block(block @ Block { expr: Some(tail), .. }, _),
|
kind: ExprKind::Block(block @ Block { expr: Some(tail), .. }, _),
|
||||||
..
|
..
|
||||||
}) if !block.span.from_expansion() => {
|
}) if !block.span.from_expansion() => {
|
||||||
semicolon_inside_block(cx, block, tail, stmt.span);
|
semicolon_inside_block(cx, block, tail, stmt.span);
|
||||||
semicolon_outside_block_if_singleline_check_inside(cx, block, tail, stmt.span)
|
semicolon_outside_block_if_singleline_check_inside(cx, block, tail, stmt.span);
|
||||||
},
|
},
|
||||||
_ => (),
|
_ => (),
|
||||||
}
|
}
|
||||||
|
@ -197,7 +197,7 @@ fn semicolon_outside_block_if_singleline_check_inside(
|
||||||
cx,
|
cx,
|
||||||
SEMICOLON_OUTSIDE_BLOCK_IF_SINGLELINE,
|
SEMICOLON_OUTSIDE_BLOCK_IF_SINGLELINE,
|
||||||
block.span,
|
block.span,
|
||||||
&format!("consider moving the `;` inside the block for consistent formatting"),
|
"consider moving the `;` inside the block for consistent formatting",
|
||||||
|diag| {
|
|diag| {
|
||||||
multispan_sugg_with_applicability(
|
multispan_sugg_with_applicability(
|
||||||
diag,
|
diag,
|
||||||
|
@ -228,7 +228,7 @@ fn semicolon_outside_block_if_singleline_check_outside(
|
||||||
cx,
|
cx,
|
||||||
SEMICOLON_OUTSIDE_BLOCK_IF_SINGLELINE,
|
SEMICOLON_OUTSIDE_BLOCK_IF_SINGLELINE,
|
||||||
block.span,
|
block.span,
|
||||||
&format!("consider moving the `;` outside the block for consistent formatting"),
|
"consider moving the `;` outside the block for consistent formatting",
|
||||||
|diag| {
|
|diag| {
|
||||||
multispan_sugg_with_applicability(
|
multispan_sugg_with_applicability(
|
||||||
diag,
|
diag,
|
||||||
|
|
Loading…
Reference in a new issue