Description
Rust has moved CStr
into libcore and CString
into liballoc: rust-lang/rust#94079
As an aside, I'm still fond of the idea of using u8
instead of c_char
for this, because there isn't any reason to care about the signedness of C's char
in nul-terminated string contexts—if you want to interpret the contents, you need to know the encoding, and the signedness of char
doesn't help with that. Exposing c_char
at this level just means that more places are exposed to gratuitous platform differences. But it's also true that in practice this issue is just a minor nuisance. Rust already had CStr
with c_char
, and replacing it with something that uses u8
would create a lot of churn, so keeping it makes sense.
So now that CStr
has moved to core in nightly, that eliminates the need for ZStr
in rustix, so rustix should switch to using CStr
now.