All usecases I’ve seen would be better served by changing the signature of the function, which has the advantage of not being insanely dangerous.
For example, we currently do not guarantee that Box<T>
is passed the same as a raw void
pointer, yet people define extern "C"
functions that take Box<T>
and then transmute them to function pointers taking *mut c_void
, presumably after turning the “C types” lint off for the definition.