Open
Description
- I have checked the latest
main
branch to see if this has already been fixed - I have searched existing issues and pull requests for duplicates
URL to the section(s) of the book with this problem:
https://doc.rust-lang.org/book/ch03-02-data-types.html (but only in a newer version than on the web site)
Description of the problem:
Note that number literals that can be multiple numeric types allow a type suffix, such as 57u8, to designate the type.
- This raises the question of which number literals cannot be multiple numeric types. My first thought was
0xffff_ffff_ffff_ffff_ffff_ffff_ffff_ffff
, which can only beu128
, but it does accept the suffix. - Seeing the history of this text (Misleading "byte literal" mention in 3.2. Data Types #1979), I see that it's meant to exclude byte literals (as they could be considered a kind of number literal) without naming them (because byte literals haven't been introduced yet).
Suggested fix:
- Remove "that can be multiple numeric types", leaving a simpler sentence
- Or maybe partially revert Misleading "byte literal" mention in 3.2. Data Types #1979