summaryrefslogtreecommitdiffstats
path: root/tests/ui/functions-closures/fn-item-type-coerce.rs
blob: 7a096764e45fe63d6770cc95b968851db702d397 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
// run-pass
#![allow(unused_variables)]
// Test implicit coercions from a fn item type to a fn pointer type.

// pretty-expanded FIXME #23616

fn foo(x: isize) -> isize { x * 2 }
fn bar(x: isize) -> isize { x * 4 }
type IntMap = fn(isize) -> isize;

fn eq<T>(x: T, y: T) { }

fn main() {
    let f: IntMap = foo;

    eq::<IntMap>(foo, bar);
}