]> git.lizzy.rs Git - rust.git/blob - tests/ui/functions-closures/fn-item-type-coerce.rs
Rollup merge of #107740 - oli-obk:lock_tcx, r=petrochenkov
[rust.git] / tests / ui / functions-closures / fn-item-type-coerce.rs
1 // run-pass
2 #![allow(unused_variables)]
3 // Test implicit coercions from a fn item type to a fn pointer type.
4
5 // pretty-expanded FIXME #23616
6
7 fn foo(x: isize) -> isize { x * 2 }
8 fn bar(x: isize) -> isize { x * 4 }
9 type IntMap = fn(isize) -> isize;
10
11 fn eq<T>(x: T, y: T) { }
12
13 fn main() {
14     let f: IntMap = foo;
15
16     eq::<IntMap>(foo, bar);
17 }