Reintroduce Untraceable<T>.deref_mut() to make mem::replace() possible to Untracebale<T> field.

Some compile errors caused by the compiler's misreading comes back again :(
We re-use `deref()`explicitly to hide these errors.
This commit is contained in:
Tetsuharu OHZEKI 2014-09-20 00:04:02 +09:00
parent c51b8a07ac
commit 54d3a0b280
5 changed files with 14 additions and 8 deletions

View file

@ -132,6 +132,12 @@ impl<T> Deref<T> for Untraceable<T> {
}
}
impl<T> DerefMut<T> for Untraceable<T> {
fn deref_mut<'a>(&'a mut self) -> &'a mut T {
&mut self.inner
}
}
/// Encapsulates a type that can be traced but is boxed in a type we don't
/// control (such as `RefCell`).
///