1 error[E0277]: expected a `Fn<(&isize,)>` closure, found `unsafe fn(isize) -> isize {square}`
2 --> $DIR/unboxed-closures-wrong-arg-type-extern-fn.rs:21:21
4 LL | let x = call_it(&square, 22);
5 | ------- ^^^^^^^ call the function in a closure: `|| unsafe { /* code */ }`
7 | required by a bound introduced by this call
9 = help: the trait `for<'a> Fn<(&'a isize,)>` is not implemented for fn item `unsafe fn(isize) -> isize {square}`
10 = note: unsafe function cannot be called generically without an unsafe block
11 note: required by a bound in `call_it`
12 --> $DIR/unboxed-closures-wrong-arg-type-extern-fn.rs:10:15
14 LL | fn call_it<F: Fn(&isize) -> isize>(_: &F, _: isize) -> isize {
15 | ^^^^^^^^^^^^^^^^^^^ required by this bound in `call_it`
17 error[E0277]: expected a `FnMut<(&isize,)>` closure, found `unsafe fn(isize) -> isize {square}`
18 --> $DIR/unboxed-closures-wrong-arg-type-extern-fn.rs:26:25
20 LL | let y = call_it_mut(&mut square, 22);
21 | ----------- ^^^^^^^^^^^ call the function in a closure: `|| unsafe { /* code */ }`
23 | required by a bound introduced by this call
25 = help: the trait `for<'a> FnMut<(&'a isize,)>` is not implemented for fn item `unsafe fn(isize) -> isize {square}`
26 = note: unsafe function cannot be called generically without an unsafe block
27 note: required by a bound in `call_it_mut`
28 --> $DIR/unboxed-closures-wrong-arg-type-extern-fn.rs:13:19
30 LL | fn call_it_mut<F: FnMut(&isize) -> isize>(_: &mut F, _: isize) -> isize {
31 | ^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `call_it_mut`
33 error[E0277]: expected a `FnOnce<(&isize,)>` closure, found `unsafe fn(isize) -> isize {square}`
34 --> $DIR/unboxed-closures-wrong-arg-type-extern-fn.rs:31:26
36 LL | let z = call_it_once(square, 22);
37 | ------------ ^^^^^^ call the function in a closure: `|| unsafe { /* code */ }`
39 | required by a bound introduced by this call
41 = help: the trait `for<'a> FnOnce<(&'a isize,)>` is not implemented for fn item `unsafe fn(isize) -> isize {square}`
42 = note: unsafe function cannot be called generically without an unsafe block
43 note: required by a bound in `call_it_once`
44 --> $DIR/unboxed-closures-wrong-arg-type-extern-fn.rs:16:20
46 LL | fn call_it_once<F: FnOnce(&isize) -> isize>(_: F, _: isize) -> isize {
47 | ^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `call_it_once`
49 error: aborting due to 3 previous errors
51 For more information about this error, try `rustc --explain E0277`.