@@ -33,10 +33,8 @@ pub struct EarlyContextAndPass<'ecx, 'tcx, T: EarlyLintPass> {
3333}
3434
3535impl<'ecx, 'tcx, T: EarlyLintPass> EarlyContextAndPass<'ecx, 'tcx, T> {
36- // This always-inlined function is for the hot call site.
37- #[inline(always)]
3836 #[allow(rustc::diagnostic_outside_of_impl)]
39- fn inlined_check_id (&mut self, id: ast::NodeId) {
37+ fn check_id (&mut self, id: ast::NodeId) {
4038 for early_lint in self.context.buffered.take(id) {
4139 let BufferedEarlyLint { span, node_id: _, lint_id, diagnostic } = early_lint;
4240 self.context.opt_span_lint(lint_id.lint, span, |diag| {
@@ -45,11 +43,6 @@ impl<'ecx, 'tcx, T: EarlyLintPass> EarlyContextAndPass<'ecx, 'tcx, T> {
4543 }
4644 }
4745
48- // This non-inlined function is for the cold call sites.
49- fn check_id(&mut self, id: ast::NodeId) {
50- self.inlined_check_id(id)
51- }
52-
5346 /// Merge the lints specified by any lint attributes into the
5447 /// current lint context, call the provided function, then reset the
5548 /// lints in effect to their previous state.
@@ -61,7 +54,6 @@ impl<'ecx, 'tcx, T: EarlyLintPass> EarlyContextAndPass<'ecx, 'tcx, T> {
6154 debug!(?id);
6255 let push = self.context.builder.push(attrs, is_crate_node, None);
6356
64- self.inlined_check_id(id);
6557 debug!("early context: enter_attrs({:?})", attrs);
6658 lint_callback!(self, check_attributes, attrs);
6759 ensure_sufficient_stack(|| f(self));
@@ -136,12 +128,8 @@ impl<'ast, 'ecx, 'tcx, T: EarlyLintPass> ast_visit::Visitor<'ast>
136128 // the AST struct that they wrap (e.g. an item)
137129 self.with_lint_attrs(s.id, s.attrs(), |cx| {
138130 lint_callback!(cx, check_stmt, s);
131+ ast_visit::walk_stmt(cx, s);
139132 });
140- // The visitor for the AST struct wrapped
141- // by the statement (e.g. `Item`) will call
142- // `with_lint_attrs`, so do this walk
143- // outside of the above `with_lint_attrs` call
144- ast_visit::walk_stmt(self, s);
145133 }
146134
147135 fn visit_fn(&mut self, fk: ast_visit::FnKind<'ast>, span: Span, id: ast::NodeId) {
0 commit comments