summary refs log tree commit diff
path: root/src/test/ui/const-generics/fn-const-param-call.rs
blob: cd4b19db3533117f6d6bff106ec48ed3911d4112 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
// run-pass

#![feature(const_generics, const_compare_raw_pointers)]
//~^ WARN the feature `const_generics` is incomplete and may cause the compiler to crash

fn function() -> u32 {
    17
}

struct Wrapper<const F: fn() -> u32>;

impl<const F: fn() -> u32> Wrapper<F> {
    fn call() -> u32 {
        F()
    }
}

fn main() {
    assert_eq!(Wrapper::<function>::call(), 17);
}