rust/tests/ui/consts/const-fn-ptr.rs
2023-01-11 09:32:08 +00:00

17 lines
265 B
Rust

const fn make_fn_ptr() -> fn() {
|| {}
}
static STAT: () = make_fn_ptr()();
//~^ ERROR function pointer
const CONST: () = make_fn_ptr()();
//~^ ERROR function pointer
const fn call_ptr() {
make_fn_ptr()();
//~^ ERROR function pointer
}
fn main() {}