mirror of
https://github.com/servo/servo.git
synced 2025-06-18 05:14:28 +00:00
Upgrade to rustc 1.19.0-nightly (ced823e26 2017-05-07)
This commit is contained in:
parent
bd2cd40c50
commit
02e1901bc1
10 changed files with 37 additions and 37 deletions
|
@ -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() }
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -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()));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -442,7 +442,7 @@ impl<'le> TElement for ServoLayoutElement<'le> {
|
|||
fn get_data(&self) -> Option<&AtomicRefCell<ElementData>> {
|
||||
unsafe {
|
||||
self.get_style_and_layout_data().map(|d| {
|
||||
let ppld: &AtomicRefCell<PartialPersistentLayoutData> = &**d.ptr;
|
||||
let ppld: &AtomicRefCell<PartialPersistentLayoutData> = &*d.ptr.get();
|
||||
let psd: &AtomicRefCell<ElementData> = transmute(ppld);
|
||||
psd
|
||||
})
|
||||
|
@ -505,7 +505,7 @@ impl<'le> ServoLayoutElement<'le> {
|
|||
|
||||
fn get_partial_layout_data(&self) -> Option<&AtomicRefCell<PartialPersistentLayoutData>> {
|
||||
unsafe {
|
||||
self.get_style_and_layout_data().map(|d| &**d.ptr)
|
||||
self.get_style_and_layout_data().map(|d| &*d.ptr.get())
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue