Skip to content

Commit 334f453

Browse files
committed
Stabilize const BTree{Map,Set}::new
Since `len` and `is_empty` are not const stable yet, this also creates a new feature for them since they previously used the same `const_btree_new` feature.
1 parent 2063b8f commit 334f453

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

tests/ui/crashes/ice-7126.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
// This test requires a feature gated const fn and will stop working in the future.
22

3-
#![feature(const_btree_new)]
3+
#![feature(const_btree_len)]
44

55
use std::collections::BTreeMap;
66

7-
struct Foo(BTreeMap<i32, i32>);
7+
struct Foo(usize);
88
impl Foo {
99
fn new() -> Self {
10-
Self(BTreeMap::new())
10+
Self(BTreeMap::len(&BTreeMap::<u8, u8>::new()))
1111
}
1212
}
1313

0 commit comments

Comments
 (0)