diff options
| author | Zachary S <zasample18+github@gmail.com> | 2024-05-11 07:11:36 -0500 |
|---|---|---|
| committer | Zachary S <zasample18+github@gmail.com> | 2024-05-12 20:27:29 -0500 |
| commit | 0b3ebb546fac5de6be624d335abb3c5f7ad82c74 (patch) | |
| tree | a6c27e7b7c35ca89430b10b4599961c50f05f6ef /library/alloc/src/ffi | |
| parent | 5c6326ad799511e59b1de60b25603309d5322090 (diff) | |
Add note about possible allocation-sharing to Arc/Rc<str/[T]/CStr>::default.
Diffstat (limited to 'library/alloc/src/ffi')
| -rw-r--r-- | library/alloc/src/ffi/c_str.rs | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/library/alloc/src/ffi/c_str.rs b/library/alloc/src/ffi/c_str.rs index 19dd90eb81f..3b56a5717e2 100644 --- a/library/alloc/src/ffi/c_str.rs +++ b/library/alloc/src/ffi/c_str.rs @@ -914,6 +914,8 @@ impl From<&CStr> for Rc<CStr> { #[stable(feature = "more_rc_default_impls", since = "CURRENT_RUSTC_VERSION")] impl Default for Arc<CStr> { /// Creates an empty CStr inside an Arc + /// + /// This may or may not share an allocation with other Arcs. #[inline] fn default() -> Self { let c_str: &CStr = Default::default(); @@ -925,6 +927,8 @@ impl Default for Arc<CStr> { #[stable(feature = "more_rc_default_impls", since = "CURRENT_RUSTC_VERSION")] impl Default for Rc<CStr> { /// Creates an empty CStr inside an Rc + /// + /// This may or may not share an allocation with other Rcs on the same thread. #[inline] fn default() -> Self { let c_str: &CStr = Default::default(); |
