diff options
author | Simon Sapin <simon.sapin@exyr.org> | 2017-05-07 16:42:46 +0200 |
---|---|---|
committer | Simon Sapin <simon.sapin@exyr.org> | 2017-05-08 12:46:03 +0200 |
commit | 02e1901bc15812dfc74b4979e0951bf7593e7fc9 (patch) | |
tree | 7758970f50502206f1d264201069bbaea2eb28fd /components/script/dom | |
parent | bd2cd40c5029f3124f2ed492b4fab7dc8f9101c8 (diff) | |
download | servo-02e1901bc15812dfc74b4979e0951bf7593e7fc9.tar.gz servo-02e1901bc15812dfc74b4979e0951bf7593e7fc9.zip |
Upgrade to rustc 1.19.0-nightly (ced823e26 2017-05-07)
Diffstat (limited to 'components/script/dom')
-rw-r--r-- | components/script/dom/bindings/js.rs | 20 | ||||
-rw-r--r-- | components/script/dom/bindings/weakref.rs | 16 |
2 files changed, 18 insertions, 18 deletions
diff --git a/components/script/dom/bindings/js.rs b/components/script/dom/bindings/js.rs index b4c1322ed0c..292324f04d0 100644 --- a/components/script/dom/bindings/js.rs +++ b/components/script/dom/bindings/js.rs @@ -100,7 +100,7 @@ impl<T: DomObject> Deref for JS<T> { debug_assert!(thread_state::get().is_script()); // We can only have &JS<T> from a rooted thing, so it's safe to deref // it to &T. - unsafe { &**self.ptr } + unsafe { &*self.ptr.get() } } } @@ -115,7 +115,7 @@ unsafe impl<T: DomObject> JSTraceable for JS<T> { trace_reflector(trc, trace_info, - (**self.ptr).reflector()); + (*self.ptr.get()).reflector()); } } @@ -133,7 +133,7 @@ impl<T: Castable> LayoutJS<T> { T: DerivedFrom<U> { debug_assert!(thread_state::get().is_layout()); - let ptr: *const T = *self.ptr; + let ptr: *const T = self.ptr.get(); LayoutJS { ptr: unsafe { NonZero::new(ptr as *const U) }, } @@ -146,7 +146,7 @@ impl<T: Castable> LayoutJS<T> { debug_assert!(thread_state::get().is_layout()); unsafe { if (*self.unsafe_get()).is::<U>() { - let ptr: *const T = *self.ptr; + let ptr: *const T = self.ptr.get(); Some(LayoutJS { ptr: NonZero::new(ptr as *const U), }) @@ -161,7 +161,7 @@ impl<T: DomObject> LayoutJS<T> { /// Get the reflector. pub unsafe fn get_jsobject(&self) -> *mut JSObject { debug_assert!(thread_state::get().is_layout()); - (**self.ptr).reflector().get_jsobject().get() + (*self.ptr.get()).reflector().get_jsobject().get() } } @@ -397,7 +397,7 @@ impl<T: DomObject> LayoutJS<T> { /// this is unsafe is what necessitates the layout wrappers.) pub unsafe fn unsafe_get(&self) -> *const T { debug_assert!(thread_state::get().is_layout()); - *self.ptr + self.ptr.get() } /// Returns a reference to the interior of this JS object. This method is @@ -405,7 +405,7 @@ impl<T: DomObject> LayoutJS<T> { /// mutate DOM nodes. pub fn get_for_script(&self) -> &T { debug_assert!(thread_state::get().is_script()); - unsafe { &**self.ptr } + unsafe { &*self.ptr.get() } } } @@ -544,7 +544,7 @@ impl<T: DomObject> Root<T> { debug_assert!(thread_state::get().is_script()); STACK_ROOTS.with(|ref collection| { let RootCollectionPtr(collection) = collection.get().unwrap(); - unsafe { (*collection).root(&*(**unrooted).reflector()) } + unsafe { (*collection).root(&*(*unrooted.get()).reflector()) } Root { ptr: unrooted, root_list: collection, @@ -554,7 +554,7 @@ impl<T: DomObject> Root<T> { /// Generate a new root from a reference pub fn from_ref(unrooted: &T) -> Root<T> { - Root::new(unsafe { NonZero::new(&*unrooted) }) + Root::new(unsafe { NonZero::new(unrooted) }) } } @@ -569,7 +569,7 @@ impl<T: DomObject> Deref for Root<T> { type Target = T; fn deref(&self) -> &T { debug_assert!(thread_state::get().is_script()); - unsafe { &**self.ptr.deref() } + unsafe { &*self.ptr.get() } } } diff --git a/components/script/dom/bindings/weakref.rs b/components/script/dom/bindings/weakref.rs index e6201bf3141..c6ba99ba680 100644 --- a/components/script/dom/bindings/weakref.rs +++ b/components/script/dom/bindings/weakref.rs @@ -86,19 +86,19 @@ impl<T: WeakReferenceable> WeakRef<T> { /// Root a weak reference. Returns `None` if the object was already collected. pub fn root(&self) -> Option<Root<T>> { - unsafe { &**self.ptr }.value.get().map(Root::new) + unsafe { &*self.ptr.get() }.value.get().map(Root::new) } /// Return whether the weakly-referenced object is still alive. pub fn is_alive(&self) -> bool { - unsafe { &**self.ptr }.value.get().is_some() + unsafe { &*self.ptr.get() }.value.get().is_some() } } impl<T: WeakReferenceable> Clone for WeakRef<T> { fn clone(&self) -> WeakRef<T> { unsafe { - let box_ = &**self.ptr; + let box_ = &*self.ptr.get(); let new_count = box_.count.get() + 1; box_.count.set(new_count); WeakRef { @@ -117,7 +117,7 @@ impl<T: WeakReferenceable> HeapSizeOf for WeakRef<T> { impl<T: WeakReferenceable> PartialEq for WeakRef<T> { fn eq(&self, other: &Self) -> bool { unsafe { - (**self.ptr).value.get() == (**other.ptr).value.get() + (*self.ptr.get()).value.get() == (*other.ptr.get()).value.get() } } } @@ -125,8 +125,8 @@ impl<T: WeakReferenceable> PartialEq for WeakRef<T> { impl<T: WeakReferenceable> PartialEq<T> for WeakRef<T> { fn eq(&self, other: &T) -> bool { unsafe { - match (**self.ptr).value.get() { - Some(ptr) => *ptr == other, + match (*self.ptr.get()).value.get() { + Some(ptr) => ptr.get() == other, None => false, } } @@ -143,7 +143,7 @@ impl<T: WeakReferenceable> Drop for WeakRef<T> { fn drop(&mut self) { unsafe { let (count, value) = { - let weak_box = &**self.ptr; + let weak_box = &*self.ptr.get(); assert!(weak_box.count.get() > 0); let count = weak_box.count.get() - 1; weak_box.count.set(count); @@ -151,7 +151,7 @@ impl<T: WeakReferenceable> Drop for WeakRef<T> { }; if count == 0 { assert!(value.is_none()); - mem::drop(Box::from_raw(*self.ptr)); + mem::drop(Box::from_raw(self.ptr.get())); } } } |