diff options
Diffstat (limited to 'src/test/ui/functions-closures/fn-item-type-coerce.rs')
-rw-r--r-- | src/test/ui/functions-closures/fn-item-type-coerce.rs | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/src/test/ui/functions-closures/fn-item-type-coerce.rs b/src/test/ui/functions-closures/fn-item-type-coerce.rs new file mode 100644 index 000000000..7a096764e --- /dev/null +++ b/src/test/ui/functions-closures/fn-item-type-coerce.rs @@ -0,0 +1,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); +} |