rust/library/std/src/ffi
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
..
os_str Move OsStr::slice_encoded_bytes validation to platform modules 2024-01-21 19:51:49 +01:00
c_str.rs Add std::ffi::c_str modules 2024-02-22 02:09:26 -05:00
mod.rs Rollup merge of #112136 - clarfonthey:ffi-c_str, r=cuviper 2024-03-10 10:58:14 +01:00
os_str.rs Rollup merge of #122201 - coolreader18:doc-clone_from, r=dtolnay 2024-04-17 18:01:37 +02:00