Files
rust/library/std/src
bors 1be6b13be7 Auto merge of #149079 - zachs18:clone_from_ref, r=Mark-Simulacrum
Add `Box::clone_from_ref` and similar under `feature(clone_from_ref)`

Tracking issue: https://github.com/rust-lang/rust/issues/149075

Accepted ACP: https://github.com/rust-lang/libs-team/issues/483

This PR implements `clone_from_ref` (and `try_*` and `_*in` variants), to get a `Box<T>`, `Arc<T>`, or `Rc<T>` by cloning from a `&T` where `T: CloneToUninit`.

The "Implement..." commits replace some ad-hoc conversions with `clone_from_ref` variants, which can be split out to a separate PR if desired.

This PR will conflict with https://github.com/rust-lang/rust/pull/148769 due to usage of `Layout::dangling` (which that PR is renaming to `dangling_ptr`), so they should not be rolled up together, and the one which merges later will need to be amended.
2025-11-26 18:21:00 +00:00
..
2023-12-10 10:56:22 +08:00
2024-11-02 11:27:14 +01:00
2025-11-17 17:44:21 +01:00
2025-09-16 13:11:34 -06:00
2025-01-11 06:35:21 +02:00
2025-11-19 13:34:00 -06:00
2024-04-08 11:57:17 +00:00
2025-09-21 13:12:20 -04:00
2025-02-07 16:54:07 +01:00