]> git.lizzy.rs Git - rust.git/blob - src/test/ui/typeck/typeck-fn-to-unsafe-fn-ptr.rs
Merge commit 'cd4810de42c57b64b74dae09c530a4c3a41f87b9' into libgccjit-codegen
[rust.git] / src / test / ui / typeck / typeck-fn-to-unsafe-fn-ptr.rs
1 // run-pass
2 // This tests reification from safe function to `unsafe fn` pointer
3
4 fn do_nothing() -> () {}
5
6 unsafe fn call_unsafe(func: unsafe fn() -> ()) -> () {
7     func()
8 }
9
10 pub fn main() {
11     unsafe { call_unsafe(do_nothing); }
12 }