summary refs log tree commit diff
path: root/src/test/ui/collections-const-new.rs
blob: 978f25f9a93449a587300e2b20ddbfe136319116 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
// check-pass

// Test several functions can be used for constants
// 1. Vec::new()
// 2. String::new()
// 3. BTreeMap::new()
// 4. BTreeSet::new()

#![feature(const_btree_new)]

const MY_VEC: Vec<usize> = Vec::new();

const MY_STRING: String = String::new();

use std::collections::{BTreeMap, BTreeSet};
const MY_BTREEMAP: BTreeMap<u32, u32> = BTreeMap::new();

const MY_BTREESET: BTreeSet<u32> = BTreeSet::new();

fn main() {}