summaryrefslogtreecommitdiffstats
path: root/src/test/ui/unboxed-closures/unboxed-closures-type-mismatch.stderr
diff options
context:
space:
mode:
Diffstat (limited to 'src/test/ui/unboxed-closures/unboxed-closures-type-mismatch.stderr')
-rw-r--r--src/test/ui/unboxed-closures/unboxed-closures-type-mismatch.stderr21
1 files changed, 21 insertions, 0 deletions
diff --git a/src/test/ui/unboxed-closures/unboxed-closures-type-mismatch.stderr b/src/test/ui/unboxed-closures/unboxed-closures-type-mismatch.stderr
new file mode 100644
index 000000000..3241c9f85
--- /dev/null
+++ b/src/test/ui/unboxed-closures/unboxed-closures-type-mismatch.stderr
@@ -0,0 +1,21 @@
+error[E0308]: mismatched types
+ --> $DIR/unboxed-closures-type-mismatch.rs:5:15
+ |
+LL | let z = f(1_usize, 2);
+ | - ^^^^^^^ expected `isize`, found `usize`
+ | |
+ | arguments to this function are incorrect
+ |
+note: closure defined here
+ --> $DIR/unboxed-closures-type-mismatch.rs:4:17
+ |
+LL | let mut f = |x: isize, y: isize| -> isize { x + y };
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+help: change the type of the numeric literal from `usize` to `isize`
+ |
+LL | let z = f(1_isize, 2);
+ | ~~~~~
+
+error: aborting due to previous error
+
+For more information about this error, try `rustc --explain E0308`.