mirror of
https://github.com/rust-lang/rust-clippy
synced 2024-11-14 00:47:16 +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.
14 lines
279 B
Rust
14 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() {}
|