Make break and continue hygienic
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:
parent
551da06157
commit
386db05df8
18 changed files with 262 additions and 28 deletions
|
@ -490,7 +490,7 @@ impl CFGBuilder {
|
|||
|
||||
fn find_scope(&self,
|
||||
expr: @ast::Expr,
|
||||
label: Option<ast::Name>) -> LoopScope {
|
||||
label: Option<ast::Ident>) -> LoopScope {
|
||||
match label {
|
||||
None => {
|
||||
return *self.loop_scopes.last().unwrap();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue