Skip to content

Commit c507654

Browse files
committed
Introduce CoerceShared lang item and trait
1 parent 675defb commit c507654

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

core/src/marker.rs

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1372,3 +1372,12 @@ pub trait CoercePointeeValidated {
13721372
pub trait Reborrow {
13731373
// Empty.
13741374
}
1375+
1376+
/// Allows reborrowable value to be reborrowed as shared, creating a copy of
1377+
/// that disables the source for writes for the lifetime of the copy.
1378+
#[lang = "coerce_shared"]
1379+
#[unstable(feature = "reborrow", issue = "145612")]
1380+
pub trait CoerceShared: Reborrow {
1381+
/// The type of this value when reborrowed as shared.
1382+
type Target: Copy;
1383+
}

0 commit comments

Comments
 (0)