diff options
author | Anthony Ramine <n.oxyde@gmail.com> | 2017-09-26 15:38:10 +0200 |
---|---|---|
committer | Anthony Ramine <n.oxyde@gmail.com> | 2017-09-26 16:10:30 +0200 |
commit | 1ff6c4f9aa52fa9dca5a370e30e92ad45549217b (patch) | |
tree | 0b704c57ce22008539ea28feae1accd74f5ee0fb /components/script/dom/bindings/refcounted.rs | |
parent | 3dbb97922d75f7ba4c542cb67e9c30c28c7a0699 (diff) | |
download | servo-1ff6c4f9aa52fa9dca5a370e30e92ad45549217b.tar.gz servo-1ff6c4f9aa52fa9dca5a370e30e92ad45549217b.zip |
Make DomRoot::new unsafe
Diffstat (limited to 'components/script/dom/bindings/refcounted.rs')
-rw-r--r-- | components/script/dom/bindings/refcounted.rs | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/components/script/dom/bindings/refcounted.rs b/components/script/dom/bindings/refcounted.rs index 02f6784fb2f..795847a8f5a 100644 --- a/components/script/dom/bindings/refcounted.rs +++ b/components/script/dom/bindings/refcounted.rs @@ -22,7 +22,6 @@ //! its hash table during the next GC. During GC, the entries of the hash table are counted //! as JS roots. -use core::nonzero::NonZero; use dom::bindings::conversions::ToJSValConvertible; use dom::bindings::error::Error; use dom::bindings::reflector::{DomObject, Reflector}; @@ -185,7 +184,7 @@ impl<T: DomObject> Trusted<T> { self.owner_thread == (&*live_references) as *const _ as *const libc::c_void })); unsafe { - DomRoot::new(NonZero::new_unchecked(self.refcount.0 as *const T)) + DomRoot::from_ref(&*(self.refcount.0 as *const T)) } } } |