blob: 5c2e73f57160dfe5152f6787acaa4dcf67db0383 [file] [log] [blame]
error[E0277]: the trait bound `for<'r> unsafe fn(isize) -> isize {square}: std::ops::Fn<(&'r isize,)>` is not satisfied
--> $DIR/unboxed-closures-wrong-arg-type-extern-fn.rs:23:13
|
LL | let x = call_it(&square, 22);
| ^^^^^^^ the trait `for<'r> std::ops::Fn<(&'r isize,)>` is not implemented for `unsafe fn(isize) -> isize {square}`
|
note: required by `call_it`
--> $DIR/unboxed-closures-wrong-arg-type-extern-fn.rs:18:1
|
LL | fn call_it<F:Fn(&isize)->isize>(_: &F, _: isize) -> isize { 0 }
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
error[E0277]: the trait bound `for<'r> unsafe fn(isize) -> isize {square}: std::ops::FnMut<(&'r isize,)>` is not satisfied
--> $DIR/unboxed-closures-wrong-arg-type-extern-fn.rs:28:13
|
LL | let y = call_it_mut(&mut square, 22);
| ^^^^^^^^^^^ the trait `for<'r> std::ops::FnMut<(&'r isize,)>` is not implemented for `unsafe fn(isize) -> isize {square}`
|
note: required by `call_it_mut`
--> $DIR/unboxed-closures-wrong-arg-type-extern-fn.rs:19:1
|
LL | fn call_it_mut<F:FnMut(&isize)->isize>(_: &mut F, _: isize) -> isize { 0 }
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
error[E0277]: the trait bound `for<'r> unsafe fn(isize) -> isize {square}: std::ops::FnOnce<(&'r isize,)>` is not satisfied
--> $DIR/unboxed-closures-wrong-arg-type-extern-fn.rs:33:13
|
LL | let z = call_it_once(square, 22);
| ^^^^^^^^^^^^ the trait `for<'r> std::ops::FnOnce<(&'r isize,)>` is not implemented for `unsafe fn(isize) -> isize {square}`
|
note: required by `call_it_once`
--> $DIR/unboxed-closures-wrong-arg-type-extern-fn.rs:20:1
|
LL | fn call_it_once<F:FnOnce(&isize)->isize>(_: F, _: isize) -> isize { 0 }
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
error: aborting due to 3 previous errors
For more information about this error, try `rustc --explain E0277`.