diff options
| author | Mikail Bagishov <bagishov.mikail@yandex.ru> | 2019-06-19 23:15:19 +0300 |
|---|---|---|
| committer | Mikail Bagishov <bagishov.mikail@yandex.ru> | 2019-08-09 17:41:40 +0300 |
| commit | 740f8db85572aef58d0734fc60bc2b54862ebbb0 (patch) | |
| tree | ae5e737146380e5806379187e97441b53231f8a2 /src/libstd/path.rs | |
| parent | 5e0c6a69e075d9c7d19e28264bb8941f72ecaf4e (diff) | |
| download | rust-740f8db85572aef58d0734fc60bc2b54862ebbb0.tar.gz rust-740f8db85572aef58d0734fc60bc2b54862ebbb0.zip | |
Add FIXME-s that some types should be transparent
Diffstat (limited to 'src/libstd/path.rs')
| -rw-r--r-- | src/libstd/path.rs | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/src/libstd/path.rs b/src/libstd/path.rs index 126bc3754da..9f7a081403d 100644 --- a/src/libstd/path.rs +++ b/src/libstd/path.rs @@ -1123,6 +1123,12 @@ impl FusedIterator for Ancestors<'_> {} /// Which method works best depends on what kind of situation you're in. #[derive(Clone)] #[stable(feature = "rust1", since = "1.0.0")] +// FIXME: +// `PathBuf::as_mut_vec` current implementation relies +// on `PathBuf` being layout-compatible with `Vec<u8>`. +// When attribute privacy is implemented, `PathBuf` should be annotated as `#[repr(transparent)]`. +// Anyway, `PathBuf` representation and layout are considered implementation detail, are +// not documented and must not be relied upon. pub struct PathBuf { inner: OsString, } @@ -1745,6 +1751,12 @@ impl AsRef<OsStr> for PathBuf { /// assert_eq!(extension, Some(OsStr::new("txt"))); /// ``` #[stable(feature = "rust1", since = "1.0.0")] +// FIXME: +// `Path::new` current implementation relies +// on `Path` being layout-compatible with `OsStr`. +// When attribute privacy is implemented, `Path` should be annotated as `#[repr(transparent)]`. +// Anyway, `Path` representation and layout are considered implementation detail, are +// not documented and must not be relied upon. pub struct Path { inner: OsStr, } |
