mirror of
https://github.com/rust-lang/rust.git
synced 2024-12-13 17:13:48 +00:00
semicolon_if_nothing_returned
now checks if the stmt ends with semicolon
This commit is contained in:
parent
e8861c807a
commit
a003ca6853
@ -44,7 +44,7 @@ impl LateLintPass<'_> for SemicolonIfNothingReturned {
|
||||
let t_expr = cx.typeck_results().expr_ty(expr);
|
||||
if t_expr.is_unit();
|
||||
if let snippet = snippet_with_macro_callsite(cx, expr.span, "}");
|
||||
if !snippet.ends_with('}');
|
||||
if !snippet.ends_with('}') && !snippet.ends_with(';');
|
||||
if cx.sess().source_map().is_multiline(block.span);
|
||||
then {
|
||||
// filter out the desugared `for` loop
|
||||
|
Loading…
Reference in New Issue
Block a user