Skip to content

rustc_trans: don't Assert(Overflow(Neg)) when overflow checks are off. #35300

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

Merged
merged 1 commit into from
Aug 4, 2016

Conversation

eddyb
Copy link
Member

@eddyb eddyb commented Aug 4, 2016

Generic functions using Neg on primitive types would panic even in release mode, with MIR trans.
The solution is a bit hacky, as I'm checking the message, since there's no dedicated CheckedUnOp.

Blocks Servo rustup (failure #1, failure #2) - this should be the last hurdle, it affects only one test.

@rust-highfive
Copy link
Contributor

r? @arielb1

(rust_highfive has picked a reviewer for you, use r? to override)

@eddyb eddyb force-pushed the mir-neg-overflow branch 2 times, most recently from a47ff4c to cfa911a Compare August 4, 2016 16:57
@eddyb eddyb force-pushed the mir-neg-overflow branch from cfa911a to fbabe61 Compare August 4, 2016 16:58
@arielb1
Copy link
Contributor

arielb1 commented Aug 4, 2016

@bors r+

This is a terribly hacky patch to a terribly hacky system, but to fix it we need to modify MIR for generic crates.

@bors
Copy link
Collaborator

bors commented Aug 4, 2016

📌 Commit fbabe61 has been approved by arielb1

@eddyb
Copy link
Member Author

eddyb commented Aug 4, 2016

@bors p=1 (for Servo)

@bors
Copy link
Collaborator

bors commented Aug 4, 2016

⌛ Testing commit fbabe61 with merge 545a3a9...

bors added a commit that referenced this pull request Aug 4, 2016
rustc_trans: don't Assert(Overflow(Neg)) when overflow checks are off.

Generic functions using `Neg` on primitive types would panic even in release mode, with MIR trans.
The solution is a bit hacky, as I'm checking the message, since there's no dedicated `CheckedUnOp`.

Blocks Servo rustup ([failure #1](http://build.servo.org/builders/linux-rel/builds/2477/steps/test_3/logs/stdio), [failure #2](http://build.servo.org/builders/mac-rel-css/builds/2364/steps/test/logs/stdio)) - this should be the last hurdle, it affects only one test.
@bors bors mentioned this pull request Aug 4, 2016
@bors bors merged commit fbabe61 into rust-lang:master Aug 4, 2016
@eddyb eddyb deleted the mir-neg-overflow branch August 4, 2016 21:55
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants