mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-26 08:44:35 +00:00
Add note about possible allocation-sharing to Arc/Rc<str/[T]/CStr>::default.
This commit is contained in:
parent
5c6326ad79
commit
0b3ebb546f
@ -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();
|
||||
|
@ -2228,6 +2228,8 @@ impl<T: Default> Default for Rc<T> {
|
||||
#[stable(feature = "more_rc_default_impls", since = "CURRENT_RUSTC_VERSION")]
|
||||
impl Default for Rc<str> {
|
||||
/// Creates an empty str inside an Rc
|
||||
///
|
||||
/// This may or may not share an allocation with other Rcs on the same thread.
|
||||
#[inline]
|
||||
fn default() -> Self {
|
||||
Rc::from("")
|
||||
@ -2238,6 +2240,8 @@ impl Default for Rc<str> {
|
||||
#[stable(feature = "more_rc_default_impls", since = "CURRENT_RUSTC_VERSION")]
|
||||
impl<T> Default for Rc<[T]> {
|
||||
/// Creates an empty `[T]` inside an Rc
|
||||
///
|
||||
/// This may or may not share an allocation with other Rcs on the same thread.
|
||||
#[inline]
|
||||
fn default() -> Self {
|
||||
let arr: [T; 0] = [];
|
||||
|
@ -3304,6 +3304,8 @@ impl<T: Default> Default for Arc<T> {
|
||||
#[stable(feature = "more_rc_default_impls", since = "CURRENT_RUSTC_VERSION")]
|
||||
impl Default for Arc<str> {
|
||||
/// Creates an empty str inside an Arc
|
||||
///
|
||||
/// This may or may not share an allocation with other Arcs.
|
||||
#[inline]
|
||||
fn default() -> Self {
|
||||
Arc::from("")
|
||||
@ -3314,6 +3316,8 @@ impl Default for Arc<str> {
|
||||
#[stable(feature = "more_rc_default_impls", since = "CURRENT_RUSTC_VERSION")]
|
||||
impl<T> Default for Arc<[T]> {
|
||||
/// Creates an empty `[T]` inside an Arc
|
||||
///
|
||||
/// This may or may not share an allocation with other Arcs.
|
||||
#[inline]
|
||||
fn default() -> Self {
|
||||
let arr: [T; 0] = [];
|
||||
|
Loading…
Reference in New Issue
Block a user