diff options
| author | Aaron Hill <aa1ronham@gmail.com> | 2020-10-26 15:06:54 -0400 |
|---|---|---|
| committer | Aaron Hill <aa1ronham@gmail.com> | 2020-10-26 15:06:54 -0400 |
| commit | 174ed0c23ddbc04a82ad4e71856252c73d88fe5a (patch) | |
| tree | d884ecb85a74f646a75b2609f08bc5bc72f2b65a /compiler/rustc_interface/src | |
| parent | c96e11c781af319199af77347d55f08085e15453 (diff) | |
| download | rust-174ed0c23ddbc04a82ad4e71856252c73d88fe5a.tar.gz rust-174ed0c23ddbc04a82ad4e71856252c73d88fe5a.zip | |
Remove tokens from foreign items in `TokenStripper`
Fixes #78398 I forgot to handle this case in #77255
Diffstat (limited to 'compiler/rustc_interface/src')
| -rw-r--r-- | compiler/rustc_interface/src/passes.rs | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/compiler/rustc_interface/src/passes.rs b/compiler/rustc_interface/src/passes.rs index bbb47a6e807..9dbd59506b1 100644 --- a/compiler/rustc_interface/src/passes.rs +++ b/compiler/rustc_interface/src/passes.rs @@ -63,6 +63,13 @@ impl mut_visit::MutVisitor for TokenStripper { i.tokens = None; mut_visit::noop_flat_map_item(i, self) } + fn flat_map_foreign_item( + &mut self, + mut i: P<ast::ForeignItem>, + ) -> SmallVec<[P<ast::ForeignItem>; 1]> { + i.tokens = None; + mut_visit::noop_flat_map_foreign_item(i, self) + } fn visit_block(&mut self, b: &mut P<ast::Block>) { b.tokens = None; mut_visit::noop_visit_block(b, self); |
