diff options
author | Tetsuharu OHZEKI <saneyuki.snyk@gmail.com> | 2014-09-20 00:04:02 +0900 |
---|---|---|
committer | Tetsuharu OHZEKI <saneyuki.snyk@gmail.com> | 2014-09-20 15:19:00 +0900 |
commit | 54d3a0b28010cd590ad5ebd4c516ff091b76908f (patch) | |
tree | 394947d8a6ccf13ccfb1f2dc9ecd2f714367f102 /components/script/dom/bindings/trace.rs | |
parent | c51b8a07acbbfa8539b9234c7717a9af53a9e2b8 (diff) | |
download | servo-54d3a0b28010cd590ad5ebd4c516ff091b76908f.tar.gz servo-54d3a0b28010cd590ad5ebd4c516ff091b76908f.zip |
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.
Diffstat (limited to 'components/script/dom/bindings/trace.rs')
-rw-r--r-- | components/script/dom/bindings/trace.rs | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/components/script/dom/bindings/trace.rs b/components/script/dom/bindings/trace.rs index b160508a761..837dec61f5a 100644 --- a/components/script/dom/bindings/trace.rs +++ b/components/script/dom/bindings/trace.rs @@ -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`). /// |