blob: 8a5b6ddfe2668c9d83a4147da325d15246b0bad2 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
|
// Tests miscellaneous well-formedness examples.
// revisions: full min
#![cfg_attr(full, feature(const_generics))]
#![cfg_attr(full, allow(incomplete_features))]
pub fn arr_len<const N: usize>() {
let _: [u8; N + 1];
//[full]~^ ERROR constant expression depends on a generic parameter
//[min]~^^ ERROR generic parameters may not be used in const operations
}
struct Const<const N: usize>;
pub fn func_call<const N: usize>() {
let _: Const::<{N + 1}>;
//[full]~^ ERROR constant expression depends on a generic parameter
//[min]~^^ ERROR generic parameters may not be used in const operations
}
fn main() {}
|