rust/tests/ui/issues/issue-15444.rs

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

24 lines
349 B
Rust
Raw Normal View History

//@ run-pass
//@ pretty-expanded FIXME #23616
2014-12-07 23:22:06 +08:00
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 {
2014-12-07 23:22:06 +08:00
a + b
}
fn main() {
let thing: fn(isize, isize) -> isize = thing; // coerce to fn type
2014-12-07 23:22:06 +08:00
bar(&thing);
}