Rollup merge of #110135 - compiler-errors:revert-108031, r=davidtwco
Revert "Don't recover lifetimes/labels containing emojis as character literals" Reverts PR #108031 per https://github.com/rust-lang/rust/pull/109754#issuecomment-1490452045 Fixes (doesnt close until beta backported) #109746 This reverts commite3f9db5fc3
. This reverts commit98b82aedba
. This reverts commit380fa26413
.
This commit is contained in:
commit
57393be6fb
8 changed files with 17 additions and 178 deletions
|
@ -223,21 +223,16 @@ impl<'a> StringReader<'a> {
|
|||
};
|
||||
token::Literal(token::Lit { kind, symbol, suffix })
|
||||
}
|
||||
rustc_lexer::TokenKind::Lifetime { starts_with_number, contains_emoji } => {
|
||||
rustc_lexer::TokenKind::Lifetime { starts_with_number } => {
|
||||
// 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);
|
||||
if starts_with_number {
|
||||
let span = self.mk_sp(start, self.pos);
|
||||
let mut diag = self.sess.struct_err("lifetimes or labels cannot start with a number");
|
||||
let mut diag = self.sess.struct_err("lifetimes cannot start with a number");
|
||||
diag.set_span(span);
|
||||
diag.stash(span, StashKey::LifetimeIsChar);
|
||||
} else if contains_emoji {
|
||||
let span = self.mk_sp(start, self.pos);
|
||||
let mut diag = self.sess.struct_err("lifetimes or labels cannot contain emojis");
|
||||
diag.set_span(span);
|
||||
diag.stash(span, StashKey::LifetimeContainsEmoji);
|
||||
}
|
||||
let ident = Symbol::intern(lifetime_name);
|
||||
token::Lifetime(ident)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue