about summary refs log tree commit diff
path: root/src/test/ui/const-generics/generic-sum-in-array-length.rs
blob: 84ddfe055dc3fe5644e1ca410a06430cf4b8f0c9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
// revisions: full min

#![cfg_attr(full, allow(incomplete_features))]
#![cfg_attr(full, feature(const_generics))]
#![cfg_attr(min, feature(min_const_generics))]

fn foo<const A: usize, const B: usize>(bar: [usize; A + B]) {}
//[min]~^ ERROR generic parameters may not be used in const operations
//[min]~| ERROR generic parameters may not be used in const operations
//[full]~^^^ ERROR constant expression depends on a generic parameter

fn main() {}