@@ -2,12 +2,12 @@ error[E0277]: expected a `Fn<(&isize,)>` closure, found `for<'r> unsafe fn(&'r i
2
2
--> $DIR/unboxed-closures-unsafe-extern-fn.rs:20:21
3
3
|
4
4
LL | 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 */ }`
6
6
| |
7
7
| required by a bound introduced by this call
8
8
|
9
9
= 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
11
11
note: required by a bound in `call_it`
12
12
--> $DIR/unboxed-closures-unsafe-extern-fn.rs:9:15
13
13
|
@@ -18,12 +18,12 @@ error[E0277]: expected a `FnMut<(&isize,)>` closure, found `for<'r> unsafe fn(&'
18
18
--> $DIR/unboxed-closures-unsafe-extern-fn.rs:25:25
19
19
|
20
20
LL | 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 */ }`
22
22
| |
23
23
| required by a bound introduced by this call
24
24
|
25
25
= 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
27
27
note: required by a bound in `call_it_mut`
28
28
--> $DIR/unboxed-closures-unsafe-extern-fn.rs:12:19
29
29
|
@@ -34,12 +34,12 @@ error[E0277]: expected a `FnOnce<(&isize,)>` closure, found `for<'r> unsafe fn(&
34
34
--> $DIR/unboxed-closures-unsafe-extern-fn.rs:30:26
35
35
|
36
36
LL | 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 */ }`
38
38
| |
39
39
| required by a bound introduced by this call
40
40
|
41
41
= 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
43
43
note: required by a bound in `call_it_once`
44
44
--> $DIR/unboxed-closures-unsafe-extern-fn.rs:15:20
45
45
|
0 commit comments