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.
This commit is contained in:
Nilstrieb 2022-09-23 18:03:44 +02:00
parent 2063b8f137
commit 334f4535bd

View file

@ -1,13 +1,13 @@
// This test requires a feature gated const fn and will stop working in the future.
#![feature(const_btree_new)]
#![feature(const_btree_len)]
use std::collections::BTreeMap;
struct Foo(BTreeMap<i32, i32>);
struct Foo(usize);
impl Foo {
fn new() -> Self {
Self(BTreeMap::new())
Self(BTreeMap::len(&BTreeMap::<u8, u8>::new()))
}
}