summaryrefslogtreecommitdiffstats
path: root/tests/ui/issues/issue-15444.rs
blob: e94afee9634198e90e3e173ccf780dd144ac26d1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
// run-pass
// pretty-expanded FIXME #23616

trait MyTrait {
    fn foo(&self);
}

impl<A, B, C> MyTrait for fn(A, B) -> C {
    fn foo(&self) {}
}

fn bar<T: MyTrait>(t: &T) {
    t.foo()
}

fn thing(a: isize, b: isize) -> isize {
    a + b
}

fn main() {
    let thing: fn(isize, isize) -> isize = thing; // coerce to fn type
    bar(&thing);
}