Skip to content

Commit a22772d

Browse files
committed
EnumSet assertion: better error message.
1 parent 1fdb759 commit a22772d

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/libcollections/enum_set.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,8 +52,10 @@ pub trait CLike {
5252
}
5353

5454
fn bit<E:CLike>(e: &E) -> uint {
55+
use core::uint;
5556
let value = e.to_uint();
56-
assert!(value < ::core::uint::BITS);
57+
assert!(value < uint::BITS,
58+
"EnumSet only supports up to {} variants.", uint::BITS - 1);
5759
1 << value
5860
}
5961

0 commit comments

Comments
 (0)