diff options
| author | Matthias Krüger <matthias.krueger@famsik.de> | 2023-08-17 08:39:22 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2023-08-17 08:39:22 +0200 |
| commit | 503a8fc92d222cf33b26da97c226141afff53d3e (patch) | |
| tree | 4f96869a1ac732ceae09140143f04a7f6aaff968 | |
| parent | 084c87dfea72f9b48cf496dc21f29fbc32270835 (diff) | |
| parent | 3e9679e86106648eb32f9a5a495cb1ed708c0f50 (diff) | |
| download | rust-503a8fc92d222cf33b26da97c226141afff53d3e.tar.gz rust-503a8fc92d222cf33b26da97c226141afff53d3e.zip | |
Rollup merge of #114881 - RalfJung:cstr, r=cuviper
clarify CStr lack of layout guarnatees Follow-up to https://github.com/rust-lang/rust/pull/114800 r? `@cuviper`
| -rw-r--r-- | library/core/src/ffi/c_str.rs | 8 |
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 |
