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