]> git.lizzy.rs Git - rust.git/blob - src/test/ui/const-generics/fn-const-param-call.rs
pin docs: add some forward references
[rust.git] / src / test / ui / const-generics / fn-const-param-call.rs
1 #![feature(const_generics)]
2 //~^ WARN the feature `const_generics` is incomplete
3
4 fn function() -> u32 {
5     17
6 }
7
8 struct Wrapper<const F: fn() -> u32>; //~ ERROR: using function pointers as const generic parameters
9
10 impl<const F: fn() -> u32> Wrapper<F> {
11 //~^ ERROR: using function pointers as const generic parameters
12     fn call() -> u32 {
13         F()
14     }
15 }
16
17 fn main() {
18     assert_eq!(Wrapper::<function>::call(), 17);
19 }