Inline and remove {enter,exit}_attrs functions.

They each have a single call site.
This commit is contained in:
Nicholas Nethercote
2022-06-16 09:47:07 +10:00
parent c9e97251ad
commit be45f10a9c
2 changed files with 6 additions and 22 deletions

View File

@@ -63,20 +63,12 @@ impl<'a, T: EarlyLintPass> EarlyContextAndPass<'a, T> {
let push = self.context.builder.push(attrs, is_crate_node, None);
self.check_id(id);
self.enter_attrs(attrs);
f(self);
self.exit_attrs(attrs);
self.context.builder.pop(push);
}
fn enter_attrs(&mut self, attrs: &'a [ast::Attribute]) {
debug!("early context: enter_attrs({:?})", attrs);
run_early_pass!(self, enter_lint_attrs, attrs);
}
fn exit_attrs(&mut self, attrs: &'a [ast::Attribute]) {
f(self);
debug!("early context: exit_attrs({:?})", attrs);
run_early_pass!(self, exit_lint_attrs, attrs);
self.context.builder.pop(push);
}
}