This type should implement both debug and display. The Display implementation seems obvious (we should just print the string contents). Should the Debug implementation be the same? Since PWSTR is often used at the ABI barrier, it might make sense to show the value of the ptr itself as well.
That would be unsound. (Displaying the memory I mean.)
@Lokathor Why would this be unsound? I think if the ptr is non-null the contents should be fine to read and display.
that assumes correctly created values, which you cannot do with public fields.
println!("{}", PWSTR(4 as _)); // gonna be a bad time
That's very true. We'll probably have to create an unsafe display function much like std::path::Path::display (which isn't unsafe).
Most helpful comment
that assumes correctly created values, which you cannot do with public fields.