Reserve prefix lifetimes too
This commit is contained in:
parent
59d4114b2d
commit
9aaf873396
4 changed files with 51 additions and 9 deletions
|
@ -205,6 +205,16 @@ impl<'psess, 'src> StringReader<'psess, 'src> {
|
|||
self.report_unknown_prefix(start);
|
||||
self.ident(start)
|
||||
}
|
||||
rustc_lexer::TokenKind::UnknownPrefixLifetime => {
|
||||
self.report_unknown_prefix(start);
|
||||
// Include the leading `'` in the real identifier, for macro
|
||||
// expansion purposes. See #12512 for the gory details of why
|
||||
// this is necessary.
|
||||
let lifetime_name = self.str_from(start);
|
||||
self.last_lifetime = Some(self.mk_sp(start, start + BytePos(1)));
|
||||
let ident = Symbol::intern(lifetime_name);
|
||||
token::Lifetime(ident, IdentIsRaw::No)
|
||||
}
|
||||
rustc_lexer::TokenKind::InvalidIdent
|
||||
| rustc_lexer::TokenKind::InvalidPrefix
|
||||
// Do not recover an identifier with emoji if the codepoint is a confusable
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue