mirror of
https://github.com/servo/servo.git
synced 2025-07-01 12:33:40 +01: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
|
@ -15,6 +15,6 @@ euclid = "0.11"
|
|||
heapsize = "0.3.0"
|
||||
heapsize_derive = "0.1"
|
||||
ipc-channel = "0.7"
|
||||
serde = {version = "0.9", features = ["unstable"]}
|
||||
serde = "0.9"
|
||||
serde_derive = "0.9"
|
||||
webrender_traits = {git = "https://github.com/servo/webrender", features = ["ipc"]}
|
||||
|
|
|
@ -164,7 +164,7 @@ impl Shaper {
|
|||
Shaper::float_to_fixed(pt_size) as c_int);
|
||||
|
||||
// configure static function callbacks.
|
||||
hb_font_set_funcs(hb_font, **HB_FONT_FUNCS, font as *mut Font as *mut c_void, None);
|
||||
hb_font_set_funcs(hb_font, HB_FONT_FUNCS.as_ptr(), font as *mut Font as *mut c_void, None);
|
||||
|
||||
Shaper {
|
||||
hb_face: hb_face,
|
||||
|
|
|
@ -43,7 +43,7 @@ use style::selector_parser::RestyleDamage;
|
|||
pub type NonOpaqueStyleAndLayoutData = AtomicRefCell<PersistentLayoutData>;
|
||||
|
||||
pub unsafe fn drop_style_and_layout_data(data: OpaqueStyleAndLayoutData) {
|
||||
let ptr: *mut AtomicRefCell<PartialPersistentLayoutData> = *data.ptr;
|
||||
let ptr: *mut AtomicRefCell<PartialPersistentLayoutData> = data.ptr.get();
|
||||
let non_opaque: *mut NonOpaqueStyleAndLayoutData = ptr as *mut _;
|
||||
let _ = Box::from_raw(non_opaque);
|
||||
}
|
||||
|
@ -77,7 +77,7 @@ pub trait GetRawData {
|
|||
impl<T: GetLayoutData> GetRawData for T {
|
||||
fn get_raw_data(&self) -> Option<&NonOpaqueStyleAndLayoutData> {
|
||||
self.get_style_and_layout_data().map(|opaque| {
|
||||
let container = *opaque.ptr as *mut NonOpaqueStyleAndLayoutData;
|
||||
let container = opaque.ptr.get() as *mut NonOpaqueStyleAndLayoutData;
|
||||
unsafe { &*container }
|
||||
})
|
||||
}
|
||||
|
|
|
@ -53,7 +53,7 @@ impl AtomicOptThreadId {
|
|||
AtomicOptThreadId(AtomicUsize::new(0))
|
||||
}
|
||||
pub fn store(&self, value: Option<ThreadId>, ordering: Ordering) {
|
||||
let number = value.map(|id| *id.0).unwrap_or(0);
|
||||
let number = value.map(|id| id.0.get()).unwrap_or(0);
|
||||
self.0.store(number, ordering);
|
||||
}
|
||||
#[allow(unsafe_code)]
|
||||
|
@ -63,7 +63,7 @@ impl AtomicOptThreadId {
|
|||
}
|
||||
#[allow(unsafe_code)]
|
||||
pub fn swap(&self, value: Option<ThreadId>, ordering: Ordering) -> Option<ThreadId> {
|
||||
let number = value.map(|id| *id.0).unwrap_or(0);
|
||||
let number = value.map(|id| id.0.get()).unwrap_or(0);
|
||||
let number = self.0.swap(number, ordering);
|
||||
if number == 0 { None } else { Some(ThreadId(unsafe { NonZero::new(number) })) }
|
||||
}
|
||||
|
|
|
@ -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())
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -15,7 +15,7 @@ doctest = false
|
|||
[features]
|
||||
gecko = ["nsstring_vendor", "rayon/unstable", "num_cpus", "style_traits/gecko"]
|
||||
use_bindgen = ["bindgen", "regex"]
|
||||
servo = ["serde/unstable", "serde", "serde_derive", "heapsize", "heapsize_derive",
|
||||
servo = ["serde", "serde_derive", "heapsize", "heapsize_derive",
|
||||
"style_traits/servo", "servo_atoms", "servo_config", "html5ever",
|
||||
"cssparser/heapsize", "cssparser/serde", "encoding", "smallvec/heapsizeof",
|
||||
"rayon/unstable", "servo_url"]
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue