about summary refs log tree commit diff
path: root/compiler/rustc_errors/src
diff options
context:
space:
mode:
authorMatthias Krüger <matthias.krueger@famsik.de>2023-02-18 13:26:46 +0100
committerGitHub <noreply@github.com>2023-02-18 13:26:46 +0100
commit3035ccbcb972a7d762c8e3f64a6b200434677209 (patch)
tree14e538a50e8187007e1d40e81ad8b37c42b4ed48 /compiler/rustc_errors/src
parent3701bdc6333145410f009c83bd03f424eca05009 (diff)
parente3f9db5fc319c6d8eee5d47d216ea6a426070c41 (diff)
downloadrust-3035ccbcb972a7d762c8e3f64a6b200434677209.tar.gz
rust-3035ccbcb972a7d762c8e3f64a6b200434677209.zip
Rollup merge of #108031 - jieyouxu:issue-108019, r=estebank
Don't recover lifetimes/labels containing emojis as character literals

Fixes #108019.

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.

This PR leaves a couple of FIXMEs where `unic_emoji_char::is_emoji` is used.
Diffstat (limited to 'compiler/rustc_errors/src')
-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 4b3c0c055ad..8c39feca88a 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,