File tree Expand file tree Collapse file tree 1 file changed +12
-0
lines changed Expand file tree Collapse file tree 1 file changed +12
-0
lines changed Original file line number Diff line number Diff line change 59
59
Args = "()" ,
60
60
note = "wrap the `{Self}` in a closure with no arguments: `|| {{ /* code */ }}`"
61
61
) ,
62
+ on(
63
+ _Self = "unsafe fn" ,
64
+ note = "unsafe functions must be wrapped in closures: `|| unsafe {{ /* code */ }}`"
65
+ ) ,
62
66
message = "expected a `{Fn}<{Args}>` closure, found `{Self}`" ,
63
67
label = "expected an `Fn<{Args}>` closure, found `{Self}`"
64
68
) ]
@@ -139,6 +143,10 @@ pub trait Fn<Args>: FnMut<Args> {
139
143
Args = "()" ,
140
144
note = "wrap the `{Self}` in a closure with no arguments: `|| {{ /* code */ }}`"
141
145
) ,
146
+ on(
147
+ _Self = "unsafe fn" ,
148
+ note = "unsafe functions must be wrapped in closures: `|| unsafe {{ /* code */ }}`"
149
+ ) ,
142
150
message = "expected a `{FnMut}<{Args}>` closure, found `{Self}`" ,
143
151
label = "expected an `FnMut<{Args}>` closure, found `{Self}`"
144
152
) ]
@@ -211,6 +219,10 @@ pub trait FnMut<Args>: FnOnce<Args> {
211
219
Args = "()" ,
212
220
note = "wrap the `{Self}` in a closure with no arguments: `|| {{ /* code */ }}`"
213
221
) ,
222
+ on(
223
+ _Self = "unsafe fn" ,
224
+ note = "unsafe functions must be wrapped in closures: `|| unsafe {{ /* code */ }}`"
225
+ ) ,
214
226
message = "expected a `{FnOnce}<{Args}>` closure, found `{Self}`" ,
215
227
label = "expected an `FnOnce<{Args}>` closure, found `{Self}`"
216
228
) ]
You can’t perform that action at this time.
0 commit comments