summaryrefslogtreecommitdiffstats
path: root/src/test/ui/unboxed-closures/unboxed-closures-type-mismatch.stderr
blob: 3241c9f8521c0811b9dae14916c3443f2c8b6ccf (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
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`.