Make function items in mut visitors all go through the same visit_fn function, just like with immutable visitors
This commit is contained in:
parent
c064b363b9
commit
1b9ac0011f
5 changed files with 64 additions and 42 deletions
|
@ -239,22 +239,22 @@ impl MutVisitor for CfgEval<'_> {
|
|||
}
|
||||
|
||||
fn flat_map_item(&mut self, item: P<ast::Item>) -> SmallVec<[P<ast::Item>; 1]> {
|
||||
mut_visit::noop_flat_map_item(configure!(self, item), self)
|
||||
mut_visit::noop_flat_map_item(configure!(self, item), None, self)
|
||||
}
|
||||
|
||||
fn flat_map_assoc_item(
|
||||
&mut self,
|
||||
item: P<ast::AssocItem>,
|
||||
_ctxt: AssocCtxt,
|
||||
ctxt: AssocCtxt,
|
||||
) -> SmallVec<[P<ast::AssocItem>; 1]> {
|
||||
mut_visit::noop_flat_map_item(configure!(self, item), self)
|
||||
mut_visit::noop_flat_map_item(configure!(self, item), Some(ctxt), self)
|
||||
}
|
||||
|
||||
fn flat_map_foreign_item(
|
||||
&mut self,
|
||||
foreign_item: P<ast::ForeignItem>,
|
||||
) -> SmallVec<[P<ast::ForeignItem>; 1]> {
|
||||
mut_visit::noop_flat_map_item(configure!(self, foreign_item), self)
|
||||
mut_visit::noop_flat_map_item(configure!(self, foreign_item), None, self)
|
||||
}
|
||||
|
||||
fn flat_map_arm(&mut self, arm: ast::Arm) -> SmallVec<[ast::Arm; 1]> {
|
||||
|
|
|
@ -192,7 +192,7 @@ struct EntryPointCleaner<'a> {
|
|||
impl<'a> MutVisitor for EntryPointCleaner<'a> {
|
||||
fn flat_map_item(&mut self, i: P<ast::Item>) -> SmallVec<[P<ast::Item>; 1]> {
|
||||
self.depth += 1;
|
||||
let item = noop_flat_map_item(i, self).expect_one("noop did something");
|
||||
let item = noop_flat_map_item(i, None, self).expect_one("noop did something");
|
||||
self.depth -= 1;
|
||||
|
||||
// Remove any #[rustc_main] or #[start] from the AST so it doesn't
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue