diff options
Diffstat (limited to 'components/script/dom/bindings/refcounted.rs')
-rw-r--r-- | components/script/dom/bindings/refcounted.rs | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/components/script/dom/bindings/refcounted.rs b/components/script/dom/bindings/refcounted.rs index b7f039cb527..c009687e40a 100644 --- a/components/script/dom/bindings/refcounted.rs +++ b/components/script/dom/bindings/refcounted.rs @@ -32,6 +32,7 @@ use libc; use std::cell::RefCell; use std::collections::hash_map::HashMap; use std::collections::hash_map::Entry::{Vacant, Occupied}; +use std::marker::PhantomData; use std::rc::Rc; use std::sync::{Arc, Mutex}; @@ -53,6 +54,7 @@ pub struct Trusted<T> { refcount: Arc<Mutex<usize>>, script_chan: Box<ScriptChan + Send>, owner_thread: *const libc::c_void, + phantom: PhantomData<T>, } unsafe impl<T: Reflectable> Send for Trusted<T> {} @@ -71,6 +73,7 @@ impl<T: Reflectable> Trusted<T> { refcount: refcount, script_chan: script_chan.clone(), owner_thread: (&*live_references) as *const _ as *const libc::c_void, + phantom: PhantomData, } }) } @@ -102,6 +105,7 @@ impl<T: Reflectable> Clone for Trusted<T> { refcount: self.refcount.clone(), script_chan: self.script_chan.clone(), owner_thread: self.owner_thread, + phantom: PhantomData, } } } |