1
Fork 0

Consider lint check attributes on match arms in late lints

Additionally add analogous test for early lints.
This commit is contained in:
Ryo Yoshida 2023-05-18 20:33:07 +09:00
parent 19ca5692f6
commit ddafe23401
No known key found for this signature in database
GPG key ID: E25698A930586171
5 changed files with 82 additions and 41 deletions

View file

@ -240,8 +240,10 @@ impl<'tcx, T: LateLintPass<'tcx>> hir_visit::Visitor<'tcx> for LateContextAndPas
}
fn visit_arm(&mut self, a: &'tcx hir::Arm<'tcx>) {
lint_callback!(self, check_arm, a);
hir_visit::walk_arm(self, a);
self.with_lint_attrs(a.hir_id, |cx| {
lint_callback!(cx, check_arm, a);
hir_visit::walk_arm(cx, a);
})
}
fn visit_generic_param(&mut self, p: &'tcx hir::GenericParam<'tcx>) {