-
Notifications
You must be signed in to change notification settings - Fork 13.2k
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.." panics #35589
Comments
Mh, this issue looks interesting. Frist of all, in my opinition, I've been trying some things and found the following "interesting behaviour": The code
|
That’s amusing. I feel like overflow on debug was intentional (i.e. the stable/debug behaviour is the intended one). |
Looks like another regression that slipped through. cc @alexcrichton @brson; I don't know what we want to do about this issue, but if the regression is no longer a priority, it can be closed as a duplicate. Nightly output today, without release optimizations, is below. With them, it simply hangs.
|
This is what the documentation for
Iterator The fact that |
The range for
u8
does not work properly, it panics at the (valid) value 255. If this behavior is expected for bytes it should be documentated.I tried this code to check correctness and it panics:
fn main() { assert_eq!((0u8..).last(), Some(255)); }
Rusty greedings, Christopher
#24119
The text was updated successfully, but these errors were encountered: