]> git.lizzy.rs Git - rust.git/blob - src/test/run-pass/typeck-fn-to-unsafe-fn-ptr.rs
Rollup merge of #60685 - dtolnay:spdx, r=nikomatsakis
[rust.git] / src / test / run-pass / typeck-fn-to-unsafe-fn-ptr.rs
1 // This tests reification from safe function to `unsafe fn` pointer
2
3 fn do_nothing() -> () {}
4
5 unsafe fn call_unsafe(func: unsafe fn() -> ()) -> () {
6     func()
7 }
8
9 pub fn main() {
10     unsafe { call_unsafe(do_nothing); }
11 }