From c8663eec6a667ae6e7571297cb15192425311c33 Mon Sep 17 00:00:00 2001 From: Aapo Alasuutari Date: Fri, 29 Aug 2025 23:29:46 +0300 Subject: Introduce CoerceShared lang item and trait --- library/core/src/marker.rs | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'library/core/src') 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; +} -- cgit 1.4.1-3-g733a5