add test that repeating non-Copy constants works

This commit is contained in:
Ralf Jung 2020-11-21 18:05:29 +01:00
parent 54a3ed3114
commit f8d4883dbe

View File

@ -0,0 +1,13 @@
// check-pass
// Repeating a *constant* of non-Copy type (not just a constant expression) is already stable.
const EMPTY: Vec<i32> = Vec::new();
pub fn bar() -> [Vec<i32>; 2] {
[EMPTY; 2]
}
fn main() {
let x = bar();
}