mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-26 16:54:01 +00:00
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`
This commit is contained in:
commit
503a8fc92d
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user