Account for incorrect attempts to declare "hexadecimal float literals" in E0308 #104706
Labels
A-diagnostics
Area: Messages for errors, warnings, and lints
T-compiler
Relevant to the compiler team, which will review and decide on the PR/issue.
If someone tries to write a hexadecimal float literal:
They will get the following output:
Executing
rustc --explain E0308
will give you:This is different from the much simpler "binary float literal is not supported" message one gets, when trying to use a literal like
0b11f32
.The problem is finding a "f32" at the end of a hexadecimal literal will be interpreted as part of the number, not a reference to float. If the user misses that, they will not get any help from either of the messages above.
Possible solution: the output of
rustc --explain E0308
could include the following explanation at the end:The text was updated successfully, but these errors were encountered: