mirror of
https://github.com/rust-lang/rust-clippy
synced 2025-02-17 14:38:46 +00:00
Add test case for blocks with semicolon inside and outside a block
This commit is contained in:
parent
f62eab4312
commit
20ec2ceab8
5 changed files with 14 additions and 3 deletions
|
@ -8,11 +8,13 @@ use rustc_span::Span;
|
|||
declare_clippy_lint! {
|
||||
/// ### What it does
|
||||
///
|
||||
/// Suggests moving the semicolon from a block inside of the block to its kast expression.
|
||||
/// Suggests moving the semicolon after a block to the inside of the block, after its last
|
||||
/// expression.
|
||||
///
|
||||
/// ### Why is this bad?
|
||||
///
|
||||
/// For consistency it's best to have the semicolon inside/outside the block. Either way is fine and this lint suggests inside the block.
|
||||
/// For consistency it's best to have the semicolon inside/outside the block. Either way is fine
|
||||
/// and this lint suggests inside the block.
|
||||
/// Take a look at `semicolon_outside_block` for the other alternative.
|
||||
///
|
||||
/// ### Example
|
||||
|
@ -40,7 +42,8 @@ declare_clippy_lint! {
|
|||
///
|
||||
/// ### Why is this bad?
|
||||
///
|
||||
/// For consistency it's best to have the semicolon inside/outside the block. Either way is fine and this lint suggests outside the block.
|
||||
/// For consistency it's best to have the semicolon inside/outside the block. Either way is fine
|
||||
/// and this lint suggests outside the block.
|
||||
/// Take a look at `semicolon_inside_block` for the other alternative.
|
||||
///
|
||||
/// ### Example
|
||||
|
|
|
@ -79,5 +79,7 @@ fn main() {
|
|||
unit_fn_block()
|
||||
};
|
||||
|
||||
{ unit_fn_block(); };
|
||||
|
||||
unit_fn_block()
|
||||
}
|
||||
|
|
|
@ -79,5 +79,7 @@ fn main() {
|
|||
unit_fn_block()
|
||||
};
|
||||
|
||||
{ unit_fn_block(); };
|
||||
|
||||
unit_fn_block()
|
||||
}
|
||||
|
|
|
@ -79,5 +79,7 @@ fn main() {
|
|||
unit_fn_block()
|
||||
};
|
||||
|
||||
{ unit_fn_block(); };
|
||||
|
||||
unit_fn_block()
|
||||
}
|
||||
|
|
|
@ -79,5 +79,7 @@ fn main() {
|
|||
unit_fn_block()
|
||||
};
|
||||
|
||||
{ unit_fn_block(); };
|
||||
|
||||
unit_fn_block()
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue