@@ -1158,12 +1158,10 @@ impl FusedIterator for Ancestors<'_> {}
11581158/// Which method works best depends on what kind of situation you're in.
11591159#[ cfg_attr( not( test) , rustc_diagnostic_item = "PathBuf" ) ]
11601160#[ stable( feature = "rust1" , since = "1.0.0" ) ]
1161- // `PathBuf::as_mut_vec` current implementation relies
1162- // on `PathBuf` being layout-compatible with `Vec<u8>`.
1163- // However, `PathBuf` layout is considered an implementation detail and must not be relied upon. We
1164- // want `repr(transparent)` but we don't want it to show up in rustdoc, so we hide it under
1165- // `cfg(doc)`. This is an ad-hoc implementation of attribute privacy.
1166- #[ cfg_attr( not( doc) , repr( transparent) ) ]
1161+ // `PathBuf::as_mut_vec` current implementation relies on `PathBuf` being
1162+ // layout-compatible with `Vec<u8>`. However, `PathBuf` layout is considered an
1163+ // implementation detail and must not be relied upon.
1164+ #[ repr( transparent) ]
11671165pub struct PathBuf {
11681166 inner : OsString ,
11691167}
@@ -1983,12 +1981,10 @@ impl AsRef<OsStr> for PathBuf {
19831981/// ```
19841982#[ cfg_attr( not( test) , rustc_diagnostic_item = "Path" ) ]
19851983#[ stable( feature = "rust1" , since = "1.0.0" ) ]
1986- // `Path::new` current implementation relies
1987- // on `Path` being layout-compatible with `OsStr`.
1988- // However, `Path` layout is considered an implementation detail and must not be relied upon. We
1989- // want `repr(transparent)` but we don't want it to show up in rustdoc, so we hide it under
1990- // `cfg(doc)`. This is an ad-hoc implementation of attribute privacy.
1991- #[ cfg_attr( not( doc) , repr( transparent) ) ]
1984+ // `Path::new` current implementation relies on `Path` being layout-compatible
1985+ // with `OsStr`. However, `Path` layout is considered an implementation detail
1986+ // and must not be relied upon.
1987+ #[ repr( transparent) ]
19921988pub struct Path {
19931989 inner : OsStr ,
19941990}
0 commit comments