mirror of
https://github.com/servo/servo.git
synced 2025-08-03 04:30:10 +01:00
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:
parent
c51b8a07ac
commit
54d3a0b280
5 changed files with 14 additions and 8 deletions
|
@ -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`).
|
||||
///
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue