From 8254e5576090e086ab25220df9edae024d45a9dd Mon Sep 17 00:00:00 2001 From: Jeffrey Seyfried Date: Thu, 9 Jun 2016 00:26:35 +0000 Subject: [PATCH] Avoid configuring interpolated items. --- src/libsyntax/config.rs | 7 +++++++ 1 file changed, 7 insertions(+) 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 {