diff options
| author | w00ns <w00ns@w00ns.top> | 2015-08-14 07:23:29 +0200 |
|---|---|---|
| committer | tof <christophe.trompette@gmail.com> | 2015-08-15 10:17:12 +0200 |
| commit | ae68e90af49c4cf9c75778e570d436fe36011b23 (patch) | |
| tree | acfa73523a2a03c977a841954b16be91b6c21568 /src/libsyntax/ext | |
| parent | e9205a20a8a22ab066b6596502cafc036fd4557c (diff) | |
| download | rust-ae68e90af49c4cf9c75778e570d436fe36011b23.tar.gz rust-ae68e90af49c4cf9c75778e570d436fe36011b23.zip | |
Fix issue with for loop expansion
Diffstat (limited to 'src/libsyntax/ext')
| -rw-r--r-- | src/libsyntax/ext/expand.rs | 11 |
1 files changed, 1 insertions, 10 deletions
diff --git a/src/libsyntax/ext/expand.rs b/src/libsyntax/ext/expand.rs index 6c09d6c107e..e61a0b5401e 100644 --- a/src/libsyntax/ext/expand.rs +++ b/src/libsyntax/ext/expand.rs @@ -385,16 +385,7 @@ pub fn expand_expr(e: P<ast::Expr>, fld: &mut MacroExpander) -> P<ast::Expr> { // expand <head> let head = fld.fold_expr(head); - // create an hygienic ident - let iter = { - let ident = fld.cx.ident_of("iter"); - let new_ident = fresh_name(&ident); - let rename = (ident, new_ident); - let mut rename_list = vec![rename]; - let mut rename_fld = IdentRenamer{ renames: &mut rename_list }; - - rename_fld.fold_ident(ident) - }; + let iter = token::gensym_ident("iter"); let pat_span = fld.new_span(pat.span); // `::std::option::Option::Some(<pat>) => <body>` |
