File tree Expand file tree Collapse file tree 4 files changed +30
-0
lines changed Expand file tree Collapse file tree 4 files changed +30
-0
lines changed Original file line number Diff line number Diff line change @@ -195,6 +195,12 @@ pub struct CString {
195195/// [`from_ptr`]: #method.from_ptr
196196#[ derive( Hash ) ]
197197#[ stable( feature = "rust1" , since = "1.0.0" ) ]
198+ // FIXME:
199+ // `fn from` in `impl From<&CStr> for Box<CStr>` current implementation relies
200+ // on `CStr` being layout-compatible with `[u8]`.
201+ // When attribute privacy is implemented, `CStr` should be annotated as `#[repr(transparent)]`.
202+ // Anyway, `CStr` representation and layout are considered implementation detail, are
203+ // not documented and must not be relied upon.
198204pub struct CStr {
199205 // FIXME: this should not be represented with a DST slice but rather with
200206 // just a raw `c_char` along with some form of marker to make
Original file line number Diff line number Diff line change @@ -97,6 +97,12 @@ pub struct OsString {
9797/// [`String`]: ../string/struct.String.html
9898/// [conversions]: index.html#conversions
9999#[ stable( feature = "rust1" , since = "1.0.0" ) ]
100+ // FIXME:
101+ // `OsStr::from_inner` current implementation relies
102+ // on `OsStr` being layout-compatible with `Slice`.
103+ // When attribute privacy is implemented, `OsStr` should be annotated as `#[repr(transparent)]`.
104+ // Anyway, `OsStr` representation and layout are considered implementation detail, are
105+ // not documented and must not be relied upon.
100106pub struct OsStr {
101107 inner : Slice
102108}
Original file line number Diff line number Diff line change @@ -1123,6 +1123,12 @@ impl FusedIterator for Ancestors<'_> {}
11231123/// Which method works best depends on what kind of situation you're in.
11241124#[ derive( Clone ) ]
11251125#[ stable( feature = "rust1" , since = "1.0.0" ) ]
1126+ // FIXME:
1127+ // `PathBuf::as_mut_vec` current implementation relies
1128+ // on `PathBuf` being layout-compatible with `Vec<u8>`.
1129+ // When attribute privacy is implemented, `PathBuf` should be annotated as `#[repr(transparent)]`.
1130+ // Anyway, `PathBuf` representation and layout are considered implementation detail, are
1131+ // not documented and must not be relied upon.
11261132pub struct PathBuf {
11271133 inner : OsString ,
11281134}
@@ -1745,6 +1751,12 @@ impl AsRef<OsStr> for PathBuf {
17451751/// assert_eq!(extension, Some(OsStr::new("txt")));
17461752/// ```
17471753#[ stable( feature = "rust1" , since = "1.0.0" ) ]
1754+ // FIXME:
1755+ // `Path::new` current implementation relies
1756+ // on `Path` being layout-compatible with `OsStr`.
1757+ // When attribute privacy is implemented, `Path` should be annotated as `#[repr(transparent)]`.
1758+ // Anyway, `Path` representation and layout are considered implementation detail, are
1759+ // not documented and must not be relied upon.
17481760pub struct Path {
17491761 inner : OsStr ,
17501762}
Original file line number Diff line number Diff line change @@ -18,6 +18,12 @@ pub(crate) struct Buf {
1818 pub inner : Vec < u8 >
1919}
2020
21+ // FIXME:
22+ // `Buf::as_slice` current implementation relies
23+ // on `Slice` being layout-compatible with `[u8]`.
24+ // When attribute privacy is implemented, `Slice` should be annotated as `#[repr(transparent)]`.
25+ // Anyway, `Slice` representation and layout are considered implementation detail, are
26+ // not documented and must not be relied upon.
2127pub ( crate ) struct Slice {
2228 pub inner : [ u8 ]
2329}
You can’t perform that action at this time.
0 commit comments