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

Document bool cast semantics #20

Closed
steveklabnik opened this issue Mar 23, 2017 · 5 comments
Closed

Document bool cast semantics #20

steveklabnik opened this issue Mar 23, 2017 · 5 comments

Comments

@steveklabnik
Copy link
Member

Moved from rust-lang/rust#34729


After a short debate on the IRC over whether true as i32 is guaranteed to be 1, and false as i32 is guaranteed to be 0, I think that the semantics section on casts should explicitly describe what a bool as integer_type cast does.

@est31
Copy link
Member

est31 commented Mar 23, 2017

As I've said in rust-lang/rust#34729, it is defined indirectly in the reference, but not directly (yet).

@frewsxcv
Copy link
Member

Related to casting: #10

@matthewjasper
Copy link
Contributor

#13 closes this (unless the behavior is not in fact guaranteed to be true to 1, false to 0).

@chordowl
Copy link

Triage: looks like this is fixed now

@frewsxcv
Copy link
Member

Agreed, thanks for pointing it out!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants