about summary refs log tree commit diff
path: root/src/libstd/ffi/c_str.rs
diff options
context:
space:
mode:
authorMikail Bagishov <bagishov.mikail@yandex.ru>2019-06-19 23:15:19 +0300
committerMikail Bagishov <bagishov.mikail@yandex.ru>2019-08-09 17:41:40 +0300
commit740f8db85572aef58d0734fc60bc2b54862ebbb0 (patch)
treeae5e737146380e5806379187e97441b53231f8a2 /src/libstd/ffi/c_str.rs
parent5e0c6a69e075d9c7d19e28264bb8941f72ecaf4e (diff)
Add FIXME-s that some types should be transparent
Diffstat (limited to 'src/libstd/ffi/c_str.rs')
-rw-r--r--src/libstd/ffi/c_str.rs6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/libstd/ffi/c_str.rs b/src/libstd/ffi/c_str.rs
index 5c6c43017cf..f7ad62f4e9a 100644
--- a/src/libstd/ffi/c_str.rs
+++ b/src/libstd/ffi/c_str.rs
@@ -195,6 +195,12 @@ pub struct CString {
 /// [`from_ptr`]: #method.from_ptr
 #[derive(Hash)]
 #[stable(feature = "rust1", since = "1.0.0")]
+// FIXME:
+// `fn from` in `impl From<&CStr> for Box<CStr>` current implementation relies
+// on `CStr` being layout-compatible with `[u8]`.
+// When attribute privacy is implemented, `CStr` should be annotated as `#[repr(transparent)]`.
+// Anyway, `CStr` representation and layout are considered implementation detail, are
+// not documented and must not be relied upon.
 pub struct CStr {
     // FIXME: this should not be represented with a DST slice but rather with
     //        just a raw `c_char` along with some form of marker to make