about summary refs log tree commit diff
path: root/compiler/rustc_parse/src
diff options
context:
space:
mode:
authorNicholas Nethercote <n.nethercote@gmail.com>2024-02-28 16:30:20 +1100
committerNicholas Nethercote <n.nethercote@gmail.com>2024-02-28 20:59:32 +1100
commit840c8d3243761ac7d3976239aeba6f866f9df1eb (patch)
tree3d3fde2de7464721a26d5b2c9c7fbfefdbee64a5 /compiler/rustc_parse/src
parent79766098a469c72a24464e8157f58b3c6272f3d2 (diff)
downloadrust-840c8d3243761ac7d3976239aeba6f866f9df1eb.tar.gz
rust-840c8d3243761ac7d3976239aeba6f866f9df1eb.zip
Use `LitKind::Err` for floats with unsupported bases.
This slightly changes error messages in `float-field.rs`, but nothing of
real importance.
Diffstat (limited to 'compiler/rustc_parse/src')
-rw-r--r--compiler/rustc_parse/src/lexer/mod.rs4
1 files changed, 3 insertions, 1 deletions
diff --git a/compiler/rustc_parse/src/lexer/mod.rs b/compiler/rustc_parse/src/lexer/mod.rs
index 4523276970d..15ba80be1e6 100644
--- a/compiler/rustc_parse/src/lexer/mod.rs
+++ b/compiler/rustc_parse/src/lexer/mod.rs
@@ -515,7 +515,9 @@ impl<'sess, 'src> StringReader<'sess, 'src> {
                 };
                 if let Some(base) = base {
                     let span = self.mk_sp(start, end);
-                    self.dcx().emit_err(errors::FloatLiteralUnsupportedBase { span, base });
+                    let guar =
+                        self.dcx().emit_err(errors::FloatLiteralUnsupportedBase { span, base });
+                    kind = token::Err(guar)
                 }
                 (kind, self.symbol_from_to(start, end))
             }