@@ -2,11 +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 function cannot be called generically without an unsafe block
10
11
note: required by a bound in `call_it`
11
12
--> $DIR/unboxed-closures-unsafe-extern-fn.rs:9:15
12
13
|
@@ -17,11 +18,12 @@ error[E0277]: expected a `FnMut<(&isize,)>` closure, found `for<'r> unsafe fn(&'
17
18
--> $DIR/unboxed-closures-unsafe-extern-fn.rs:25:25
18
19
|
19
20
LL | let y = call_it_mut(&mut square, 22);
20
- | ----------- ^^^^^^^^^^^ expected an `FnMut<(&isize,)>` closure, found `for<'r> unsafe fn(&'r isize) -> isize {square }`
21
+ | ----------- ^^^^^^^^^^^ call the function in a closure: `|| unsafe { /* code */ }`
21
22
| |
22
23
| required by a bound introduced by this call
23
24
|
24
25
= help: the trait `for<'r> FnMut<(&'r isize,)>` is not implemented for `for<'r> unsafe fn(&'r isize) -> isize {square}`
26
+ = note: unsafe function cannot be called generically without an unsafe block
25
27
note: required by a bound in `call_it_mut`
26
28
--> $DIR/unboxed-closures-unsafe-extern-fn.rs:12:19
27
29
|
@@ -32,11 +34,12 @@ error[E0277]: expected a `FnOnce<(&isize,)>` closure, found `for<'r> unsafe fn(&
32
34
--> $DIR/unboxed-closures-unsafe-extern-fn.rs:30:26
33
35
|
34
36
LL | let z = call_it_once(square, 22);
35
- | ------------ ^^^^^^ expected an `FnOnce<(&isize,)>` closure, found `for<'r> unsafe fn(&'r isize) -> isize {square }`
37
+ | ------------ ^^^^^^ call the function in a closure: `|| unsafe { /* code */ }`
36
38
| |
37
39
| required by a bound introduced by this call
38
40
|
39
41
= help: the trait `for<'r> FnOnce<(&'r isize,)>` is not implemented for `for<'r> unsafe fn(&'r isize) -> isize {square}`
42
+ = note: unsafe function cannot be called generically without an unsafe block
40
43
note: required by a bound in `call_it_once`
41
44
--> $DIR/unboxed-closures-unsafe-extern-fn.rs:15:20
42
45
|
0 commit comments