diff options
| author | Aapo Alasuutari <aapo.alasuutari@gmail.com> | 2025-08-29 23:29:46 +0300 |
|---|---|---|
| committer | Aapo Alasuutari <aapo.alasuutari@gmail.com> | 2025-09-15 20:23:26 +0300 |
| commit | c8663eec6a667ae6e7571297cb15192425311c33 (patch) | |
| tree | f7da2335268880cd2383948f70991481c7c2ae40 /library/core | |
| parent | f3fd3efe4f698ad9dc2ccd6b46a3b07e1bc911da (diff) | |
| download | rust-c8663eec6a667ae6e7571297cb15192425311c33.tar.gz rust-c8663eec6a667ae6e7571297cb15192425311c33.zip | |
Introduce CoerceShared lang item and trait
Diffstat (limited to 'library/core')
| -rw-r--r-- | library/core/src/marker.rs | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/library/core/src/marker.rs b/library/core/src/marker.rs index d03d7a43469..8541a5b91cd 100644 --- a/library/core/src/marker.rs +++ b/library/core/src/marker.rs @@ -1372,3 +1372,12 @@ pub trait CoercePointeeValidated { pub trait Reborrow { // Empty. } + +/// Allows reborrowable value to be reborrowed as shared, creating a copy of +/// that disables the source for writes for the lifetime of the copy. +#[lang = "coerce_shared"] +#[unstable(feature = "reborrow", issue = "145612")] +pub trait CoerceShared: Reborrow { + /// The type of this value when reborrowed as shared. + type Target: Copy; +} |
