diff options
| author | Oli Scherer <git-spam-no-reply9815368754983@oli-obk.de> | 2024-07-09 09:43:38 +0000 |
|---|---|---|
| committer | Oli Scherer <git-spam-no-reply9815368754983@oli-obk.de> | 2024-07-22 14:01:23 +0000 |
| commit | 545553ca4ffde01272dbeaba8ac12e90600bcf46 (patch) | |
| tree | 38475bce418fbaab8f4310cdf975be2dbebe5552 /compiler/rustc_builtin_macros/src | |
| parent | 1b9ac0011f8c871edf9515503e9e38fb7d1c777b (diff) | |
| download | rust-545553ca4ffde01272dbeaba8ac12e90600bcf46.tar.gz rust-545553ca4ffde01272dbeaba8ac12e90600bcf46.zip | |
Pass id and span to `visit_fn`, just like for the immutable visitor
Diffstat (limited to 'compiler/rustc_builtin_macros/src')
| -rw-r--r-- | compiler/rustc_builtin_macros/src/test_harness.rs | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/compiler/rustc_builtin_macros/src/test_harness.rs b/compiler/rustc_builtin_macros/src/test_harness.rs index 4fd1f1ac2dc..5b1aedda904 100644 --- a/compiler/rustc_builtin_macros/src/test_harness.rs +++ b/compiler/rustc_builtin_macros/src/test_harness.rs @@ -129,8 +129,8 @@ impl<'a> MutVisitor for TestHarnessGenerator<'a> { c.items.push(mk_main(&mut self.cx)); } - fn flat_map_item(&mut self, i: P<ast::Item>) -> SmallVec<[P<ast::Item>; 1]> { - let mut item = i.into_inner(); + fn flat_map_item(&mut self, mut i: P<ast::Item>) -> SmallVec<[P<ast::Item>; 1]> { + let item = &mut *i; if let Some(name) = get_test_name(&item) { debug!("this is a test item"); @@ -144,13 +144,13 @@ impl<'a> MutVisitor for TestHarnessGenerator<'a> { item.kind { let prev_tests = mem::take(&mut self.tests); - noop_visit_item_kind(&mut item.kind, self); + noop_visit_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. walk_item(&mut InnerItemLinter { sess: self.cx.ext_cx.sess }, &item); } - smallvec![P(item)] + smallvec![i] } } |
