2 Checks for `as` casts between raw pointers without changing its mutability,
3 namely `*const T` to `*const U` and `*mut T` to `*mut U`.
6 Though `as` casts between raw pointers is not terrible, `pointer::cast` is safer because
7 it cannot accidentally change the pointer's mutability nor cast the pointer to other types like `usize`.
11 let ptr: *const u32 = &42_u32;
12 let mut_ptr: *mut u32 = &mut 42_u32;
13 let _ = ptr as *const i32;
14 let _ = mut_ptr as *mut i32;
18 let ptr: *const u32 = &42_u32;
19 let mut_ptr: *mut u32 = &mut 42_u32;
20 let _ = ptr.cast::<i32>();
21 let _ = mut_ptr.cast::<i32>();