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