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:
parent
2063b8f137
commit
334f4535bd
@ -1,13 +1,13 @@
|
|||||||
// This test requires a feature gated const fn and will stop working in the future.
|
// 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;
|
use std::collections::BTreeMap;
|
||||||
|
|
||||||
struct Foo(BTreeMap<i32, i32>);
|
struct Foo(usize);
|
||||||
impl Foo {
|
impl Foo {
|
||||||
fn new() -> Self {
|
fn new() -> Self {
|
||||||
Self(BTreeMap::new())
|
Self(BTreeMap::len(&BTreeMap::<u8, u8>::new()))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user