Closed
Description
In C FFI it's very common to use Option<fn()>
for callbacks, but the lint #118833 doesn't fire when Option
s of function pointers are compared:
unsafe extern "C" fn func() {}
type FnPtr = unsafe extern "C" fn();
fn main() {
assert_eq!(Some::<FnPtr>(func), Some(func as unsafe extern "C" fn()));
}
This pattern is used in: https://github.com/ImageOptim/mozjpeg-rust/blob/cff5aad77c726c11f460baefc348c7279d0ee647/src/readsrc.rs#L136