diff options
| author | Oli Scherer <git-spam-no-reply9815368754983@oli-obk.de> | 2024-07-22 14:34:45 +0000 |
|---|---|---|
| committer | Oli Scherer <git-spam-no-reply9815368754983@oli-obk.de> | 2024-07-22 14:34:45 +0000 |
| commit | e9f32d0ca6f5ffdb3714e9817b4a93a59b247112 (patch) | |
| tree | 9049cc740135a827745e6014a478a20eb5eba9a9 /compiler/rustc_builtin_macros/src | |
| parent | 91b26fcb893c28150775323e2885155ea14cd36b (diff) | |
| download | rust-e9f32d0ca6f5ffdb3714e9817b4a93a59b247112.tar.gz rust-e9f32d0ca6f5ffdb3714e9817b4a93a59b247112.zip | |
Avoid passing state that will not be visited
Diffstat (limited to 'compiler/rustc_builtin_macros/src')
| -rw-r--r-- | compiler/rustc_builtin_macros/src/cfg_eval.rs | 8 | ||||
| -rw-r--r-- | compiler/rustc_builtin_macros/src/test_harness.rs | 4 |
2 files changed, 6 insertions, 6 deletions
diff --git a/compiler/rustc_builtin_macros/src/cfg_eval.rs b/compiler/rustc_builtin_macros/src/cfg_eval.rs index b45f5e83220..b3d252e06a5 100644 --- a/compiler/rustc_builtin_macros/src/cfg_eval.rs +++ b/compiler/rustc_builtin_macros/src/cfg_eval.rs @@ -242,16 +242,16 @@ impl MutVisitor for CfgEval<'_> { fn flat_map_item(&mut self, item: P<ast::Item>) -> SmallVec<[P<ast::Item>; 1]> { let item = configure!(self, item); - mut_visit::walk_flat_map_item(self, item, None) + mut_visit::walk_flat_map_item(self, item) } fn flat_map_assoc_item( &mut self, item: P<ast::AssocItem>, - ctxt: AssocCtxt, + _ctxt: AssocCtxt, ) -> SmallVec<[P<ast::AssocItem>; 1]> { let item = configure!(self, item); - mut_visit::walk_flat_map_item(self, item, Some(ctxt)) + mut_visit::walk_flat_map_item(self, item) } fn flat_map_foreign_item( @@ -259,7 +259,7 @@ impl MutVisitor for CfgEval<'_> { foreign_item: P<ast::ForeignItem>, ) -> SmallVec<[P<ast::ForeignItem>; 1]> { let foreign_item = configure!(self, foreign_item); - mut_visit::walk_flat_map_item(self, foreign_item, None) + mut_visit::walk_flat_map_item(self, foreign_item) } fn flat_map_arm(&mut self, arm: ast::Arm) -> SmallVec<[ast::Arm; 1]> { diff --git a/compiler/rustc_builtin_macros/src/test_harness.rs b/compiler/rustc_builtin_macros/src/test_harness.rs index f6b23c52b42..bbafb0ac299 100644 --- a/compiler/rustc_builtin_macros/src/test_harness.rs +++ b/compiler/rustc_builtin_macros/src/test_harness.rs @@ -144,7 +144,7 @@ impl<'a> MutVisitor for TestHarnessGenerator<'a> { item.kind { let prev_tests = mem::take(&mut self.tests); - walk_item_kind(&mut item.kind, item.ident, item.span, item.id, self); + walk_item_kind(&mut item.kind, item.span, item.id, self); self.add_test_cases(item.id, span, prev_tests); } else { // But in those cases, we emit a lint to warn the user of these missing tests. @@ -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 = walk_flat_map_item(self, i, None).expect_one("noop did something"); + let item = walk_flat_map_item(self, i).expect_one("noop did something"); self.depth -= 1; // Remove any #[rustc_main] or #[start] from the AST so it doesn't |
