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.
This commit is contained in:
@@ -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
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user