1 // allow(const_err) to work around a bug in warnings
3 static FOO: fn() = || { assert_ne!(42, 43) };
5 static BAR: fn(i32, i32) = |a, b| { assert_ne!(a, b) };
7 // use to first make the closure FnOnce() before making it fn()
8 fn magic<F: FnOnce()>(f: F) -> F { f }
13 let bar: unsafe fn(i32, i32) = BAR;
14 unsafe { bar(46, 47) };
15 let boo: &dyn Fn(i32, i32) = &BAR;
18 let f = magic(||{}) as fn();