about summary refs log tree commit diff
path: root/src/libsyntax/parse/token.rs
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2014-02-23 15:37:05 -0800
committerbors <bors@rust-lang.org>2014-02-23 15:37:05 -0800
commit329fcd48e508ebe41e6d2425c0f54b2210af401d (patch)
treeb5297ad96ec683968e1b5dee486710be4a7c8ab3 /src/libsyntax/parse/token.rs
parentcbed3321f5bbe4375819dd82193bd4299fabafb9 (diff)
parent386db05df8aa8349857ad6f5486db0bdcc79f3cd (diff)
downloadrust-329fcd48e508ebe41e6d2425c0f54b2210af401d.tar.gz
rust-329fcd48e508ebe41e6d2425c0f54b2210af401d.zip
auto merge of #12338 : edwardw/rust/hygienic-break-continue, r=cmr
Makes labelled loops hygiene by performing renaming of the labels defined in e.g. `'x: loop { ... }` and then used in break and continue statements within loop body so that they act hygienically when used with macros.
    
Closes #12262.
Diffstat (limited to 'src/libsyntax/parse/token.rs')
-rw-r--r--src/libsyntax/parse/token.rs4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/libsyntax/parse/token.rs b/src/libsyntax/parse/token.rs
index a2f3b65f06e..528eb7d54f3 100644
--- a/src/libsyntax/parse/token.rs
+++ b/src/libsyntax/parse/token.rs
@@ -704,8 +704,8 @@ pub fn is_reserved_keyword(tok: &Token) -> bool {
 
 pub fn mtwt_token_eq(t1 : &Token, t2 : &Token) -> bool {
     match (t1,t2) {
-        (&IDENT(id1,_),&IDENT(id2,_)) =>
-        ast_util::mtwt_resolve(id1) == ast_util::mtwt_resolve(id2),
+        (&IDENT(id1,_),&IDENT(id2,_)) | (&LIFETIME(id1),&LIFETIME(id2)) =>
+            ast_util::mtwt_resolve(id1) == ast_util::mtwt_resolve(id2),
         _ => *t1 == *t2
     }
 }