rust/tests/ui/consts/min_const_fn/cast_fn.rs

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

12 lines
243 B
Rust
Raw Normal View History

// check-pass
fn main() {}
const fn unsize(x: &[u8; 3]) -> &[u8] { x }
const fn closure() -> fn() { || {} }
const fn closure2() {
(|| {}) as fn();
}
const fn reify(f: fn()) -> unsafe fn() { f }
const fn reify2() { main as unsafe fn(); }