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