Skip to content

Commit

Permalink
Rollup merge of rust-lang#121724 - nnethercote:LitKind-Err-for-floats…
Browse files Browse the repository at this point in the history
…, r=fmease

Use `LitKind::Err` for malformed floats

rust-lang#121120 changed `StringReader::cook_lexer_literal` to return `LitKind::Err` for malformed integer literals. This commit does the same for float literals, for consistency.

r? ``@fmease``
  • Loading branch information
matthiaskrgr committed Feb 28, 2024
2 parents e3b8b52 + 1ba47ea commit f055f2a
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 12 deletions.
2 changes: 0 additions & 2 deletions tests/ui/crashes/ice-10912.rs
Expand Up @@ -2,7 +2,5 @@
//@no-rustfix
fn f2() -> impl Sized { && 3.14159265358979323846E }
//~^ ERROR: expected at least one digit in exponent
//~| ERROR: long literal lacking separators
//~| NOTE: `-D clippy::unreadable-literal` implied by `-D warnings`

fn main() {}
11 changes: 1 addition & 10 deletions tests/ui/crashes/ice-10912.stderr
Expand Up @@ -4,14 +4,5 @@ error: expected at least one digit in exponent
LL | fn f2() -> impl Sized { && 3.14159265358979323846E }
| ^^^^^^^^^^^^^^^^^^^^^^^

error: long literal lacking separators
--> tests/ui/crashes/ice-10912.rs:3:28
|
LL | fn f2() -> impl Sized { && 3.14159265358979323846E }
| ^^^^^^^^^^^^^^^^^^^^^^^ help: consider: `3.141_592_653_589_793_238_46`
|
= note: `-D clippy::unreadable-literal` implied by `-D warnings`
= help: to override `-D warnings` add `#[allow(clippy::unreadable_literal)]`

error: aborting due to 2 previous errors
error: aborting due to 1 previous error

0 comments on commit f055f2a

Please sign in to comment.