about summary refs log tree commit diff
path: root/compiler/rustc_errors/src
diff options
context:
space:
mode:
authorDylan DPC <99973273+Dylan-DPC@users.noreply.github.com>2022-10-23 15:20:16 +0530
committerGitHub <noreply@github.com>2022-10-23 15:20:16 +0530
commite029c1fd43b1306355e273dee94ff0a5e6b1ef3d (patch)
tree1f2539afbb39106f8e038c7ac0d5882923e6679b /compiler/rustc_errors/src
parentfaab68eb29121f25b577b50e2e00e33bafc60a36 (diff)
parent0270b50eb093304c563e1def677ef38a72ac53c1 (diff)
downloadrust-e029c1fd43b1306355e273dee94ff0a5e6b1ef3d.tar.gz
rust-e029c1fd43b1306355e273dee94ff0a5e6b1ef3d.zip
Rollup merge of #101293 - compiler-errors:lt-is-actually-char, r=estebank
Recover when unclosed char literal is parsed as a lifetime in some positions

Fixes #101278
Diffstat (limited to 'compiler/rustc_errors/src')
-rw-r--r--compiler/rustc_errors/src/lib.rs3
1 files changed, 3 insertions, 0 deletions
diff --git a/compiler/rustc_errors/src/lib.rs b/compiler/rustc_errors/src/lib.rs
index 9fafbe4bd40..0963ea71f80 100644
--- a/compiler/rustc_errors/src/lib.rs
+++ b/compiler/rustc_errors/src/lib.rs
@@ -463,6 +463,9 @@ pub enum StashKey {
     UnderscoreForArrayLengths,
     EarlySyntaxWarning,
     CallIntoMethod,
+    /// When an invalid lifetime e.g. `'2` should be reinterpreted
+    /// as a char literal in the parser
+    LifetimeIsChar,
 }
 
 fn default_track_diagnostic(_: &Diagnostic) {}