rust/src/test
Alex Crichton 5f39ceb729 std: Make abs() panic on overflow in debug mode
Debug overflow checks for arithmetic negation landed in #24500, at which time
the `abs` method on signed integers was changed to using `wrapping_neg` to
ensure that the function never panicked. This implied that `abs` of `INT_MIN`
would return `INT_MIN`, another negative value. When this change was back-ported
to beta, however, in #24708, the `wrapping_neg` function had not yet been
backported, so the implementation was changed in #24785 to `!self + 1`. This
change had the unintended side effect of enabling debug overflow checks for the
`abs` function. Consequently, the current state of affairs is that the beta
branch checks for overflow in debug mode for `abs` and the nightly branch does
not.

This commit alters the behavior of nightly to have `abs` always check for
overflow in debug mode. This change is more consistent with the way the standard
library treats overflow as well, and it is also not a breaking change as it's
what the beta branch currently does (albeit if by accident).

cc #25378
2015-05-18 17:51:23 -07:00
..
auxiliary Unignore some tests in stage1 2015-05-13 19:58:49 -04:00
bench Squeeze the last bits of tasks in documentation in favor of thread 2015-05-09 02:24:18 +09:00
codegen Mass rename uint/int to usize/isize 2015-03-26 12:10:22 -07:00
compile-fail Auto merge of #25338 - tamird:unignore-stage-tests, r=alexcrichton 2015-05-14 09:04:45 +00:00
compile-fail-fulldeps Unignore some tests in stage1 2015-05-13 19:58:49 -04:00
debuginfo Update tests to not use old ~ syntax 2015-05-03 20:16:03 -04:00
parse-fail Auto merge of #23606 - quantheory:associated_const, r=nikomatsakis 2015-04-27 16:45:21 +00:00
pretty Correct pretty-printing of type Foo<T> where T: Bound = ...; 2015-05-04 10:21:39 +02:00
run-fail Fix the tests broken by replacing task with thread 2015-05-09 04:04:08 +09:00
run-fail-fulldeps Move qquote.rs from run-fail to run-fail-fulldeps 2015-04-26 06:05:39 -07:00
run-make Add regression test for #20626 2015-05-07 00:25:54 +02:00
run-pass std: Make abs() panic on overflow in debug mode 2015-05-18 17:51:23 -07:00
run-pass-fulldeps Unignore some tests in stage1 2015-05-13 19:58:49 -04:00
run-pass-valgrind test: Fix fallout in run-pass tests 2015-04-14 10:14:19 -07:00
rustdoc rustdoc: Add Associated Constants section 2015-05-09 12:20:45 +02:00