3 #![feature(const_trait_impl)]
4 #![feature(const_fn_trait_bound)]
6 const fn answer_p1<F>(f: &F) -> u8
8 F: ~const FnOnce() -> u8,
9 F: ~const FnMut() -> u8,
15 const fn three() -> u8 {
19 const fn answer_p2() -> u8 {
23 const fn answer<F: ~const Fn() -> u8>(f: &F) -> u8 {
27 const ANSWER: u8 = answer(&answer_p2);
30 assert_eq!(ANSWER, 42)