]> git.proxmox.com Git - rustc.git/blame - src/test/ui/const-generics/issues/issue-61336.rs
New upstream version 1.44.1+dfsg1
[rustc.git] / src / test / ui / const-generics / issues / issue-61336.rs
CommitLineData
dc9dc135
XL
1#![feature(const_generics)]
2//~^ WARN the feature `const_generics` is incomplete and may cause the compiler to crash
3
4fn f<T: Copy, const N: usize>(x: T) -> [T; N] {
5 [x; N]
6}
7
8fn g<T, const N: usize>(x: T) -> [T; N] {
9 [x; N]
ba9703b0 10 //~^ ERROR the trait bound `T: std::marker::Copy` is not satisfied
dc9dc135
XL
11}
12
13fn main() {
14 let x: [u32; 5] = f::<u32, 5>(3);
15 assert_eq!(x, [3u32; 5]);
16}