Skip to content

Commit 976c360

Browse files
committed
Use targeted_by_break
1 parent 68ecaf8 commit 976c360

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

clippy_lints/src/no_effect.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -356,8 +356,8 @@ fn reduce_expression<'a>(cx: &LateContext<'_>, expr: &'a Expr<'a>) -> Option<Vec
356356
None
357357
}
358358
},
359-
ExprKind::Block(block, label) => {
360-
if block.stmts.is_empty() && label.is_none() {
359+
ExprKind::Block(block, _) => {
360+
if block.stmts.is_empty() && !block.targeted_by_break {
361361
block.expr.as_ref().and_then(|e| {
362362
match block.rules {
363363
BlockCheckMode::UnsafeBlock(UnsafeSource::UserProvided) => None,

0 commit comments

Comments
 (0)