diff options
| author | Aaron Hill <aa1ronham@gmail.com> | 2020-10-29 11:37:55 -0400 |
|---|---|---|
| committer | Aaron Hill <aa1ronham@gmail.com> | 2020-10-29 11:39:38 -0400 |
| commit | 4ba57aa703397a34e92f055c9e07bc880b771226 (patch) | |
| tree | 534ab1ad48edaaa1e574a1b0bcd0d8ee9878475e /compiler/rustc_interface/src | |
| parent | a53fb30e3bf2655b0563da6d561c23cda5f3ec11 (diff) | |
Strip tokens from trait and impl items before printing AST JSON
Fixes #78510
Diffstat (limited to 'compiler/rustc_interface/src')
| -rw-r--r-- | compiler/rustc_interface/src/passes.rs | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/compiler/rustc_interface/src/passes.rs b/compiler/rustc_interface/src/passes.rs index 9dbd59506b1..a1487aa0060 100644 --- a/compiler/rustc_interface/src/passes.rs +++ b/compiler/rustc_interface/src/passes.rs @@ -70,6 +70,17 @@ impl mut_visit::MutVisitor for TokenStripper { i.tokens = None; mut_visit::noop_flat_map_foreign_item(i, self) } + fn flat_map_trait_item( + &mut self, + mut i: P<ast::AssocItem>, + ) -> SmallVec<[P<ast::AssocItem>; 1]> { + i.tokens = None; + mut_visit::noop_flat_map_assoc_item(i, self) + } + fn flat_map_impl_item(&mut self, mut i: P<ast::AssocItem>) -> SmallVec<[P<ast::AssocItem>; 1]> { + i.tokens = None; + mut_visit::noop_flat_map_assoc_item(i, self) + } fn visit_block(&mut self, b: &mut P<ast::Block>) { b.tokens = None; mut_visit::noop_visit_block(b, self); |
