about summary refs log tree commit diff
path: root/library/std/src/ffi
diff options
context:
space:
mode:
authorRalf Jung <post@ralfj.de>2023-08-14 10:38:46 +0200
committerRalf Jung <post@ralfj.de>2023-08-14 10:40:59 +0200
commitf887f5a9c6393d1f3eef98cdf13b4491e27b22e4 (patch)
treee9cc0c396f3ccddd4c347f84020954422da123e9 /library/std/src/ffi
parent3071e0aef6dfd0a150c3fb1da0abad4ec86ca0aa (diff)
std: add some missing repr(transparent)
Diffstat (limited to 'library/std/src/ffi')
-rw-r--r--library/std/src/ffi/os_str.rs3
1 files changed, 3 insertions, 0 deletions
diff --git a/library/std/src/ffi/os_str.rs b/library/std/src/ffi/os_str.rs
index 67e58fd1b86..a9907ae1034 100644
--- a/library/std/src/ffi/os_str.rs
+++ b/library/std/src/ffi/os_str.rs
@@ -116,6 +116,9 @@ impl crate::sealed::Sealed for OsString {}
 // When attribute privacy is implemented, `OsStr` should be annotated as `#[repr(transparent)]`.
 // Anyway, `OsStr` representation and layout are considered implementation details, are
 // not documented and must not be relied upon.
+// For now we just hide this from rustdoc, technically making our doc test builds rely on
+// unspecified layout assumptions. We are std, so we can get away with that.
+#[cfg_attr(not(doc), repr(transparent))]
 pub struct OsStr {
     inner: Slice,
 }