diff options
Diffstat (limited to 'tests/ui/unboxed-closures/unboxed-closures-type-mismatch.rs')
-rw-r--r-- | tests/ui/unboxed-closures/unboxed-closures-type-mismatch.rs | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/tests/ui/unboxed-closures/unboxed-closures-type-mismatch.rs b/tests/ui/unboxed-closures/unboxed-closures-type-mismatch.rs new file mode 100644 index 000000000..9f76849e5 --- /dev/null +++ b/tests/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); +} |