-
Notifications
You must be signed in to change notification settings - Fork 13.4k
#[no_core] loses overflow checks with optimizations #38136
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
hanna-kruppe
pushed a commit
to hanna-kruppe/rust
that referenced
this issue
Jan 4, 2017
Due to rust-lang#28728 loop {} is very risky and can lead to fun debugging experiences like in rust-lang#38136. Besides, aborting is probably better behavior than an infinite loop.
steveklabnik
added a commit
to steveklabnik/rust
that referenced
this issue
Jan 4, 2017
book: use abort() over loop {} for panic Due to rust-lang#28728 `loop {}` is very risky and can lead to fun debugging experiences such as rust-lang#38136. Besides, aborting is probably better behavior than an infinite loop. r? @steveklabnik
frewsxcv
pushed a commit
to frewsxcv/rust
that referenced
this issue
Jan 9, 2017
Due to rust-lang#28728 loop {} is very risky and can lead to fun debugging experiences like in rust-lang#38136. Besides, aborting is probably better behavior than an infinite loop.
bors
added a commit
that referenced
this issue
Jan 10, 2017
book: use abort() over loop {} for panic Due to #28728 `loop {}` is very risky and can lead to fun debugging experiences such as #38136. Besides, aborting is probably better behavior than an infinite loop. r? @steveklabnik
# for free
to join this conversation on GitHub.
Already have an account?
# to comment
Uh oh!
There was an error while loading. Please reload this page.
The following file, when compiled without optimizations, correctly generates an overflow check in
add_one
:However, compiling with optimizations plus
-C debug-assertions=on
or-Z force-overflow-checks=on
generates code without the overflow check.However, if I move
add_one
to a separate no_core crate like this, the issue disappears and the overflow check is generated:The text was updated successfully, but these errors were encountered: