diff --git a/src/libcore/cell.rs b/src/libcore/cell.rs index a85eee854509..7e2ece0f02c1 100644 --- a/src/libcore/cell.rs +++ b/src/libcore/cell.rs @@ -559,6 +559,16 @@ impl Deref for Cell<[T]> { } } +#[unstable(feature = "as_cell", issue="43038")] +impl DerefMut for Cell<[T]> { + #[inline] + fn deref_mut(&mut self) -> &mut [Cell] { + unsafe { + &mut *(self as *mut Cell<[T]> as *mut [Cell]) + } + } +} + /// A mutable memory location with dynamically checked borrow rules /// /// See the [module-level documentation](index.html) for more.