Skip to content

Commit f690371

Browse files
committed
avoid underflow during computation of uint::MAX.
1 parent a032012 commit f690371

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/libcore/num/uint_macros.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,6 @@ pub const BYTES : uint = ($bits / 8);
2020
#[stable(feature = "rust1", since = "1.0.0")]
2121
pub const MIN: $T = 0 as $T;
2222
#[stable(feature = "rust1", since = "1.0.0")]
23-
pub const MAX: $T = 0 as $T - 1 as $T;
23+
pub const MAX: $T = !0 as $T;
2424

2525
) }

0 commit comments

Comments
 (0)