diff options
| author | Matthias Krüger <476013+matthiaskrgr@users.noreply.github.com> | 2025-09-27 21:25:56 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-09-27 21:25:56 +0200 |
| commit | 01c17f83cf9c129e2d4d27cb432cd5039ea86779 (patch) | |
| tree | ce36885e86ac78754e2fdba1e7d9e47e1473d137 /library/std/src/process/tests.rs | |
| parent | c0ee51f07d271f7cf3227c60a2c59aa18c959192 (diff) | |
| parent | e88fa086fb597041a207a9bb5df0654628d57b1a (diff) | |
| download | rust-01c17f83cf9c129e2d4d27cb432cd5039ea86779.tar.gz rust-01c17f83cf9c129e2d4d27cb432cd5039ea86779.zip | |
Rollup merge of #146037 - aapoalas:reborrow-lang-experiment, r=tmandry
Introduce CoerceShared lang item and trait, and basic Reborrow tests Part of rust-lang/rust#145612: This introduces the `CoerceShared` trait which is the `Reborrow` equivalent of a `&mut T` -> `&T` coercion. The trait has a `Target` GAT which makes this (currently) unique in the `core/src/marker.rs`; I'm not sure if this can be considered problematic. Maybe this is not the way such things should be done at the marker trait level? Or maybe it is fine. Improtantly, this PR introduces a battery of basic `Reborrow` and `CoerceShared` tests. These test the very basics of the feature; custom marker types intended to have exclusive semantics (`Custom<'a>(PhantomData<&'a mut ()>)`), custom exclusive reference wrappers, and standard library exclusive reference wrappers (`Pin<&mut T>` and `Option<&mut T>`). None of these of course work since the implementation for `Reborrow` and `CoerceShared` is entirely missing, but this is the first step towards making these work. Future PRs will introduce more tests, such as "recursive" reborrowing (ie. reborrowing structs that contain multiple reborrowable fields) and checks around the lifetime semantics of reborrowing ie. that a reborrow produces a new type with the same lifetime as the original.
Diffstat (limited to 'library/std/src/process/tests.rs')
0 files changed, 0 insertions, 0 deletions
