summaryrefslogtreecommitdiffstats
path: root/tests/ui/consts/min_const_fn/allow_const_fn_ptr_run_pass.rs
blob: 2dbc424d3ba2d76dc59ca5096239457e54aaa7c2 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
// run-pass
#![feature(rustc_allow_const_fn_unstable)]

#![feature(rustc_attrs, staged_api)]
#![stable(feature = "rust1", since = "1.0.0")]

#[stable(feature = "rust1", since = "1.0.0")]
#[rustc_const_stable(since="1.0.0", feature = "mep")]
const fn takes_fn_ptr(_: fn()) {}

const FN: fn() = || ();

const fn gives_fn_ptr() {
    takes_fn_ptr(FN)
}

fn main() {
    gives_fn_ptr();
}