Made Self
a keyword.
It is only allowed in paths now, where it will either work inside a `trait` or `impl` item, or not resolve outside of it. [breaking-change] Closes #22137
This commit is contained in:
parent
de8bc44753
commit
07d00deab2
12 changed files with 124 additions and 41 deletions
|
@ -1122,7 +1122,7 @@ impl<'a> StringReader<'a> {
|
|||
let keyword_checking_token =
|
||||
&token::Ident(keyword_checking_ident, token::Plain);
|
||||
let last_bpos = self.last_pos;
|
||||
if keyword_checking_token.is_keyword(token::keywords::Self) {
|
||||
if keyword_checking_token.is_keyword(token::keywords::SelfValue) {
|
||||
self.err_span_(start,
|
||||
last_bpos,
|
||||
"invalid lifetime name: 'self \
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue