Skip to content

Commit

Permalink
Target code from example issue rust-lang#6202
Browse files Browse the repository at this point in the history
  • Loading branch information
CalebLItalien committed Jun 30, 2024
1 parent 0ebd736 commit c014a68
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions tests/target/issue-6202/issue_example.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
// rustfmt-max_width: 120
// rustfmt-comment_width: 100
// rustfmt-match_block_trailing_comma: true
// rustfmt-wrap_comments: true
// rustfmt-edition: 2021
// rustfmt-error_on_line_overflow: true
// rustfmt-imports_granularity: Module
// rustfmt-version: Two

impl EarlyLintPass for NeedlessContinue {
fn check_expr(&mut self, cx: &EarlyContext<'_>, expr: &Expr) {
if let ExprKind::Loop(body, label, ..)
| ExprKind::While(_, body, label)
| ExprKind::ForLoop { body, label, .. } = &expr.kind
&& !in_external_macro(cx.sess, expr.span) {
check_final_block_stmt(cx, body, label, expr.span.ctxt());
}
}
}

0 comments on commit c014a68

Please sign in to comment.