aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorManish Goregaokar <manishsmail@gmail.com>2015-03-26 22:42:47 +0530
committerManish Goregaokar <manishsmail@gmail.com>2015-03-26 22:42:47 +0530
commit1a952b935b11dfbf6523da447444fe5b862384fd (patch)
treea669ea0b34985bb4fbd20e09a26b75eabec74ea3
parentc9ccf7aeb45540ae6ceb325c633d0f8c0c37d653 (diff)
downloadservo-1a952b935b11dfbf6523da447444fe5b862384fd.tar.gz
servo-1a952b935b11dfbf6523da447444fe5b862384fd.zip
blanket impl jstraceable on *T
-rw-r--r--components/script/dom/bindings/trace.rs20
1 files changed, 20 insertions, 0 deletions
diff --git a/components/script/dom/bindings/trace.rs b/components/script/dom/bindings/trace.rs
index 4af66e2edba..8d3f5c1684e 100644
--- a/components/script/dom/bindings/trace.rs
+++ b/components/script/dom/bindings/trace.rs
@@ -137,6 +137,26 @@ impl<T: JSTraceable> JSTraceable for Box<T> {
}
}
+impl<T: JSTraceable> JSTraceable for *const T {
+ fn trace(&self, trc: *mut JSTracer) {
+ if !self.is_null() {
+ unsafe {
+ (**self).trace(trc)
+ }
+ }
+ }
+}
+
+impl<T: JSTraceable> JSTraceable for *mut T {
+ fn trace(&self, trc: *mut JSTracer) {
+ if !self.is_null() {
+ unsafe {
+ (**self).trace(trc)
+ }
+ }
+ }
+}
+
impl<T: JSTraceable+Copy> JSTraceable for Cell<T> {
fn trace(&self, trc: *mut JSTracer) {
self.get().trace(trc)