@@ -33,10 +33,8 @@ pub struct EarlyContextAndPass<'ecx, 'tcx, T: EarlyLintPass> {
33
33
}
34
34
35
35
impl < ' ecx , ' tcx , T : EarlyLintPass > EarlyContextAndPass < ' ecx , ' tcx , T > {
36
- // This always-inlined function is for the hot call site.
37
- #[ inline( always) ]
38
36
#[ 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 ) {
40
38
for early_lint in self . context . buffered . take ( id) {
41
39
let BufferedEarlyLint { span, node_id : _, lint_id, diagnostic } = early_lint;
42
40
self . context . opt_span_lint ( lint_id. lint , span, |diag| {
@@ -45,11 +43,6 @@ impl<'ecx, 'tcx, T: EarlyLintPass> EarlyContextAndPass<'ecx, 'tcx, T> {
45
43
}
46
44
}
47
45
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
-
53
46
/// Merge the lints specified by any lint attributes into the
54
47
/// current lint context, call the provided function, then reset the
55
48
/// lints in effect to their previous state.
@@ -61,7 +54,6 @@ impl<'ecx, 'tcx, T: EarlyLintPass> EarlyContextAndPass<'ecx, 'tcx, T> {
61
54
debug ! ( ?id) ;
62
55
let push = self . context . builder . push ( attrs, is_crate_node, None ) ;
63
56
64
- self . inlined_check_id ( id) ;
65
57
debug ! ( "early context: enter_attrs({:?})" , attrs) ;
66
58
lint_callback ! ( self , check_attributes, attrs) ;
67
59
ensure_sufficient_stack ( || f ( self ) ) ;
@@ -136,12 +128,8 @@ impl<'ast, 'ecx, 'tcx, T: EarlyLintPass> ast_visit::Visitor<'ast>
136
128
// the AST struct that they wrap (e.g. an item)
137
129
self . with_lint_attrs ( s. id , s. attrs ( ) , |cx| {
138
130
lint_callback ! ( cx, check_stmt, s) ;
131
+ ast_visit:: walk_stmt ( cx, s) ;
139
132
} ) ;
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) ;
145
133
}
146
134
147
135
fn visit_fn ( & mut self , fk : ast_visit:: FnKind < ' ast > , span : Span , id : ast:: NodeId ) {
0 commit comments