-
Notifications
You must be signed in to change notification settings - Fork 13.4k
!0u32/2 gives “error: attempted to divide with overflow in a constant expression [E0020]” #23968
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Comments
triage: I-wrong, P-high (1.0) |
triage: P-high (1.0) |
@nrc I ended up adding the 1.0 milestone by hand; isn't the above note with |
cc #23897 |
@pnkfelix the log above says that highfive did add this to the 1.0 milestone - it might just have been that your local view of the webpage needed refreshing? |
@nrc yeah I guess so, I don't know what happened anymore. Maybe I should have given highfive a little more time to react. |
Fixes #23968. Since the values are stored in a u64 internally, we need to be mask away the high bits after applying the ! operator. Otherwise, these bits will be set to one, causing overflow.
This affects the test suites for the
num
andrand
crates.The text was updated successfully, but these errors were encountered: