]> git.proxmox.com Git - rustc.git/blame - src/test/ui/unboxed-closures/unboxed-closures-wrong-arg-type-extern-fn.stderr
New upstream version 1.44.1+dfsg1
[rustc.git] / src / test / ui / unboxed-closures / unboxed-closures-wrong-arg-type-extern-fn.stderr
CommitLineData
b7449926 1error[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 4LL | fn call_it<F:Fn(&isize)->isize>(_: &F, _: isize) -> isize { 0 }
ba9703b0 5 | ----------------- required by this bound in `call_it`
e1599b0c 6...
b7449926 7LL | 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
12error[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 15LL | fn call_it<F:Fn(&isize)->isize>(_: &F, _: isize) -> isize { 0 }
ba9703b0 16 | ----- required by this bound in `call_it`
e1599b0c 17...
0731742a 18LL | 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
23error[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 26LL | 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 29LL | 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
34error[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 37LL | 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 40LL | 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
45error[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 48LL | 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 51LL | 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 56error: aborting due to 5 previous errors
b7449926
XL
57
58For more information about this error, try `rustc --explain E0277`.