about summary refs log tree commit diff
path: root/compiler/rustc_pattern_analysis/src
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2024-06-22 16:35:29 +0000
committerbors <bors@rust-lang.org>2024-06-22 16:35:29 +0000
commitf944afe3807104803976484e7ee3aff49b6ac070 (patch)
treece3763181a9cdcce15ae041f88c36b292c8b70ab /compiler/rustc_pattern_analysis/src
parentac47dbad504b892bc0f3be8fa097537c6e0544a3 (diff)
parent88c3db57e4c3cda4e446999202171d9a459069a9 (diff)
downloadrust-f944afe3807104803976484e7ee3aff49b6ac070.tar.gz
rust-f944afe3807104803976484e7ee3aff49b6ac070.zip
Auto merge of #116113 - kpreid:arcmut, r=dtolnay
 Generalize `{Rc,Arc}::make_mut()` to unsized types.

* `{Rc,Arc}::make_mut()` now accept any type implementing the new unstable trait `core::clone::CloneToUninit`.
* `CloneToUninit` is implemented for `T: Clone` and for `[T] where T: Clone`.
* `CloneToUninit` is a generalization of the existing internal trait `alloc::alloc::WriteCloneIntoRaw`.
* New feature gate: `clone_to_uninit`

This allows performing `make_mut()` on `Rc<[T]>` and `Arc<[T]>`, which was not previously possible.

---

Previous PR description, now obsolete:

>  Add `{Rc, Arc}::make_mut_slice()`
>
> These functions behave identically to `make_mut()`, but operate on `Arc<[T]>` instead of `Arc<T>`.
>
> This allows performing the operation on slices, which was not previously possible because `make_mut()` requires `T: Clone` (and slices, being `!Sized`, do not and currently cannot implement `Clone`).
>
> Feature gate: `make_mut_slice`

try-job: test-various
Diffstat (limited to 'compiler/rustc_pattern_analysis/src')
0 files changed, 0 insertions, 0 deletions