aboutsummaryrefslogtreecommitdiffstats
path: root/components/script/dom/bindings/trace.rs
diff options
context:
space:
mode:
authorTetsuharu OHZEKI <saneyuki.snyk@gmail.com>2014-09-20 00:04:02 +0900
committerTetsuharu OHZEKI <saneyuki.snyk@gmail.com>2014-09-20 15:19:00 +0900
commit54d3a0b28010cd590ad5ebd4c516ff091b76908f (patch)
tree394947d8a6ccf13ccfb1f2dc9ecd2f714367f102 /components/script/dom/bindings/trace.rs
parentc51b8a07acbbfa8539b9234c7717a9af53a9e2b8 (diff)
downloadservo-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.rs6
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`).
///