From 1a952b935b11dfbf6523da447444fe5b862384fd Mon Sep 17 00:00:00 2001 From: Manish Goregaokar Date: Thu, 26 Mar 2015 22:42:47 +0530 Subject: [PATCH] blanket impl jstraceable on *T --- components/script/dom/bindings/trace.rs | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) 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 JSTraceable for Box { } } +impl JSTraceable for *const T { + fn trace(&self, trc: *mut JSTracer) { + if !self.is_null() { + unsafe { + (**self).trace(trc) + } + } + } +} + +impl JSTraceable for *mut T { + fn trace(&self, trc: *mut JSTracer) { + if !self.is_null() { + unsafe { + (**self).trace(trc) + } + } + } +} + impl JSTraceable for Cell { fn trace(&self, trc: *mut JSTracer) { self.get().trace(trc)