|
61 | 61 | ),
|
62 | 62 | on(
|
63 | 63 | _Self = "unsafe fn",
|
| 64 | + note = "unsafe function cannot be called generically without an unsafe block", |
64 | 65 | // SAFETY: tidy is not smart enough to tell that the below unsafe block is a string
|
65 |
| - note = "unsafe functions must be wrapped in closures: `|| unsafe {{ /* code */ }}`" |
| 66 | + label = "call the function in a closure: `|| unsafe {{ /* code */ }}`" |
66 | 67 | ),
|
67 | 68 | message = "expected a `{Fn}<{Args}>` closure, found `{Self}`",
|
68 | 69 | label = "expected an `Fn<{Args}>` closure, found `{Self}`"
|
@@ -146,8 +147,9 @@ pub trait Fn<Args>: FnMut<Args> {
|
146 | 147 | ),
|
147 | 148 | on(
|
148 | 149 | _Self = "unsafe fn",
|
| 150 | + note = "unsafe function cannot be called generically without an unsafe block", |
149 | 151 | // SAFETY: tidy is not smart enough to tell that the below unsafe block is a string
|
150 |
| - note = "unsafe functions must be wrapped in closures: `|| unsafe {{ /* code */ }}`" |
| 152 | + label = "call the function in a closure: `|| unsafe {{ /* code */ }}`" |
151 | 153 | ),
|
152 | 154 | message = "expected a `{FnMut}<{Args}>` closure, found `{Self}`",
|
153 | 155 | label = "expected an `FnMut<{Args}>` closure, found `{Self}`"
|
@@ -223,8 +225,9 @@ pub trait FnMut<Args>: FnOnce<Args> {
|
223 | 225 | ),
|
224 | 226 | on(
|
225 | 227 | _Self = "unsafe fn",
|
| 228 | + note = "unsafe function cannot be called generically without an unsafe block", |
226 | 229 | // SAFETY: tidy is not smart enough to tell that the below unsafe block is a string
|
227 |
| - note = "unsafe functions must be wrapped in closures: `|| unsafe {{ /* code */ }}`" |
| 230 | + label = "call the function in a closure: `|| unsafe {{ /* code */ }}`" |
228 | 231 | ),
|
229 | 232 | message = "expected a `{FnOnce}<{Args}>` closure, found `{Self}`",
|
230 | 233 | label = "expected an `FnOnce<{Args}>` closure, found `{Self}`"
|
|
0 commit comments