]> git.proxmox.com Git - rustc.git/blob - src/test/ui/unboxed-closures/unboxed-closures-wrong-abi.stderr
New upstream version 1.44.1+dfsg1
[rustc.git] / src / test / ui / unboxed-closures / unboxed-closures-wrong-abi.stderr
1 error[E0277]: expected a `std::ops::Fn<(&isize,)>` closure, found `for<'r> extern "C" fn(&'r isize) -> isize {square}`
2 --> $DIR/unboxed-closures-wrong-abi.rs:12:21
3 |
4 LL | fn call_it<F:Fn(&isize)->isize>(_: &F, _: isize) -> isize { 0 }
5 | ----------------- required by this bound in `call_it`
6 ...
7 LL | let x = call_it(&square, 22);
8 | ^^^^^^^ expected an `Fn<(&isize,)>` closure, found `for<'r> extern "C" fn(&'r isize) -> isize {square}`
9 |
10 = help: the trait `for<'r> std::ops::Fn<(&'r isize,)>` is not implemented for `for<'r> extern "C" fn(&'r isize) -> isize {square}`
11
12 error[E0277]: expected a `std::ops::FnOnce<(&isize,)>` closure, found `for<'r> extern "C" fn(&'r isize) -> isize {square}`
13 --> $DIR/unboxed-closures-wrong-abi.rs:12:21
14 |
15 LL | fn call_it<F:Fn(&isize)->isize>(_: &F, _: isize) -> isize { 0 }
16 | ----- required by this bound in `call_it`
17 ...
18 LL | let x = call_it(&square, 22);
19 | ^^^^^^^ expected an `FnOnce<(&isize,)>` closure, found `for<'r> extern "C" fn(&'r isize) -> isize {square}`
20 |
21 = help: the trait `std::ops::FnOnce<(&isize,)>` is not implemented for `for<'r> extern "C" fn(&'r isize) -> isize {square}`
22
23 error[E0277]: expected a `std::ops::FnMut<(&isize,)>` closure, found `for<'r> extern "C" fn(&'r isize) -> isize {square}`
24 --> $DIR/unboxed-closures-wrong-abi.rs:18:25
25 |
26 LL | fn call_it_mut<F:FnMut(&isize)->isize>(_: &mut F, _: isize) -> isize { 0 }
27 | -------------------- required by this bound in `call_it_mut`
28 ...
29 LL | let y = call_it_mut(&mut square, 22);
30 | ^^^^^^^^^^^ expected an `FnMut<(&isize,)>` closure, found `for<'r> extern "C" fn(&'r isize) -> isize {square}`
31 |
32 = help: the trait `for<'r> std::ops::FnMut<(&'r isize,)>` is not implemented for `for<'r> extern "C" fn(&'r isize) -> isize {square}`
33
34 error[E0277]: expected a `std::ops::FnOnce<(&isize,)>` closure, found `for<'r> extern "C" fn(&'r isize) -> isize {square}`
35 --> $DIR/unboxed-closures-wrong-abi.rs:18:25
36 |
37 LL | fn call_it_mut<F:FnMut(&isize)->isize>(_: &mut F, _: isize) -> isize { 0 }
38 | ----- required by this bound in `call_it_mut`
39 ...
40 LL | let y = call_it_mut(&mut square, 22);
41 | ^^^^^^^^^^^ expected an `FnOnce<(&isize,)>` closure, found `for<'r> extern "C" fn(&'r isize) -> isize {square}`
42 |
43 = help: the trait `std::ops::FnOnce<(&isize,)>` is not implemented for `for<'r> extern "C" fn(&'r isize) -> isize {square}`
44
45 error[E0277]: expected a `std::ops::FnOnce<(&isize,)>` closure, found `for<'r> extern "C" fn(&'r isize) -> isize {square}`
46 --> $DIR/unboxed-closures-wrong-abi.rs:24:26
47 |
48 LL | fn call_it_once<F:FnOnce(&isize)->isize>(_: F, _: isize) -> isize { 0 }
49 | ----- required by this bound in `call_it_once`
50 ...
51 LL | let z = call_it_once(square, 22);
52 | ^^^^^^ expected an `FnOnce<(&isize,)>` closure, found `for<'r> extern "C" fn(&'r isize) -> isize {square}`
53 |
54 = help: the trait `std::ops::FnOnce<(&isize,)>` is not implemented for `for<'r> extern "C" fn(&'r isize) -> isize {square}`
55
56 error: aborting due to 5 previous errors
57
58 For more information about this error, try `rustc --explain E0277`.