Avoid configuring interpolated items.

This commit is contained in:
Jeffrey Seyfried 2016-06-09 00:26:35 +00:00
parent 8519139ab4
commit 8254e55760

View file

@ -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<T: CfgFolder> 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<F: CfgFolder>(folder: &mut F, expr: P<ast::Expr>) -> P<ast::Expr> {