You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
The text was updated successfully, but these errors were encountered:
* Remove `ZStr` and `ZString`.
Use `CStr` and `CString` instead, now that nightly has then in core and
alloc, respectively.
Fixes#336.
* Enable "core_c_str" on nightly to use core::ffi::CStr.
* Don't test --no-default-features on stable.
--no-default-features disables "std", and building without "std" will
require nightly now.
* `CString` and `NulError` are in alloc.
* Add comments to the relevant Cargo.toml features.
* rustfmt
Rust has moved
CStr
into libcore andCString
into liballoc: rust-lang/rust#94079As an aside, I'm still fond of the idea of using
u8
instead ofc_char
for this, because there isn't any reason to care about the signedness of C'schar
in nul-terminated string contexts—if you want to interpret the contents, you need to know the encoding, and the signedness ofchar
doesn't help with that. Exposingc_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 hadCStr
withc_char
, and replacing it with something that usesu8
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 forZStr
in rustix, so rustix should switch to usingCStr
now.The text was updated successfully, but these errors were encountered: