Skip to content

Commit e2d2f68

Browse files
committed
Add a test to ensure BitFlags implements Hash
1 parent 9fff8c9 commit e2d2f68

File tree

2 files changed

+9
-1
lines changed

2 files changed

+9
-1
lines changed

test_suite/common.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#[derive(BitFlags, Copy, Clone, Debug, PartialEq)]
1+
#[derive(BitFlags, Copy, Clone, Debug, PartialEq, Eq, Hash)]
22
#[repr(u8)]
33
enum Test {
44
A = 1 << 0,

test_suite/tests/requires_std.rs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,3 +92,11 @@ fn debug_generic() {
9292

9393
let _ = format!("{:?}", Debug(BitFlags::<Test>::all()));
9494
}
95+
96+
#[test]
97+
fn works_in_hashmap() {
98+
// Assert that BitFlags<T> implements Hash.
99+
100+
use std::collections::HashMap;
101+
let _map: HashMap<BitFlags<Test>, u8> = HashMap::new();
102+
}

0 commit comments

Comments
 (0)