Skip to content

Commit b551f75

Browse files
committed
Introduce Reborrow lang item and trait
1 parent 9a75e6e commit b551f75

File tree

2 files changed

+9
-0
lines changed

2 files changed

+9
-0
lines changed

core/src/lib.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -172,6 +172,7 @@
172172
#![feature(no_core)]
173173
#![feature(optimize_attribute)]
174174
#![feature(prelude_import)]
175+
#![feature(reborrow)]
175176
#![feature(repr_simd)]
176177
#![feature(rustc_allow_const_fn_unstable)]
177178
#![feature(rustc_attrs)]

core/src/marker.rs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1365,3 +1365,11 @@ pub macro CoercePointee($item:item) {
13651365
pub trait CoercePointeeValidated {
13661366
/* compiler built-in */
13671367
}
1368+
1369+
/// Allows value to be reborrowed as exclusive, creating a copy of the value
1370+
/// that disables the source for reads and writes for the lifetime of the copy.
1371+
#[lang = "reborrow"]
1372+
#[unstable(feature = "reborrow", issue = "145612")]
1373+
pub trait Reborrow {
1374+
// Empty.
1375+
}

0 commit comments

Comments
 (0)