]> git.lizzy.rs Git - rust.git/blob - src/test/ui/unboxed-closures/unboxed-closures-wrong-arg-type-extern-fn.stderr
Rollup merge of #88090 - nbdd0121:inference, r=nikomatsakis
[rust.git] / src / test / ui / unboxed-closures / unboxed-closures-wrong-arg-type-extern-fn.stderr
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
3    |
4 LL |     let x = call_it(&square, 22);
5    |             ------- ^^^^^^^ expected an `Fn<(&isize,)>` closure, found `unsafe fn(isize) -> isize {square}`
6    |             |
7    |             required by a bound introduced by this call
8    |
9    = help: the trait `for<'r> Fn<(&'r isize,)>` is not implemented for `unsafe fn(isize) -> isize {square}`
10 note: required by a bound in `call_it`
11   --> $DIR/unboxed-closures-wrong-arg-type-extern-fn.rs:10:15
12    |
13 LL | fn call_it<F: Fn(&isize) -> isize>(_: &F, _: isize) -> isize {
14    |               ^^^^^^^^^^^^^^^^^^^ required by this bound in `call_it`
15
16 error[E0277]: expected a `FnMut<(&isize,)>` closure, found `unsafe fn(isize) -> isize {square}`
17   --> $DIR/unboxed-closures-wrong-arg-type-extern-fn.rs:26:25
18    |
19 LL |     let y = call_it_mut(&mut square, 22);
20    |             ----------- ^^^^^^^^^^^ expected an `FnMut<(&isize,)>` closure, found `unsafe fn(isize) -> isize {square}`
21    |             |
22    |             required by a bound introduced by this call
23    |
24    = help: the trait `for<'r> FnMut<(&'r isize,)>` is not implemented for `unsafe fn(isize) -> isize {square}`
25 note: required by a bound in `call_it_mut`
26   --> $DIR/unboxed-closures-wrong-arg-type-extern-fn.rs:13:19
27    |
28 LL | fn call_it_mut<F: FnMut(&isize) -> isize>(_: &mut F, _: isize) -> isize {
29    |                   ^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `call_it_mut`
30
31 error[E0277]: expected a `FnOnce<(&isize,)>` closure, found `unsafe fn(isize) -> isize {square}`
32   --> $DIR/unboxed-closures-wrong-arg-type-extern-fn.rs:31:26
33    |
34 LL |     let z = call_it_once(square, 22);
35    |             ------------ ^^^^^^ expected an `FnOnce<(&isize,)>` closure, found `unsafe fn(isize) -> isize {square}`
36    |             |
37    |             required by a bound introduced by this call
38    |
39    = help: the trait `for<'r> FnOnce<(&'r isize,)>` is not implemented for `unsafe fn(isize) -> isize {square}`
40 note: required by a bound in `call_it_once`
41   --> $DIR/unboxed-closures-wrong-arg-type-extern-fn.rs:16:20
42    |
43 LL | fn call_it_once<F: FnOnce(&isize) -> isize>(_: F, _: isize) -> isize {
44    |                    ^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `call_it_once`
45
46 error: aborting due to 3 previous errors
47
48 For more information about this error, try `rustc --explain E0277`.