mirror of
https://github.com/rust-lang/rust.git
synced 2024-12-17 02:54:26 +00:00
334f4535bd
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.
15 lines
279 B
Rust
15 lines
279 B
Rust
// This test requires a feature gated const fn and will stop working in the future.
|
|
|
|
#![feature(const_btree_len)]
|
|
|
|
use std::collections::BTreeMap;
|
|
|
|
struct Foo(usize);
|
|
impl Foo {
|
|
fn new() -> Self {
|
|
Self(BTreeMap::len(&BTreeMap::<u8, u8>::new()))
|
|
}
|
|
}
|
|
|
|
fn main() {}
|