Skip to content

Commit b7ccb24

Browse files
committed
Add PinMut::set
1 parent 640f6f0 commit b7ccb24

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

src/libcore/mem.rs

+8
Original file line numberDiff line numberDiff line change
@@ -1164,6 +1164,14 @@ impl<'a, T: ?Sized> PinMut<'a, T> {
11641164
{
11651165
PinMut { inner: f(this.inner) }
11661166
}
1167+
1168+
/// Assign a new value to the memory behind the pinned reference.
1169+
#[unstable(feature = "pin", issue = "49150")]
1170+
pub fn set(this: PinMut<'a, T>, value: T)
1171+
where T: Sized,
1172+
{
1173+
*this.inner = value;
1174+
}
11671175
}
11681176

11691177
#[unstable(feature = "pin", issue = "49150")]

0 commit comments

Comments
 (0)