2 // compile-flags: -Zunleash-the-miri-inside-of-you
5 fn double(x: usize) -> usize { x * 2 }
6 const fn double_const(x: usize) -> usize { x * 2 }
8 const X: fn(usize) -> usize = double;
9 const X_CONST: fn(usize) -> usize = double_const;
11 const fn bar(x: usize) -> usize {
12 X(x) //~ WARNING skipping const checks
15 const fn bar_const(x: usize) -> usize {
16 X_CONST(x) //~ WARNING skipping const checks
19 const fn foo(x: fn(usize) -> usize, y: usize) -> usize {
20 x(y) //~ WARNING skipping const checks
24 const Y: usize = bar_const(2);
31 const Z: usize = foo(double_const, 2);
33 let z = foo(double_const, 2);
35 let z = foo(double, 2);