@@ -77,7 +77,8 @@ impl<'a, K: 'a, V: 'a> BTreeMap<K, V> {
77
77
let min_len = if is_root { 0 } else { node:: MIN_LEN } ;
78
78
assert ! ( node. len( ) >= min_len, "{} < {}" , node. len( ) , min_len) ;
79
79
80
- for & key in node. keys ( ) {
80
+ for idx in 0 ..node. len ( ) {
81
+ let key = * unsafe { node. key_at ( idx) } ;
81
82
checker. is_ascending ( key) ;
82
83
}
83
84
leaf_length += node. len ( ) ;
@@ -120,7 +121,13 @@ impl<'a, K: 'a, V: 'a> BTreeMap<K, V> {
120
121
Position :: Leaf ( leaf) => {
121
122
let depth = root_node. height ( ) ;
122
123
let indent = " " . repeat ( depth) ;
123
- result += & format ! ( "\n {}{:?}" , indent, leaf. keys( ) )
124
+ result += & format ! ( "\n {}" , indent) ;
125
+ for idx in 0 ..leaf. len ( ) {
126
+ if idx > 0 {
127
+ result += ", " ;
128
+ }
129
+ result += & format ! ( "{:?}" , unsafe { leaf. key_at( idx) } ) ;
130
+ }
124
131
}
125
132
Position :: Internal ( _) => { }
126
133
Position :: InternalKV ( kv) => {
@@ -432,7 +439,6 @@ fn test_iter_mut_mutation() {
432
439
}
433
440
434
441
#[ test]
435
- #[ cfg_attr( miri, ignore) ] // FIXME: fails in Miri <https://github.com/rust-lang/rust/issues/73915>
436
442
fn test_values_mut ( ) {
437
443
let mut a: BTreeMap < _ , _ > = ( 0 ..MIN_INSERTS_HEIGHT_2 ) . map ( |i| ( i, i) ) . collect ( ) ;
438
444
test_all_refs ( & mut 13 , a. values_mut ( ) ) ;
@@ -455,7 +461,6 @@ fn test_values_mut_mutation() {
455
461
}
456
462
457
463
#[ test]
458
- #[ cfg_attr( miri, ignore) ] // FIXME: fails in Miri <https://github.com/rust-lang/rust/issues/73915>
459
464
fn test_iter_entering_root_twice ( ) {
460
465
let mut map: BTreeMap < _ , _ > = ( 0 ..2 ) . map ( |i| ( i, i) ) . collect ( ) ;
461
466
let mut it = map. iter_mut ( ) ;
@@ -471,7 +476,6 @@ fn test_iter_entering_root_twice() {
471
476
}
472
477
473
478
#[ test]
474
- #[ cfg_attr( miri, ignore) ] // FIXME: fails in Miri <https://github.com/rust-lang/rust/issues/73915>
475
479
fn test_iter_descending_to_same_node_twice ( ) {
476
480
let mut map: BTreeMap < _ , _ > = ( 0 ..MIN_INSERTS_HEIGHT_1 ) . map ( |i| ( i, i) ) . collect ( ) ;
477
481
let mut it = map. iter_mut ( ) ;
@@ -515,7 +519,6 @@ fn test_iter_mixed() {
515
519
}
516
520
517
521
#[ test]
518
- #[ cfg_attr( miri, ignore) ] // FIXME: fails in Miri <https://github.com/rust-lang/rust/issues/73915>
519
522
fn test_iter_min_max ( ) {
520
523
let mut a = BTreeMap :: new ( ) ;
521
524
assert_eq ! ( a. iter( ) . min( ) , None ) ;
0 commit comments