- Notifications
You must be signed in to change notification settings - Fork 13.8k
Closed
Closed
Copy link
Labels
A-lintsArea: Lints (warnings about flaws in source code) such as unused_mut.Area: Lints (warnings about flaws in source code) such as unused_mut.C-bugCategory: This is a bug.Category: This is a bug.
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
Metadata
Metadata
Assignees
Labels
A-lintsArea: Lints (warnings about flaws in source code) such as unused_mut.Area: Lints (warnings about flaws in source code) such as unused_mut.C-bugCategory: This is a bug.Category: This is a bug.