summaryrefslogtreecommitdiffstats
path: root/src/test/ui/unboxed-closures/unboxed-closures-type-mismatch.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/test/ui/unboxed-closures/unboxed-closures-type-mismatch.rs')
-rw-r--r--src/test/ui/unboxed-closures/unboxed-closures-type-mismatch.rs7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/test/ui/unboxed-closures/unboxed-closures-type-mismatch.rs b/src/test/ui/unboxed-closures/unboxed-closures-type-mismatch.rs
new file mode 100644
index 000000000..9f76849e5
--- /dev/null
+++ b/src/test/ui/unboxed-closures/unboxed-closures-type-mismatch.rs
@@ -0,0 +1,7 @@
+use std::ops::FnMut;
+
+pub fn main() {
+ let mut f = |x: isize, y: isize| -> isize { x + y };
+ let z = f(1_usize, 2); //~ ERROR mismatched types
+ println!("{}", z);
+}