about summary refs log tree commit diff
path: root/compiler/rustc_errors/src/lib.rs
diff options
context:
space:
mode:
author许杰友 Jieyou Xu (Joe) <jieyouxu@outlook.com>2023-02-14 17:31:58 +0800
committer许杰友 Jieyou Xu (Joe) <jieyouxu@outlook.com>2023-02-14 17:31:58 +0800
commit380fa264132ad481e73cbbf0f3a0feefd99a1d78 (patch)
tree337f10e0613cf08057868680ef2798d27089deef /compiler/rustc_errors/src/lib.rs
parentc3c6d73b04a718aceabc314bf231a20c90ccd601 (diff)
downloadrust-380fa264132ad481e73cbbf0f3a0feefd99a1d78.tar.gz
rust-380fa264132ad481e73cbbf0f3a0feefd99a1d78.zip
Don't recover lifetimes/labels containing emojis as character literals
Note that at the time of this commit, `unic-emoji-char` seems to have
data tables only up to Unicode 5.0, but Unicode is already newer than
this.

A newer emoji such as `🥺` will not be recognized as an emoji
but older emojis such as `🐱` will.
Diffstat (limited to 'compiler/rustc_errors/src/lib.rs')
-rw-r--r--compiler/rustc_errors/src/lib.rs2
1 files changed, 2 insertions, 0 deletions
diff --git a/compiler/rustc_errors/src/lib.rs b/compiler/rustc_errors/src/lib.rs
index 83b733d4c06..b310b191d52 100644
--- a/compiler/rustc_errors/src/lib.rs
+++ b/compiler/rustc_errors/src/lib.rs
@@ -471,6 +471,8 @@ pub enum StashKey {
     /// When an invalid lifetime e.g. `'2` should be reinterpreted
     /// as a char literal in the parser
     LifetimeIsChar,
+    /// When an invalid lifetime e.g. `'🐱` contains emoji.
+    LifetimeContainsEmoji,
     /// Maybe there was a typo where a comma was forgotten before
     /// FRU syntax
     MaybeFruTypo,