Skip to content

Commit 3be53bc

Browse files
committed
Auto merge of #79329 - camelid:int-lit-suffix-error, r=davidtwco
Update error to reflect that integer literals can have float suffixes For example, `1` is parsed as an integer literal, but it can be turned into a float with the suffix `f32`. Now the error calls them "numeric literals" and notes that you can add a float suffix since they can be either integers or floats.
2 parents d55d791 + 2347eac commit 3be53bc

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

tests/ui/crashes/ice-3891.stderr

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1-
error: invalid suffix `x` for integer literal
1+
error: invalid suffix `x` for number literal
22
--> $DIR/ice-3891.rs:2:5
33
|
44
LL | 1x;
55
| ^^ invalid suffix `x`
66
|
7-
= help: the suffix must be one of the integral types (`u32`, `isize`, etc)
7+
= help: the suffix must be one of the numeric types (`u32`, `isize`, `f32`, etc.)
88

99
error: aborting due to previous error
1010

0 commit comments

Comments
 (0)