summaryrefslogtreecommitdiffstats
path: root/tests/ui/type/closure-with-wrong-borrows.rs
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--tests/ui/type/closure-with-wrong-borrows.rs10
1 files changed, 10 insertions, 0 deletions
diff --git a/tests/ui/type/closure-with-wrong-borrows.rs b/tests/ui/type/closure-with-wrong-borrows.rs
new file mode 100644
index 000000000..5f6a78351
--- /dev/null
+++ b/tests/ui/type/closure-with-wrong-borrows.rs
@@ -0,0 +1,10 @@
+struct S<'a>(&'a str);
+
+fn f(inner: fn(&str, &S)) {
+}
+
+#[allow(unreachable_code)]
+fn main() {
+ let inner: fn(_, _) = unimplemented!();
+ f(inner); //~ ERROR mismatched types
+}