-
Notifications
You must be signed in to change notification settings - Fork 12.9k
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
0u8..-1 compiles without warning #25206
Comments
Hmm we cannot add warning because of compatibly? |
We can add a warning, but to make it a hard error would be breaking. |
I think this should error the same way as |
FWIW, I think we are contributing to Rust 1.1, so it's fine to break some 1.0 code. |
@bombless Point releases are not allowed to introduce backwards incompatible changes (except bug fixes). Only major releases (2.0) can do that. |
We could always make it a warning for 1.x series and note it will become an error in next major release. |
Hmm if somebody's quick enough to make a patch then we can backport it to beta branch and fix this in time. Also this can be considered a bug anyway. |
0u8..-1
compiles, runs (as 0..255) without warning or error. Debug assertions don't fire.We error on
0..-1u8
error: unary negation of unsigned integers may be removed in the future.We can't "fix" this backwards compatibly after 1.0.
0u8..-1
should either warn or trip debug assertions.The text was updated successfully, but these errors were encountered: