rust/tests/ui/consts/const-eval/const_fn_ptr_fail.rs

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

13 lines
257 B
Rust
Raw Normal View History

//@ run-pass
2019-09-21 09:09:38 -05:00
//@ compile-flags: -Zunleash-the-miri-inside-of-you
#![allow(unused)]
fn double(x: usize) -> usize { x * 2 }
const X: fn(usize) -> usize = double;
2020-05-03 07:23:08 -05:00
const fn bar(x: usize) -> usize {
2019-09-21 09:09:38 -05:00
X(x) // FIXME: this should error someday
}
fn main() {}