@@ -1158,12 +1158,10 @@ impl FusedIterator for Ancestors<'_> {}
1158
1158
/// Which method works best depends on what kind of situation you're in.
1159
1159
#[ cfg_attr( not( test) , rustc_diagnostic_item = "PathBuf" ) ]
1160
1160
#[ 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) ]
1167
1165
pub struct PathBuf {
1168
1166
inner : OsString ,
1169
1167
}
@@ -1983,12 +1981,10 @@ impl AsRef<OsStr> for PathBuf {
1983
1981
/// ```
1984
1982
#[ cfg_attr( not( test) , rustc_diagnostic_item = "Path" ) ]
1985
1983
#[ 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) ]
1992
1988
pub struct Path {
1993
1989
inner : OsStr ,
1994
1990
}
0 commit comments