@@ -2,12 +2,12 @@ error[E0277]: expected a `Fn<(&isize,)>` closure, found `for<'r> unsafe fn(&'r i
22 --> $DIR/unboxed-closures-unsafe-extern-fn.rs:20:21
33 |
44LL | let x = call_it(&square, 22);
5- | ------- ^^^^^^^ expected an `Fn<(&isize,)>` closure, found `for<'r> unsafe fn(&'r isize) -> isize {square }`
5+ | ------- ^^^^^^^ call the function in a closure: `|| unsafe { /* code */ }`
66 | |
77 | required by a bound introduced by this call
88 |
99 = help: the trait `for<'r> Fn<(&'r isize,)>` is not implemented for `for<'r> unsafe fn(&'r isize) -> isize {square}`
10- = note: unsafe functions must be wrapped in closures: `|| unsafe { /* code */ }`
10+ = note: unsafe function cannot be called generically without an unsafe block
1111note: required by a bound in `call_it`
1212 --> $DIR/unboxed-closures-unsafe-extern-fn.rs:9:15
1313 |
@@ -18,12 +18,12 @@ error[E0277]: expected a `FnMut<(&isize,)>` closure, found `for<'r> unsafe fn(&'
1818 --> $DIR/unboxed-closures-unsafe-extern-fn.rs:25:25
1919 |
2020LL | let y = call_it_mut(&mut square, 22);
21- | ----------- ^^^^^^^^^^^ expected an `FnMut<(&isize,)>` closure, found `for<'r> unsafe fn(&'r isize) -> isize {square }`
21+ | ----------- ^^^^^^^^^^^ call the function in a closure: `|| unsafe { /* code */ }`
2222 | |
2323 | required by a bound introduced by this call
2424 |
2525 = help: the trait `for<'r> FnMut<(&'r isize,)>` is not implemented for `for<'r> unsafe fn(&'r isize) -> isize {square}`
26- = note: unsafe functions must be wrapped in closures: `|| unsafe { /* code */ }`
26+ = note: unsafe function cannot be called generically without an unsafe block
2727note: required by a bound in `call_it_mut`
2828 --> $DIR/unboxed-closures-unsafe-extern-fn.rs:12:19
2929 |
@@ -34,12 +34,12 @@ error[E0277]: expected a `FnOnce<(&isize,)>` closure, found `for<'r> unsafe fn(&
3434 --> $DIR/unboxed-closures-unsafe-extern-fn.rs:30:26
3535 |
3636LL | let z = call_it_once(square, 22);
37- | ------------ ^^^^^^ expected an `FnOnce<(&isize,)>` closure, found `for<'r> unsafe fn(&'r isize) -> isize {square }`
37+ | ------------ ^^^^^^ call the function in a closure: `|| unsafe { /* code */ }`
3838 | |
3939 | required by a bound introduced by this call
4040 |
4141 = help: the trait `for<'r> FnOnce<(&'r isize,)>` is not implemented for `for<'r> unsafe fn(&'r isize) -> isize {square}`
42- = note: unsafe functions must be wrapped in closures: `|| unsafe { /* code */ }`
42+ = note: unsafe function cannot be called generically without an unsafe block
4343note: required by a bound in `call_it_once`
4444 --> $DIR/unboxed-closures-unsafe-extern-fn.rs:15:20
4545 |
0 commit comments