]> git.lizzy.rs Git - rust.git/commitdiff
Auto merge of #25778 - econoplas:master, r=pnkfelix
authorbors <bors@rust-lang.org>
Tue, 26 May 2015 09:49:36 +0000 (09:49 +0000)
committerbors <bors@rust-lang.org>
Tue, 26 May 2015 09:49:36 +0000 (09:49 +0000)
A regression was introduced by commit https://github.com/rust-lang/rust/commit/7b1916d25347913fce3e336517ef22025ccd875f #25612.  Negative signed integer literals less than -9223372036854775808i64 were no longer properly reported as #[warn(overflowing_literals)].

Also adding missing test cases to test/compile-fail/lint-type-overflow.rs which could have detected the regression.

Further explanation:

The expression `(negative && v > max as u64 + 1)` relies on the fact that algebraically speaking `-min == max + 1` to avoid negation and removing the need for `min` completely.

If i128 or i256 are ever added, it should also work for these types without requiring a change to `min != i64::MIN &&` also simplifying maintenance.

r? @pnkfelix


Trivial merge