rust/tests/ui/consts/min_const_fn/cast_fn.rs
2024-02-16 20:02:50 +00:00

12 lines
244 B
Rust

//@ 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(); }