Skip to content

Commit 10dec7d

Browse files
committed
Remove visit_expr_post
1 parent 966e052 commit 10dec7d

File tree

2 files changed

+14
-19
lines changed

2 files changed

+14
-19
lines changed

compiler/rustc_ast/src/visitors.rs

+1-4
Original file line numberDiff line numberDiff line change
@@ -308,9 +308,6 @@ macro_rules! make_ast_visitor {
308308
fn visit_method_receiver_expr(&mut self, ex: &'ast Expr) -> Self::Result {
309309
self.visit_expr(ex)
310310
}
311-
fn visit_expr_post(&mut self, _ex: &'ast Expr) -> Self::Result {
312-
Self::Result::output()
313-
}
314311
}}
315312

316313
make_visit!{AngleBracketedArgs; visit_angle_bracketed_parameter_data, walk_angle_bracketed_parameter_data}
@@ -1877,7 +1874,7 @@ pub mod visit {
18771874
ExprKind::Dummy => {}
18781875
}
18791876

1880-
visitor.visit_expr_post(expression)
1877+
V::Result::output()
18811878
}
18821879
}
18831880

compiler/rustc_lint/src/early.rs

+13-15
Original file line numberDiff line numberDiff line change
@@ -121,6 +121,19 @@ impl<'a, T: EarlyLintPass> ast_visit::Visitor<'a> for EarlyContextAndPass<'a, T>
121121
self.with_lint_attrs(e.id, &e.attrs, |cx| {
122122
lint_callback!(cx, check_expr, e);
123123
ast_visit::walk_expr(cx, e);
124+
125+
// Explicitly check for lints associated with 'closure_id', since
126+
// it does not have a corresponding AST node
127+
match e.kind {
128+
ast::ExprKind::Closure(box ast::Closure {
129+
coroutine_kind: Some(coroutine_kind),
130+
..
131+
}) => {
132+
cx.check_id(coroutine_kind.closure_id());
133+
}
134+
_ => {}
135+
}
136+
lint_callback!(cx, check_expr_post, e);
124137
})
125138
}
126139

@@ -215,21 +228,6 @@ impl<'a, T: EarlyLintPass> ast_visit::Visitor<'a> for EarlyContextAndPass<'a, T>
215228
})
216229
}
217230

218-
fn visit_expr_post(&mut self, e: &'a ast::Expr) {
219-
// Explicitly check for lints associated with 'closure_id', since
220-
// it does not have a corresponding AST node
221-
match e.kind {
222-
ast::ExprKind::Closure(box ast::Closure {
223-
coroutine_kind: Some(coroutine_kind),
224-
..
225-
}) => {
226-
self.check_id(coroutine_kind.closure_id());
227-
}
228-
_ => {}
229-
}
230-
lint_callback!(self, check_expr_post, e);
231-
}
232-
233231
fn visit_generic_arg(&mut self, arg: &'a ast::GenericArg) {
234232
lint_callback!(self, check_generic_arg, arg);
235233
ast_visit::walk_generic_arg(self, arg);

0 commit comments

Comments
 (0)