librustc: Fix the issue with labels shadowing variable names by making

the leading quote part of the identifier for the purposes of hygiene.

This adopts @jbclements' solution to #14539.

I'm not sure if this is a breaking change or not.

Closes #12512.

[breaking-change]
This commit is contained in:
Patrick Walton
2014-06-10 13:54:13 -07:00
committed by Alex Crichton
parent e7f11f20e5
commit 2ed4734873
17 changed files with 159 additions and 89 deletions

View File

@@ -3452,7 +3452,7 @@ impl<'a> Parser<'a> {
match self.token {
token::LIFETIME(lifetime) => {
let lifetime_interned_string = token::get_ident(lifetime);
if lifetime_interned_string.equiv(&("static")) {
if lifetime_interned_string.equiv(&("'static")) {
result.push(StaticRegionTyParamBound);
if allow_any_lifetime && ret_lifetime.is_none() {
ret_lifetime = Some(ast::Lifetime {