rust/library/alloc/src
Matthias Krüger 21deaed4a1
Rollup merge of #122201 - coolreader18:doc-clone_from, r=dtolnay
Document overrides of `clone_from()` in core/std

As mentioned in https://github.com/rust-lang/rust/pull/96979#discussion_r1379502413

Specifically, when an override doesn't just forward to an inner type, document the behavior and that it's preferred over simply assigning a clone of source. Also, change instances where the second parameter is "other" to "source".

I reused some of the wording over and over for similar impls, but I'm not sure that the wording is actually *good*. Would appreciate feedback about that.

Also, now some of these seem to provide pretty specific guarantees about behavior (e.g. will reuse the exact same allocation iff the len is the same), but I was basing it off of the docs for [`Box::clone_from`](https://doc.rust-lang.org/1.75.0/std/boxed/struct.Box.html#method.clone_from-1) - I'm not sure if providing those strong guarantees is actually good or not.
2024-04-17 18:01:37 +02:00
..
alloc run alloc benchmarks in Miri and fix UB 2022-11-07 10:34:04 +01:00
boxed Do not allocate for ZST ThinBox attempt 2 (using const_allocate) 2024-04-05 19:55:00 +01:00
collections Rollup merge of #122201 - coolreader18:doc-clone_from, r=dtolnay 2024-04-17 18:01:37 +02:00
ffi lib: fix some unnecessary_cast clippy lint 2024-03-25 23:19:40 +03:00
raw_vec try_with_capacity for RawVec 2024-03-01 18:20:48 +00:00
rc remove redundant imports 2023-12-10 10:56:22 +08:00
slice ignore core, alloc and test tests that require unwinding on panic=abort 2023-06-13 15:53:24 +02:00
sync Fix some Arc allocator leaks 2024-01-28 18:33:34 +01:00
testing Share testing utilities with non-btree test cases 2022-05-02 10:07:50 +02:00
vec Rollup merge of #122201 - coolreader18:doc-clone_from, r=dtolnay 2024-04-17 18:01:37 +02:00
alloc.rs step cfgs 2024-03-20 08:49:13 -04:00
borrow.rs Add more diagnostic items for clippy 2023-10-05 18:21:47 -04:00
boxed.rs Rollup merge of #122201 - coolreader18:doc-clone_from, r=dtolnay 2024-04-17 18:01:37 +02:00
fmt.rs docs: use correct link, use secondary example 2024-02-12 20:17:47 -05:00
lib.miri.rs add 'x.py miri', and make it work for 'library/{core,alloc,std}' 2024-04-03 20:27:20 +02:00
lib.rs Stabilize (const_)slice_ptr_len and (const_)slice_ptr_is_empty_nonnull 2024-04-12 21:23:20 +02:00
macros.rs Update doc for alloc::format! and core::concat! 2023-09-06 15:11:21 +02:00
raw_vec.rs Avoid more NonNull-raw-NonNull roundtrips in Vec 2024-04-12 18:14:29 -04:00
rc.rs Auto merge of #120092 - zetanumbers:pin_in_static_allocator, r=Amanieu 2024-04-12 00:03:43 +00:00
slice.rs lib: fix some unnecessary_cast clippy lint 2024-03-25 23:19:40 +03:00
str.rs Export core::str::from_raw_parts{,_mut} into alloc::str and std::str 2024-01-25 18:11:54 -08:00
string.rs Rollup merge of #122201 - coolreader18:doc-clone_from, r=dtolnay 2024-04-17 18:01:37 +02:00
sync.rs Auto merge of #120092 - zetanumbers:pin_in_static_allocator, r=Amanieu 2024-04-12 00:03:43 +00:00
task.rs lib: fix some unnecessary_cast clippy lint 2024-03-25 23:19:40 +03:00
tests.rs remove redundant imports 2023-12-10 10:56:22 +08:00