about summary refs log tree commit diff
path: root/compiler/rustc_session/src/errors.rs
diff options
context:
space:
mode:
authorNicholas Nethercote <n.nethercote@gmail.com>2024-02-14 19:09:25 +1100
committerNicholas Nethercote <n.nethercote@gmail.com>2024-02-15 12:58:18 +1100
commit8b35f8e41ea501396c9fb77ed785f8beab90e999 (patch)
tree5784f5a90b8a07b9eae20197f71a776ddddcbac3 /compiler/rustc_session/src/errors.rs
parentee9c7c940c07d8b67c9a6b2ec930db70dcd23a46 (diff)
downloadrust-8b35f8e41ea501396c9fb77ed785f8beab90e999.tar.gz
rust-8b35f8e41ea501396c9fb77ed785f8beab90e999.zip
Remove `LitError::LexerError`.
`cook_lexer_literal` can emit an error about an invalid int literal but
then return a non-`Err` token. And then `integer_lit` has to account for
this to avoid printing a redundant error message.

This commit changes `cook_lexer_literal` to return `Err` in that case.
Then `integer_lit` doesn't need the special case, and
`LitError::LexerError` can be removed.
Diffstat (limited to 'compiler/rustc_session/src/errors.rs')
-rw-r--r--compiler/rustc_session/src/errors.rs3
1 files changed, 0 insertions, 3 deletions
diff --git a/compiler/rustc_session/src/errors.rs b/compiler/rustc_session/src/errors.rs
index c36cec6f353..e4bc6acf46c 100644
--- a/compiler/rustc_session/src/errors.rs
+++ b/compiler/rustc_session/src/errors.rs
@@ -375,9 +375,6 @@ pub fn report_lit_error(sess: &ParseSess, err: LitError, lit: token::Lit, span:
     let token::Lit { kind, symbol, suffix, .. } = lit;
     let dcx = &sess.dcx;
     match err {
-        // `LexerError` is an error, but it was already reported
-        // by lexer, so here we don't report it the second time.
-        LitError::LexerError => {}
         LitError::InvalidSuffix => {
             if let Some(suffix) = suffix {
                 dcx.emit_err(InvalidLiteralSuffix { span, kind: kind.descr(), suffix });