about summary refs log tree commit diff
path: root/tests/ui/functions-closures/fn-coerce-field.rs
diff options
context:
space:
mode:
Diffstat (limited to 'tests/ui/functions-closures/fn-coerce-field.rs')
-rw-r--r--tests/ui/functions-closures/fn-coerce-field.rs13
1 files changed, 13 insertions, 0 deletions
diff --git a/tests/ui/functions-closures/fn-coerce-field.rs b/tests/ui/functions-closures/fn-coerce-field.rs
new file mode 100644
index 00000000000..38bde7b9e8f
--- /dev/null
+++ b/tests/ui/functions-closures/fn-coerce-field.rs
@@ -0,0 +1,13 @@
+// run-pass
+#![allow(dead_code)]
+// pretty-expanded FIXME #23616
+#![allow(non_camel_case_types)]
+
+struct r<F> where F: FnOnce() {
+    field: F,
+}
+
+pub fn main() {
+    fn f() {}
+    let _i: r<fn()> = r {field: f as fn()};
+}