2019-09-30 23:55:26 -05:00
|
|
|
// run-pass
|
|
|
|
|
2019-10-04 16:49:24 -05:00
|
|
|
#![feature(const_generics, const_compare_raw_pointers)]
|
2019-09-30 23:55:26 -05:00
|
|
|
//~^ 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);
|
2019-10-02 02:29:16 -05:00
|
|
|
}
|