fork/rust

git clone https://git.julia.blue/fork/rust

borsAuto merge of #69444 - pietroalbini:stable-next-final-v2-new, r=pietroalbinif3e1a954d2e

1.41.1
3.3 KiB58 linesraw
1error[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   |
4LL | fn call_it<F:Fn(&isize)->isize>(_: &F, _: isize) -> isize { 0 }
5   |    -------   ----------------- required by this bound in `call_it`
6...
7LL |     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
12error[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   |
15LL | fn call_it<F:Fn(&isize)->isize>(_: &F, _: isize) -> isize { 0 }
16   |    -------               ----- required by this bound in `call_it`
17...
18LL |     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
23error[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   |
26LL | fn call_it_mut<F:FnMut(&isize)->isize>(_: &mut F, _: isize) -> isize { 0 }
27   |    -----------   -------------------- required by this bound in `call_it_mut`
28...
29LL |     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
34error[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   |
37LL | fn call_it_mut<F:FnMut(&isize)->isize>(_: &mut F, _: isize) -> isize { 0 }
38   |    -----------                  ----- required by this bound in `call_it_mut`
39...
40LL |     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
45error[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   |
48LL | fn call_it_once<F:FnOnce(&isize)->isize>(_: F, _: isize) -> isize { 0 }
49   |    ------------                   ----- required by this bound in `call_it_once`
50...
51LL |     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
56error: aborting due to 5 previous errors
57
58For more information about this error, try `rustc --explain E0277`.