Change:
The parameter is a hack (to fix ) that should be refactored. The idea is that the state should be contained in instead. This should be straightforward to fix. the parameter from (You'll also need to update the signature of in . a method with an identical signature below it. the condition from an early lint pass for at the end. a field to in (Look at for an example of a lint with fields.) You'll also need to initialise it with here: should be replaced with an assignment of the new field in to : should be early-exited if the field is . a implementation to and reset the field to if the pattern ID matches the field ID. sure the UI tests still pass with no changes.
hi I'm happy to take care of this one if it's not taken already.
go ahead! Let me know if you have any questions or problems with the implementation! :)

Discussion:
} fn visit_pat(&mut self, p: &'a ast::Pat) { <del> let mut visit_subpats = true; run_early_pass!(self, check_pat, p, &mut visit_subpats); </del> <ins> run_early_pass!(self, check_pat, p); </ins> self.check_id(p.id); <del> if visit_subpats { ast_visit::walk_pat(self, p); } </del> <ins> ast_visit::walk_pat(self, p); run_early_pass!(self, check_pat_post, p); </ins> } fn visit_expr(&mut self, e: &'a ast::Expr) {

fn check_block_post(a: &ast::Block); fn check_stmt(a: &ast::Stmt); fn check_arm(a: &ast::Arm); <del> fn check_pat(a: &ast::Pat, b: &mut bool); // FIXME: &mut bool looks just broken </del> <ins> fn check_pat(a: &ast::Pat); fn check_pat_post(a: &ast::Pat); </ins> fn check_expr(a: &ast::Expr); fn check_expr_post(a: &ast::Expr); fn check_ty(a: &ast::Ty);

"`...` range patterns are deprecated" } <del> declare_lint_pass!(EllipsisInclusiveRangePatterns => [ELLIPSIS_INCLUSIVE_RANGE_PATTERNS]); </del> <ins> pub struct EllipsisInclusiveRangePatterns { /// If `Some(_)`, suppress all subsequent pattern /// warnings for better diagnostics. node_id: Option<ast::NodeId>, } impl_lint_pass!(EllipsisInclusiveRangePatterns => [ELLIPSIS_INCLUSIVE_RANGE_PATTERNS]); impl EllipsisInclusiveRangePatterns { pub fn new() -> Self { Self { node_id: None, } } } </ins> impl EarlyLintPass for EllipsisInclusiveRangePatterns { <del> fn check_pat(&mut self, cx: &EarlyContext<'_>, pat: &ast::Pat, visit_subpats: &mut bool) { </del> <ins> fn check_pat(&mut self, cx: &EarlyContext<'_>, pat: &ast::Pat) { if self.node_id.is_some() { // Don't recursively warn about patterns inside range endpoints. return } </ins> use self::ast::{PatKind, RangeEnd, RangeSyntax::DotDotDot}; /// If `pat` is a `...` pattern, return the start and end of the range, as well as the span

let msg = "`...` range patterns are deprecated"; let suggestion = "use `..=` for an inclusive range"; if parenthesise { <del> *visit_subpats = false; </del> <ins> self.node_id = Some(pat.id); </ins> let mut err = cx.struct_span_lint(ELLIPSIS_INCLUSIVE_RANGE_PATTERNS, pat.span, msg); err.span_suggestion( pat.span,

}; } } <ins> fn check_pat_post(&mut self, _cx: &EarlyContext<'_>, pat: &ast::Pat) { if let Some(node_id) = self.node_id { if pat.id == node_id { self.node_id = None } } } </ins> } declare_lint! {

UnusedImportBraces: UnusedImportBraces, UnsafeCode: UnsafeCode, AnonymousParameters: AnonymousParameters, <del> EllipsisInclusiveRangePatterns: EllipsisInclusiveRangePatterns, </del> <ins> EllipsisInclusiveRangePatterns: EllipsisInclusiveRangePatterns::new(), </ins> NonCamelCaseTypes: NonCamelCaseTypes, DeprecatedAttr: DeprecatedAttr::new(), ]);

self.check_unused_parens_expr(cx, &value, msg, followed_by_block); } <del> fn check_pat(&mut self, cx: &EarlyContext<'_>, p: &ast::Pat, _: &mut bool) { </del> <ins> fn check_pat(&mut self, cx: &EarlyContext<'_>, p: &ast::Pat) { </ins> use ast::PatKind::{Paren, Range}; // The lint visitor will visit each subpattern of `p`. We do not want to lint any range // pattern no matter where it occurs in the pattern. For something like `&(a..=b)`, there