Unsound casting between Struct without specified representation
The source of unsoundness
Hi, we consider that the casting from `UnixStr` to `Path` is unsound in `Path::new()`:
pub fn new<S: AsRef<UnixStr> + ?Sized>(s: &S) -> &Path {
unsafe { &*(s.as_ref() as *const UnixStr as *const Path) }
The struct `Path` here is declared with `repr(Rust)` which is unstable. `rustc` preserves its right to insert padding around the fields, or to the worst, the fields of struct could be reordered while casting. From the code, we could find that `Path` actually is the wrapper type of `UnixStr`. Therefore, we suggest to specify `Path` as `repr(transparent)`.