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