]> git.proxmox.com Git - rustc.git/blob - src/test/ui/const-generics/generic_const_exprs/issue-62504.rs
Update unsuspicious file list
[rustc.git] / src / test / ui / const-generics / generic_const_exprs / issue-62504.rs
1 // revisions: full min
2 #![allow(incomplete_features)]
3 #![cfg_attr(full, feature(generic_const_exprs))]
4 #![cfg_attr(full, allow(incomplete_features))]
5
6 trait HasSize {
7 const SIZE: usize;
8 }
9
10 impl<const X: usize> HasSize for ArrayHolder<X> {
11 const SIZE: usize = X;
12 }
13
14 struct ArrayHolder<const X: usize>([u32; X]);
15
16 impl<const X: usize> ArrayHolder<X> {
17 pub const fn new() -> Self {
18 ArrayHolder([0; Self::SIZE])
19 //~^ ERROR mismatched types
20 //[full]~^^ ERROR unconstrained generic constant
21 //[min]~^^^ ERROR constant expression depends on a generic parameter
22 }
23 }
24
25 fn main() {
26 let mut array = ArrayHolder::new();
27 }