File tree Expand file tree Collapse file tree 1 file changed +14
-1
lines changed Expand file tree Collapse file tree 1 file changed +14
-1
lines changed Original file line number Diff line number Diff line change
1
+ use std:: collections:: { BTreeMap , BTreeSet } ;
2
+
1
3
#[ derive( PartialEq , Eq , PartialOrd , Ord ) ]
2
4
pub enum Foo {
3
5
A ( & ' static str ) ,
@@ -6,11 +8,22 @@ pub enum Foo {
6
8
}
7
9
8
10
pub fn main ( ) {
9
- let mut b = std :: collections :: BTreeSet :: new ( ) ;
11
+ let mut b = BTreeSet :: new ( ) ;
10
12
b. insert ( Foo :: A ( "\' " ) ) ;
11
13
b. insert ( Foo :: A ( "/=" ) ) ;
12
14
b. insert ( Foo :: A ( "#" ) ) ;
13
15
b. insert ( Foo :: A ( "0o" ) ) ;
14
16
assert ! ( b. remove( & Foo :: A ( "/=" ) ) ) ;
15
17
assert ! ( !b. remove( & Foo :: A ( "/=" ) ) ) ;
18
+
19
+ // Also test a lower-alignment type, where the NodeHeader overlaps with
20
+ // the keys.
21
+ let mut b = BTreeSet :: new ( ) ;
22
+ b. insert ( 1024 ) ;
23
+ b. insert ( 7 ) ;
24
+
25
+ let mut b = BTreeMap :: new ( ) ;
26
+ b. insert ( "bar" , 1024 ) ;
27
+ b. insert ( "baz" , 7 ) ;
28
+ for _val in b. iter_mut ( ) { }
16
29
}
You can’t perform that action at this time.
0 commit comments