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:
Edward Wang 2014-02-15 16:54:32 +08:00
parent 551da06157
commit 386db05df8
18 changed files with 262 additions and 28 deletions

View file

@ -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();