diff --git a/src/libsyntax/config.rs b/src/libsyntax/config.rs index c164e89c52f3..41ad1611e3ec 100644 --- a/src/libsyntax/config.rs +++ b/src/libsyntax/config.rs @@ -14,6 +14,7 @@ use feature_gate::GatedCfgAttr; use fold::Folder; use {ast, fold, attr}; use codemap::{Spanned, respan}; +use parse::token; use ptr::P; use util::small_vector::SmallVector; @@ -247,6 +248,12 @@ impl fold::Folder for T { self.configure(item).map(|item| fold::noop_fold_trait_item(item, self)) .unwrap_or(SmallVector::zero()) } + + fn fold_interpolated(&mut self, nt: token::Nonterminal) -> token::Nonterminal { + // Don't configure interpolated AST (c.f. #34171). + // Interpolated AST will get configured once the surrounding tokens are parsed. + nt + } } fn fold_expr(folder: &mut F, expr: P) -> P {