Skip to content

Commit 9ee4ead

Browse files
committed
Auto merge of #25612 - petrochenkov:lintabs, r=@alexcrichton
Reported here #25441 (comment)
2 parents c575885 + 7b1916d commit 9ee4ead

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/librustc_lint/builtin.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -206,8 +206,8 @@ impl LintPass for TypeLimits {
206206
let (min, max) = int_ty_range(int_type);
207207
let negative = self.negated_expr_id == e.id;
208208

209-
if (negative && v > min.wrapping_neg() as u64) ||
210-
(!negative && v > (max.abs() as u64)) {
209+
if (negative && min != i64::MIN && v > -min as u64) ||
210+
(!negative && v > max as u64) {
211211
cx.span_lint(OVERFLOWING_LITERALS, e.span,
212212
&*format!("literal out of range for {:?}", t));
213213
return;

0 commit comments

Comments
 (0)