summaryrefslogtreecommitdiffstats
path: root/tests/ui/closures/print/closure-print-verbose.rs
diff options
context:
space:
mode:
Diffstat (limited to 'tests/ui/closures/print/closure-print-verbose.rs')
-rw-r--r--tests/ui/closures/print/closure-print-verbose.rs12
1 files changed, 12 insertions, 0 deletions
diff --git a/tests/ui/closures/print/closure-print-verbose.rs b/tests/ui/closures/print/closure-print-verbose.rs
new file mode 100644
index 000000000..4b0438a91
--- /dev/null
+++ b/tests/ui/closures/print/closure-print-verbose.rs
@@ -0,0 +1,12 @@
+// compile-flags: -Zverbose
+
+// Same as closure-coerce-fn-1.rs
+
+// Ensure that capturing closures are never coerced to fns
+// Especially interesting as non-capturing closures can be.
+
+fn main() {
+ let mut a = 0u8;
+ let foo: fn(u8) -> u8 = |v: u8| { a += v; a };
+ //~^ ERROR mismatched types
+}