evdev-rs has a bunch of safety comments of the form:
// # Safety
//
// This is unsafe because it receives a raw C++ pointer as an argument.
This isn't a helpful comment; the standard guidance is that a Safety comment should be a description of either
- What invariants are required to be upheld when calling (for an
unsafe fn), or
- Why the
unsafe block is, in fact, safe.
See, for example, #4803
evdev-rs has a bunch of safety comments of the form:
This isn't a helpful comment; the standard guidance is that a
Safetycomment should be a description of eitherunsafe fn), orunsafeblock is, in fact, safe.See, for example, #4803