|
1 | 1 | use crate::expand::{self, AstFragment, Invocation}; |
2 | 2 | use crate::module::DirectoryOwnership; |
3 | 3 |
|
4 | | -use rustc_ast::mut_visit::{self, MutVisitor}; |
5 | 4 | use rustc_ast::ptr::P; |
6 | 5 | use rustc_ast::token; |
7 | | -use rustc_ast::tokenstream::{self, TokenStream}; |
| 6 | +use rustc_ast::tokenstream::TokenStream; |
8 | 7 | use rustc_ast::visit::{AssocCtxt, Visitor}; |
9 | 8 | use rustc_ast::{self as ast, Attribute, NodeId, PatKind}; |
10 | 9 | use rustc_attr::{self as attr, Deprecation, HasAttrs, Stability}; |
@@ -364,30 +363,8 @@ where |
364 | 363 | &self, |
365 | 364 | ecx: &'cx mut ExtCtxt<'_>, |
366 | 365 | span: Span, |
367 | | - mut input: TokenStream, |
| 366 | + input: TokenStream, |
368 | 367 | ) -> Box<dyn MacResult + 'cx> { |
369 | | - struct AvoidInterpolatedIdents; |
370 | | - |
371 | | - impl MutVisitor for AvoidInterpolatedIdents { |
372 | | - fn visit_tt(&mut self, tt: &mut tokenstream::TokenTree) { |
373 | | - if let tokenstream::TokenTree::Token(token) = tt { |
374 | | - if let token::Interpolated(nt) = &token.kind { |
375 | | - if let token::NtIdent(ident, is_raw) = **nt { |
376 | | - *tt = tokenstream::TokenTree::token( |
377 | | - token::Ident(ident.name, is_raw), |
378 | | - ident.span, |
379 | | - ); |
380 | | - } |
381 | | - } |
382 | | - } |
383 | | - mut_visit::noop_visit_tt(tt, self) |
384 | | - } |
385 | | - |
386 | | - fn visit_mac(&mut self, mac: &mut ast::MacCall) { |
387 | | - mut_visit::noop_visit_mac(mac, self) |
388 | | - } |
389 | | - } |
390 | | - AvoidInterpolatedIdents.visit_tts(&mut input); |
391 | 368 | (*self)(ecx, span, input) |
392 | 369 | } |
393 | 370 | } |
|
0 commit comments