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
core::ffi::CStr doesn't implement TryFromBytes or IntoBytes, but it meets the requirements for both.
Currently core::ffi::CStr is a wrapper around [u8], but theoretically it'll change so &CStr is a thin pointer.
Before this lands, we should seriously consider:
Is <CStr as TryFromBytes>::try_ref_from_bytes and <CStr as IntoBytes>::as_bytes eventually having dynamic performance unacceptable?
Is it risky to use mem::size_of_val for a CStr? mem::size_of_val(&cstr) currently works today, so it'd be very surprising if that breaks for CStr even when extern types land. Would upstream really break its current behavior on stable?
zerocopy would always include the nul byte in as_bytes - could that be confusing?
The text was updated successfully, but these errors were encountered:
core::ffi::CStr
doesn't implementTryFromBytes
orIntoBytes
, but it meets the requirements for both.Currently
core::ffi::CStr
is a wrapper around[u8]
, but theoretically it'll change so&CStr
is a thin pointer.Before this lands, we should seriously consider:
<CStr as TryFromBytes>::try_ref_from_bytes
and<CStr as IntoBytes>::as_bytes
eventually having dynamic performance unacceptable?mem::size_of_val
for aCStr
?mem::size_of_val(&cstr)
currently works today, so it'd be very surprising if that breaks forCStr
even when extern types land. Would upstream really break its current behavior on stable?nul
byte inas_bytes
- could that be confusing?The text was updated successfully, but these errors were encountered: