diff options
| author | Matthias Krüger <matthias.krueger@famsik.de> | 2024-07-24 22:22:17 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-07-24 22:22:17 +0200 |
| commit | 07947f3773f90dcded73de27daee0b44cfd035bb (patch) | |
| tree | 6aa5d5356a65de59034ddc23e83e76e03d2314ca /library/std/src | |
| parent | 2ff33bb1df6ef62a8f325887324cecf4b00f5087 (diff) | |
| parent | b74f426e074bbaafdd9d15d60c3f57ff4e3f91b9 (diff) | |
| download | rust-07947f3773f90dcded73de27daee0b44cfd035bb.tar.gz rust-07947f3773f90dcded73de27daee0b44cfd035bb.zip | |
Rollup merge of #128046 - GrigorenkoPV:90435, r=tgross35
Fix some `#[cfg_attr(not(doc), repr(..))]` Now that #90435 seems to have been resolved.
Diffstat (limited to 'library/std/src')
| -rw-r--r-- | library/std/src/ffi/os_str.rs | 6 | ||||
| -rw-r--r-- | library/std/src/path.rs | 6 |
2 files changed, 4 insertions, 8 deletions
diff --git a/library/std/src/ffi/os_str.rs b/library/std/src/ffi/os_str.rs index f9dba08da4c..0fb3964c9a9 100644 --- a/library/std/src/ffi/os_str.rs +++ b/library/std/src/ffi/os_str.rs @@ -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, } diff --git a/library/std/src/path.rs b/library/std/src/path.rs index d5121a554bf..0cef862549c 100644 --- a/library/std/src/path.rs +++ b/library/std/src/path.rs @@ -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, } |
