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+
13#[ derive( PartialEq , Eq , PartialOrd , Ord ) ]
24pub enum Foo {
35 A ( & ' static str ) ,
@@ -6,11 +8,22 @@ pub enum Foo {
68}
79
810pub fn main ( ) {
9- let mut b = std :: collections :: BTreeSet :: new ( ) ;
11+ let mut b = BTreeSet :: new ( ) ;
1012 b. insert ( Foo :: A ( "\' " ) ) ;
1113 b. insert ( Foo :: A ( "/=" ) ) ;
1214 b. insert ( Foo :: A ( "#" ) ) ;
1315 b. insert ( Foo :: A ( "0o" ) ) ;
1416 assert ! ( b. remove( & Foo :: A ( "/=" ) ) ) ;
1517 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 ( ) { }
1629}
You can’t perform that action at this time.
0 commit comments