-
Notifications
You must be signed in to change notification settings - Fork 13k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
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.
- Loading branch information
Showing
7 changed files
with
17 additions
and
17 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,18 @@ | ||
error: invalid suffix `is` for integer literal | ||
error: invalid suffix `is` for number literal | ||
--> $DIR/old-suffixes-are-really-forbidden.rs:2:13 | ||
| | ||
LL | let a = 1_is; | ||
| ^^^^ invalid suffix `is` | ||
| | ||
= help: the suffix must be one of the integral types (`u32`, `isize`, etc) | ||
= help: the suffix must be one of the numeric types (`u32`, `isize`, `f32`, etc.) | ||
|
||
error: invalid suffix `us` for integer literal | ||
error: invalid suffix `us` for number literal | ||
--> $DIR/old-suffixes-are-really-forbidden.rs:3:13 | ||
| | ||
LL | let b = 2_us; | ||
| ^^^^ invalid suffix `us` | ||
| | ||
= help: the suffix must be one of the integral types (`u32`, `isize`, etc) | ||
= help: the suffix must be one of the numeric types (`u32`, `isize`, `f32`, etc.) | ||
|
||
error: aborting due to 2 previous errors | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,10 @@ | ||
error: invalid suffix `x` for integer literal | ||
error: invalid suffix `x` for number literal | ||
--> $DIR/ice-3891.rs:2:5 | ||
| | ||
LL | 1x; | ||
| ^^ invalid suffix `x` | ||
| | ||
= help: the suffix must be one of the integral types (`u32`, `isize`, etc) | ||
= help: the suffix must be one of the numeric types (`u32`, `isize`, `f32`, etc.) | ||
|
||
error: aborting due to previous error | ||
|