diff options
| author | Oli Scherer <github333195615777966@oli-obk.de> | 2025-02-01 10:06:35 +0000 |
|---|---|---|
| committer | Oli Scherer <github333195615777966@oli-obk.de> | 2025-02-05 11:28:24 +0000 |
| commit | 9a2073d50059708d9150204348bbea087cd5f9c8 (patch) | |
| tree | 15daee38fa554f421f7bd08487f4921ecdb95213 /compiler/rustc_lint/src/late.rs | |
| parent | 9f5473f7ad7b0bc9a100d82a39142f714a2b48f7 (diff) | |
| download | rust-9a2073d50059708d9150204348bbea087cd5f9c8.tar.gz rust-9a2073d50059708d9150204348bbea087cd5f9c8.zip | |
Uniformly handle HIR literals in visitors and lints
Diffstat (limited to 'compiler/rustc_lint/src/late.rs')
| -rw-r--r-- | compiler/rustc_lint/src/late.rs | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/compiler/rustc_lint/src/late.rs b/compiler/rustc_lint/src/late.rs index 826ecc22c24..3ee908ba9bf 100644 --- a/compiler/rustc_lint/src/late.rs +++ b/compiler/rustc_lint/src/late.rs @@ -152,6 +152,10 @@ impl<'tcx, T: LateLintPass<'tcx>> hir_visit::Visitor<'tcx> for LateContextAndPas hir_visit::walk_pat(self, p); } + fn visit_lit(&mut self, hir_id: HirId, lit: &'tcx hir::Lit, negated: bool) { + lint_callback!(self, check_lit, hir_id, lit, negated); + } + fn visit_expr_field(&mut self, field: &'tcx hir::ExprField<'tcx>) { self.with_lint_attrs(field.hir_id, |cx| hir_visit::walk_expr_field(cx, field)) } |
