Added a new rustc lint which will hopefully prevent a lot of very wrong casts: function_casts_as_integer.
In short, if you convert a function to an integer, it will now warn.
Why? Because of cases like:
let _ = [0; u8::max as usize];
u8::max is a function, not a constant (u8::MAX is the constant). Now you get a surprising amount of allocation (and potentially different) every time. :)
So many potential other cases where the end code is NOT the expected one. Well, not anymore!