]> git.proxmox.com Git - rustc.git/blame - src/test/ui/typeck-fn-to-unsafe-fn-ptr.rs
New upstream version 1.54.0+dfsg1
[rustc.git] / src / test / ui / typeck-fn-to-unsafe-fn-ptr.rs
CommitLineData
416331ca 1// run-pass
c30ab7b3 2// This tests reification from safe function to `unsafe fn` pointer
d9579d0f 3
c30ab7b3
SL
4fn do_nothing() -> () {}
5
6unsafe fn call_unsafe(func: unsafe fn() -> ()) -> () {
7 func()
8}
9
10pub fn main() {
11 unsafe { call_unsafe(do_nothing); }
223e47cc 12}