diff options
| author | bors <bors@rust-lang.org> | 2015-05-21 00:52:27 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2015-05-21 00:52:27 +0000 |
| commit | 9ee4eadb6f73e6a85d9e70c6ed2e418a3391988b (patch) | |
| tree | 2793e28ee6821b8fe3cae06933e5ca780de3513a | |
| parent | c575885e2561db36d3c7434192190e3dd025bd78 (diff) | |
| parent | 7b1916d25347913fce3e336517ef22025ccd875f (diff) | |
Auto merge of #25612 - petrochenkov:lintabs, r=@alexcrichton
Reported here https://github.com/rust-lang/rust/pull/25441#issuecomment-103513930
| -rw-r--r-- | src/librustc_lint/builtin.rs | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/librustc_lint/builtin.rs b/src/librustc_lint/builtin.rs index a660c708f4a..6721c4a6636 100644 --- a/src/librustc_lint/builtin.rs +++ b/src/librustc_lint/builtin.rs @@ -206,8 +206,8 @@ impl LintPass for TypeLimits { let (min, max) = int_ty_range(int_type); let negative = self.negated_expr_id == e.id; - if (negative && v > min.wrapping_neg() as u64) || - (!negative && v > (max.abs() as u64)) { + if (negative && min != i64::MIN && v > -min as u64) || + (!negative && v > max as u64) { cx.span_lint(OVERFLOWING_LITERALS, e.span, &*format!("literal out of range for {:?}", t)); return; |
