Skip to content

Commit 503a8fc

Browse files
authored
Rollup merge of rust-lang#114881 - RalfJung:cstr, r=cuviper
clarify CStr lack of layout guarnatees Follow-up to rust-lang#114800 r? `@cuviper`
2 parents 084c87d + 3e9679e commit 503a8fc

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

library/core/src/ffi/c_str.rs

+4-4
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,10 @@ use crate::str;
2020
/// in each pair are borrowed references; the latter are owned
2121
/// strings.
2222
///
23-
/// Note that this structure is **not** `repr(C)` and is not recommended to be
24-
/// placed in the signatures of FFI functions. Instead, safe wrappers of FFI
25-
/// functions may leverage the unsafe [`CStr::from_ptr`] constructor to provide
26-
/// a safe interface to other consumers.
23+
/// Note that this structure does **not** have a guaranteed layout (the `repr(transparent)`
24+
/// notwithstanding) and is not recommended to be placed in the signatures of FFI functions.
25+
/// Instead, safe wrappers of FFI functions may leverage the unsafe [`CStr::from_ptr`] constructor
26+
/// to provide a safe interface to other consumers.
2727
///
2828
/// [`CString`]: ../../std/ffi/struct.CString.html
2929
/// [`String`]: ../../std/string/struct.String.html

0 commit comments

Comments
 (0)