]> git.proxmox.com Git - rustc.git/blame - src/test/ui/unboxed-closures/unboxed-closures-unsafe-extern-fn.stderr
New upstream version 1.65.0+dfsg1
[rustc.git] / src / test / ui / unboxed-closures / unboxed-closures-unsafe-extern-fn.stderr
CommitLineData
1b1a35ee 1error[E0277]: expected a `Fn<(&isize,)>` closure, found `for<'r> unsafe fn(&'r isize) -> isize {square}`
f035d41b 2 --> $DIR/unboxed-closures-unsafe-extern-fn.rs:20:21
b7449926
XL
3 |
4LL | let x = call_it(&square, 22);
04454e1e 5 | ------- ^^^^^^^ call the function in a closure: `|| unsafe { /* code */ }`
c295e0f8
XL
6 | |
7 | required by a bound introduced by this call
b7449926 8 |
f2b60f7d 9 = help: the trait `for<'r> Fn<(&'r isize,)>` is not implemented for fn item `for<'r> unsafe fn(&'r isize) -> isize {square}`
04454e1e 10 = note: unsafe function cannot be called generically without an unsafe block
94222f64
XL
11note: required by a bound in `call_it`
12 --> $DIR/unboxed-closures-unsafe-extern-fn.rs:9:15
13 |
14LL | fn call_it<F: Fn(&isize) -> isize>(_: &F, _: isize) -> isize {
15 | ^^^^^^^^^^^^^^^^^^^ required by this bound in `call_it`
0731742a 16
1b1a35ee 17error[E0277]: expected a `FnMut<(&isize,)>` closure, found `for<'r> unsafe fn(&'r isize) -> isize {square}`
f035d41b 18 --> $DIR/unboxed-closures-unsafe-extern-fn.rs:25:25
b7449926
XL
19 |
20LL | let y = call_it_mut(&mut square, 22);
04454e1e 21 | ----------- ^^^^^^^^^^^ call the function in a closure: `|| unsafe { /* code */ }`
c295e0f8
XL
22 | |
23 | required by a bound introduced by this call
b7449926 24 |
f2b60f7d 25 = help: the trait `for<'r> FnMut<(&'r isize,)>` is not implemented for fn item `for<'r> unsafe fn(&'r isize) -> isize {square}`
04454e1e 26 = note: unsafe function cannot be called generically without an unsafe block
94222f64
XL
27note: required by a bound in `call_it_mut`
28 --> $DIR/unboxed-closures-unsafe-extern-fn.rs:12:19
29 |
30LL | fn call_it_mut<F: FnMut(&isize) -> isize>(_: &mut F, _: isize) -> isize {
31 | ^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `call_it_mut`
0731742a 32
1b1a35ee 33error[E0277]: expected a `FnOnce<(&isize,)>` closure, found `for<'r> unsafe fn(&'r isize) -> isize {square}`
f035d41b 34 --> $DIR/unboxed-closures-unsafe-extern-fn.rs:30:26
b7449926
XL
35 |
36LL | let z = call_it_once(square, 22);
04454e1e 37 | ------------ ^^^^^^ call the function in a closure: `|| unsafe { /* code */ }`
c295e0f8
XL
38 | |
39 | required by a bound introduced by this call
b7449926 40 |
f2b60f7d 41 = help: the trait `for<'r> FnOnce<(&'r isize,)>` is not implemented for fn item `for<'r> unsafe fn(&'r isize) -> isize {square}`
04454e1e 42 = note: unsafe function cannot be called generically without an unsafe block
94222f64
XL
43note: required by a bound in `call_it_once`
44 --> $DIR/unboxed-closures-unsafe-extern-fn.rs:15:20
45 |
46LL | fn call_it_once<F: FnOnce(&isize) -> isize>(_: F, _: isize) -> isize {
47 | ^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `call_it_once`
b7449926 48
f035d41b 49error: aborting due to 3 previous errors
b7449926
XL
50
51For more information about this error, try `rustc --explain E0277`.