about summary refs log tree commit diff
diff options
context:
space:
mode:
authorRalf Jung <post@ralfj.de>2023-08-16 09:37:06 +0200
committerRalf Jung <post@ralfj.de>2023-08-16 09:37:06 +0200
commit3e9679e86106648eb32f9a5a495cb1ed708c0f50 (patch)
tree9996677e236681808c6932a0d43986faf585dc2e
parent4e3ce0e782a30d467ddbc542c3eb5d215eac1b9d (diff)
downloadrust-3e9679e86106648eb32f9a5a495cb1ed708c0f50.tar.gz
rust-3e9679e86106648eb32f9a5a495cb1ed708c0f50.zip
clarify CStr lack of layout guarnatees
-rw-r--r--library/core/src/ffi/c_str.rs8
1 files changed, 4 insertions, 4 deletions
diff --git a/library/core/src/ffi/c_str.rs b/library/core/src/ffi/c_str.rs
index 4082b208c12..92e38df4049 100644
--- a/library/core/src/ffi/c_str.rs
+++ b/library/core/src/ffi/c_str.rs
@@ -20,10 +20,10 @@ use crate::str;
 /// in each pair are borrowed references; the latter are owned
 /// strings.
 ///
-/// Note that this structure is **not** `repr(C)` and is not recommended to be
-/// placed in the signatures of FFI functions. Instead, safe wrappers of FFI
-/// functions may leverage the unsafe [`CStr::from_ptr`] constructor to provide
-/// a safe interface to other consumers.
+/// Note that this structure does **not** have a guaranteed layout (the `repr(transparent)`
+/// notwithstanding) and is not recommended to be placed in the signatures of FFI functions.
+/// Instead, safe wrappers of FFI functions may leverage the unsafe [`CStr::from_ptr`] constructor
+/// to provide a safe interface to other consumers.
 ///
 /// [`CString`]: ../../std/ffi/struct.CString.html
 /// [`String`]: ../../std/string/struct.String.html