Skip to content

Commit 2f4c541

Browse files
committed
---
yaml --- r: 152918 b: refs/heads/try2 c: 268f6c5 h: refs/heads/master v: v3
1 parent 77e4ecd commit 2f4c541

File tree

2 files changed

+1
-18
lines changed

2 files changed

+1
-18
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ refs/heads/snap-stage3: 78a7676898d9f80ab540c6df5d4c9ce35bb50463
55
refs/heads/try: 519addf6277dbafccbb4159db4b710c37eaa2ec5
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b
8-
refs/heads/try2: 351a5fd2b40c2be90f94fe2580903e93353b95ee
8+
refs/heads/try2: 268f6c56c219e97b444d78dadc387cc549e27aa6
99
refs/heads/dist-snap: ba4081a5a8573875fed17545846f6f6902c8ba8d
1010
refs/tags/release-0.2: c870d2dffb391e14efb05aa27898f1f6333a9596
1111
refs/tags/release-0.3: b5f0d0f648d9a6153664837026ba1be43d3e2503

branches/try2/src/libsyntax/fold.rs

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -391,23 +391,6 @@ fn fold_arg_<T: Folder>(a: &Arg, fld: &mut T) -> Arg {
391391

392392
// build a new vector of tts by appling the Folder's fold_ident to
393393
// all of the identifiers in the token trees.
394-
//
395-
// This is part of hygiene magic. As far as hygiene is concerned, there
396-
// are three types of let pattern bindings or loop labels:
397-
// - those defined and used in non-macro part of the program
398-
// - those used as part of macro invocation arguments
399-
// - those defined and used inside macro definitions
400-
// Lexically, type 1 and 2 are in one group and type 3 the other. If they
401-
// clash, in order for let and loop label to work hygienically, one group
402-
// or the other needs to be renamed. The problem is that type 2 and 3 are
403-
// parsed together (inside the macro expand function). After being parsed and
404-
// AST being constructed, they can no longer be distinguished from each other.
405-
//
406-
// For that reason, type 2 let bindings and loop labels are actually renamed
407-
// in the form of tokens instead of AST nodes, here. There are wasted effort
408-
// since many token::IDENT are not necessary part of let bindings and most
409-
// token::LIFETIME are certainly not loop labels. But we can't tell in their
410-
// token form. So this is less ideal and hacky but it works.
411394
pub fn fold_tts<T: Folder>(tts: &[TokenTree], fld: &mut T) -> Vec<TokenTree> {
412395
tts.iter().map(|tt| {
413396
match *tt {

0 commit comments

Comments
 (0)