Skip to content

Commit f8d4883

Browse files
committed
add test that repeating non-Copy constants works
1 parent 54a3ed3 commit f8d4883

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
// check-pass
2+
3+
// Repeating a *constant* of non-Copy type (not just a constant expression) is already stable.
4+
5+
const EMPTY: Vec<i32> = Vec::new();
6+
7+
pub fn bar() -> [Vec<i32>; 2] {
8+
[EMPTY; 2]
9+
}
10+
11+
fn main() {
12+
let x = bar();
13+
}

0 commit comments

Comments
 (0)