]>
git.proxmox.com Git - rustc.git/blob - src/test/ui/const-generics/wf-misc.rs
1 // Tests miscellaneous well-formedness examples.
4 #![cfg_attr(full, feature(const_generics))]
5 #![cfg_attr(full, allow(incomplete_features))]
6 #![cfg_attr(min, feature(min_const_generics))]
8 pub fn arr_len
<const N
: usize>() {
10 //[full]~^ ERROR constant expression depends on a generic parameter
11 //[min]~^^ ERROR generic parameters may not be used in const operations
14 struct Const
<const N
: usize>;
16 pub fn func_call
<const N
: usize>() {
17 let _
: Const
::<{N + 1}
>;
18 //[full]~^ ERROR constant expression depends on a generic parameter
19 //[min]~^^ ERROR generic parameters may not be used in const operations