Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Chapter 3.2: Confusing introduction of numeric type suffixes #2854

Open
2 tasks done
jruderman opened this issue Sep 9, 2021 · 0 comments
Open
2 tasks done

Chapter 3.2: Confusing introduction of numeric type suffixes #2854

jruderman opened this issue Sep 9, 2021 · 0 comments
Milestone

Comments

@jruderman
Copy link
Contributor

  • 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 be u128, 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:

@carols10cents carols10cents added this to the ch3 milestone Sep 18, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants