var as Type casts and core::mem::transmute s between raw pointer types are generally valid and unchecked by the compiler as long the target pointer type is a thin pointer.
Not specifying the concrete target pointer type allows the compiler to infer it from the surroundings context which may result in the cast accidentally changing due to surrounding type changes resulting in semantically invalid pointer casts.
Raw pointers have a variety of invariants to manually keep track of.
Specifying the concrete types in these scenarios allows the compiler to catch some of these potential issues for the user.
|