]> git.lizzy.rs Git - rust.git/blob - src/test/ui/const-generics/issues/issue-61336.rs
Auto merge of #75137 - Aaron1011:fix/hygiene-skip-expndata, r=petrochenkov
[rust.git] / src / test / ui / const-generics / issues / issue-61336.rs
1 // revisions: full min
2 #![cfg_attr(full, feature(const_generics))] //[full]~WARN the feature `const_generics` is incomplete
3 #![cfg_attr(min, feature(min_const_generics))]
4
5 fn f<T: Copy, const N: usize>(x: T) -> [T; N] {
6     [x; N]
7 }
8
9 fn g<T, const N: usize>(x: T) -> [T; N] {
10     [x; N]
11     //~^ ERROR the trait bound `T: std::marker::Copy` is not satisfied
12 }
13
14 fn main() {
15     let x: [u32; 5] = f::<u32, 5>(3);
16     assert_eq!(x, [3u32; 5]);
17 }