2 Checks for casts of a function pointer to any integer type.
5 Casting a function pointer to an integer can have surprising results and can occur
6 accidentally if parentheses are omitted from a function call. If you aren't doing anything
7 low-level with function pointers then you can opt-out of casting functions to integers in
8 order to avoid mistakes. Alternatively, you can use this lint to audit all uses of function
9 pointer casts in your code.
13 // fn1 is cast as `usize`
22 // maybe you intended to call the function?
26 let _ = fn2() as usize;
30 // maybe you intended to cast it to a function type?
34 let _ = fn3 as fn() -> u16;