]> git.lizzy.rs Git - rust.git/blob - src/test/ui/functions-closures/fn-item-type-coerce.rs
Merge commit 'cd4810de42c57b64b74dae09c530a4c3a41f87b9' into libgccjit-codegen
[rust.git] / src / test / 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 }