Open
Description
We just had something like the following code in IRC. It would be nice if clippy suggested to replace the transmute with &*(self.0 as *const i32)
struct Foo(*const i32);
fn foo(foo: &Foo) -> &i32 {
unsafe { transmute(foo) }
}
This is an extension of the existing lint that complains about transmute<*const T, &T>(raw_ptr)
. We just need to check whether the transmuted-from type is a struct which has only a single raw pointer field (or all other fields are ZST).