Rollup merge of #128046 - GrigorenkoPV:90435, r=tgross35

Fix some `#[cfg_attr(not(doc), repr(..))]`

Now that #90435 seems to have been resolved.
This commit is contained in:
Matthias Krüger
2024-07-24 22:22:17 +02:00
committed by GitHub
7 changed files with 11 additions and 15 deletions

View File

@@ -115,10 +115,8 @@ impl crate::sealed::Sealed for OsString {}
#[stable(feature = "rust1", since = "1.0.0")]
// `OsStr::from_inner` current implementation relies
// on `OsStr` being layout-compatible with `Slice`.
// However, `OsStr` layout is considered an implementation detail and must not be relied upon. We
// want `repr(transparent)` but we don't want it to show up in rustdoc, so we hide it under
// `cfg(doc)`. This is an ad-hoc implementation of attribute privacy.
#[cfg_attr(not(doc), repr(transparent))]
// However, `OsStr` layout is considered an implementation detail and must not be relied upon.
#[repr(transparent)]
pub struct OsStr {
inner: Slice,
}

View File

@@ -2079,10 +2079,8 @@ impl AsRef<OsStr> for PathBuf {
#[stable(feature = "rust1", since = "1.0.0")]
// `Path::new` current implementation relies
// on `Path` being layout-compatible with `OsStr`.
// However, `Path` layout is considered an implementation detail and must not be relied upon. We
// want `repr(transparent)` but we don't want it to show up in rustdoc, so we hide it under
// `cfg(doc)`. This is an ad-hoc implementation of attribute privacy.
#[cfg_attr(not(doc), repr(transparent))]
// However, `Path` layout is considered an implementation detail and must not be relied upon.
#[repr(transparent)]
pub struct Path {
inner: OsStr,
}