Casting to a function is deemed unsafe

Which it is.
Casting is now done with std::cast::transmute.