File tree Expand file tree Collapse file tree 1 file changed +0
-17
lines changed Expand file tree Collapse file tree 1 file changed +0
-17
lines changed Original file line number Diff line number Diff line change @@ -391,23 +391,6 @@ fn fold_arg_<T: Folder>(a: &Arg, fld: &mut T) -> Arg {
391
391
392
392
// build a new vector of tts by appling the Folder's fold_ident to
393
393
// 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.
411
394
pub fn fold_tts < T : Folder > ( tts : & [ TokenTree ] , fld : & mut T ) -> Vec < TokenTree > {
412
395
tts. iter ( ) . map ( |tt| {
413
396
match * tt {
You can’t perform that action at this time.
0 commit comments