Add FIXME-s that some types should be transparent
This commit is contained in:
parent
5e0c6a69e0
commit
740f8db855
4 changed files with 30 additions and 0 deletions
|
@ -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,
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue