rust/tests/ui/consts/const-fn-ptr.rs

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

17 lines
265 B
Rust
Raw Normal View History

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() {}