mirror of
https://github.com/servo/servo.git
synced 2025-08-03 12:40:06 +01:00
Upgrade to rustc 1.21.0-nightly (599be0d18 2017-07-26)
This commit is contained in:
parent
27031b996b
commit
a205c82264
20 changed files with 34 additions and 34 deletions
6
Cargo.lock
generated
6
Cargo.lock
generated
|
@ -1671,7 +1671,7 @@ dependencies = [
|
|||
"rustc-serialize 0.3.24 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"string_cache 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"string_cache_codegen 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"tendril 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"tendril 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
|
@ -3199,7 +3199,7 @@ dependencies = [
|
|||
|
||||
[[package]]
|
||||
name = "tendril"
|
||||
version = "0.3.0"
|
||||
version = "0.3.1"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
dependencies = [
|
||||
"futf 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
|
@ -3873,7 +3873,7 @@ dependencies = [
|
|||
"checksum syntex_pos 0.58.1 (registry+https://github.com/rust-lang/crates.io-index)" = "13ad4762fe52abc9f4008e85c4fb1b1fe3aa91ccb99ff4826a439c7c598e1047"
|
||||
"checksum syntex_syntax 0.58.1 (registry+https://github.com/rust-lang/crates.io-index)" = "6e0e4dbae163dd98989464c23dd503161b338790640e11537686f2ef0f25c791"
|
||||
"checksum tempdir 0.3.5 (registry+https://github.com/rust-lang/crates.io-index)" = "87974a6f5c1dfb344d733055601650059a3363de2a6104819293baff662132d6"
|
||||
"checksum tendril 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)" = "01576be96a211e017bf90b1603b1272baf9fe93a1bf9b4845257c4ba09c9b25f"
|
||||
"checksum tendril 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)" = "8c1b72f8e2f5b73b65c315b1a70c730f24b9d7a25f39e98de8acbe2bb795caea"
|
||||
"checksum term 0.4.5 (registry+https://github.com/rust-lang/crates.io-index)" = "d168af3930b369cfe245132550579d47dfd873d69470755a19c2c6568dbbd989"
|
||||
"checksum term_size 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)" = "07b6c1ac5b3fffd75073276bca1ceed01f67a28537097a2a9539e116e50fb21a"
|
||||
"checksum thread-id 3.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "8df7875b676fddfadffd96deea3b1124e5ede707d4884248931077518cf1f773"
|
||||
|
|
|
@ -421,7 +421,7 @@ lazy_static! {
|
|||
hb_font_funcs_set_glyph_h_kerning_func(
|
||||
hb_funcs, Some(glyph_h_kerning_func), ptr::null_mut(), None);
|
||||
|
||||
ptr::Unique::new(hb_funcs)
|
||||
ptr::Unique::new_unchecked(hb_funcs)
|
||||
};
|
||||
}
|
||||
|
||||
|
|
|
@ -256,7 +256,7 @@ impl<'ln> LayoutNode for ServoLayoutNode<'ln> {
|
|||
let ptr: *mut StyleAndLayoutData =
|
||||
Box::into_raw(Box::new(StyleAndLayoutData::new()));
|
||||
let opaque = OpaqueStyleAndLayoutData {
|
||||
ptr: NonZero::new(ptr as *mut StyleData),
|
||||
ptr: NonZero::new_unchecked(ptr as *mut StyleData),
|
||||
};
|
||||
self.init_style_and_layout_data(opaque);
|
||||
};
|
||||
|
|
|
@ -35,7 +35,7 @@ impl ThreadId {
|
|||
#[allow(unsafe_code)]
|
||||
fn new() -> ThreadId {
|
||||
let number = THREAD_COUNT.fetch_add(1, Ordering::SeqCst);
|
||||
ThreadId(unsafe { NonZero::new(number) })
|
||||
ThreadId(NonZero::new(number).unwrap())
|
||||
}
|
||||
pub fn current() -> ThreadId {
|
||||
THREAD_ID.with(|tls| tls.clone())
|
||||
|
@ -59,13 +59,13 @@ impl AtomicOptThreadId {
|
|||
#[allow(unsafe_code)]
|
||||
pub fn load(&self, ordering: Ordering) -> Option<ThreadId> {
|
||||
let number = self.0.load(ordering);
|
||||
if number == 0 { None } else { Some(ThreadId(unsafe { NonZero::new(number) })) }
|
||||
NonZero::new(number).map(ThreadId)
|
||||
}
|
||||
#[allow(unsafe_code)]
|
||||
pub fn swap(&self, value: Option<ThreadId>, ordering: Ordering) -> Option<ThreadId> {
|
||||
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) })) }
|
||||
NonZero::new(number).map(ThreadId)
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -106,7 +106,7 @@ impl<T: DomObject + JSTraceable + Iterable> IterableIterator<T> {
|
|||
self.index.set(index + 1);
|
||||
result.map(|_| {
|
||||
assert!(!rval.is_null());
|
||||
unsafe { NonZero::new(rval.get()) }
|
||||
unsafe { NonZero::new_unchecked(rval.get()) }
|
||||
})
|
||||
}
|
||||
}
|
||||
|
|
|
@ -81,7 +81,7 @@ impl<T: DomObject> JS<T> {
|
|||
pub fn from_ref(obj: &T) -> JS<T> {
|
||||
debug_assert!(thread_state::get().is_script());
|
||||
JS {
|
||||
ptr: unsafe { NonZero::new(&*obj) },
|
||||
ptr: unsafe { NonZero::new_unchecked(&*obj) },
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -135,7 +135,7 @@ impl<T: Castable> LayoutJS<T> {
|
|||
debug_assert!(thread_state::get().is_layout());
|
||||
let ptr: *const T = self.ptr.get();
|
||||
LayoutJS {
|
||||
ptr: unsafe { NonZero::new(ptr as *const U) },
|
||||
ptr: unsafe { NonZero::new_unchecked(ptr as *const U) },
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -148,7 +148,7 @@ impl<T: Castable> LayoutJS<T> {
|
|||
if (*self.unsafe_get()).is::<U>() {
|
||||
let ptr: *const T = self.ptr.get();
|
||||
Some(LayoutJS {
|
||||
ptr: NonZero::new(ptr as *const U),
|
||||
ptr: NonZero::new_unchecked(ptr as *const U),
|
||||
})
|
||||
} else {
|
||||
None
|
||||
|
@ -223,7 +223,7 @@ impl LayoutJS<Node> {
|
|||
debug_assert!(thread_state::get().is_layout());
|
||||
let TrustedNodeAddress(addr) = inner;
|
||||
LayoutJS {
|
||||
ptr: NonZero::new(addr as *const Node),
|
||||
ptr: NonZero::new_unchecked(addr as *const Node),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -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_unchecked(unrooted) })
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -200,7 +200,7 @@ impl<T: DomObject> Trusted<T> {
|
|||
self.owner_thread == (&*live_references) as *const _ as *const libc::c_void
|
||||
}));
|
||||
unsafe {
|
||||
Root::new(NonZero::new(self.refcount.0 as *const T))
|
||||
Root::new(NonZero::new_unchecked(self.refcount.0 as *const T))
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -58,7 +58,7 @@ pub trait WeakReferenceable: DomObject + Sized {
|
|||
trace!("Creating new WeakBox holder for {:p}.", self);
|
||||
ptr = Box::into_raw(box WeakBox {
|
||||
count: Cell::new(1),
|
||||
value: Cell::new(Some(NonZero::new(self))),
|
||||
value: Cell::new(Some(NonZero::new_unchecked(self))),
|
||||
});
|
||||
JS_SetReservedSlot(object, DOM_WEAK_SLOT, PrivateValue(ptr as *const c_void));
|
||||
}
|
||||
|
@ -70,7 +70,7 @@ pub trait WeakReferenceable: DomObject + Sized {
|
|||
new_count);
|
||||
box_.count.set(new_count);
|
||||
WeakRef {
|
||||
ptr: NonZero::new(ptr),
|
||||
ptr: NonZero::new_unchecked(ptr),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -65,7 +65,7 @@ impl CryptoMethods for Crypto {
|
|||
|
||||
self.rng.borrow_mut().fill_bytes(&mut data);
|
||||
|
||||
Ok(NonZero::new(input))
|
||||
Ok(NonZero::new_unchecked(input))
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -3498,7 +3498,7 @@ impl DocumentMethods for Document {
|
|||
if elements.peek().is_none() {
|
||||
// TODO: Step 2.
|
||||
// Step 3.
|
||||
return Some(NonZero::new(first.reflector().get_jsobject().get()));
|
||||
return Some(NonZero::new_unchecked(first.reflector().get_jsobject().get()));
|
||||
}
|
||||
} else {
|
||||
return None;
|
||||
|
@ -3509,7 +3509,7 @@ impl DocumentMethods for Document {
|
|||
name: name,
|
||||
};
|
||||
let collection = HTMLCollection::create(self.window(), root, box filter);
|
||||
Some(NonZero::new(collection.reflector().get_jsobject().get()))
|
||||
Some(NonZero::new_unchecked(collection.reflector().get_jsobject().get()))
|
||||
}
|
||||
|
||||
// https://html.spec.whatwg.org/multipage/#dom-tree-accessors:supported-property-names
|
||||
|
|
|
@ -128,7 +128,7 @@ impl GamepadMethods for Gamepad {
|
|||
#[allow(unsafe_code)]
|
||||
// https://w3c.github.io/gamepad/#dom-gamepad-axes
|
||||
unsafe fn Axes(&self, _cx: *mut JSContext) -> NonZero<*mut JSObject> {
|
||||
NonZero::new(self.axes.get())
|
||||
NonZero::new_unchecked(self.axes.get())
|
||||
}
|
||||
|
||||
// https://w3c.github.io/gamepad/#dom-gamepad-buttons
|
||||
|
|
|
@ -161,6 +161,6 @@ impl ImageDataMethods for ImageData {
|
|||
// https://html.spec.whatwg.org/multipage/#dom-imagedata-data
|
||||
unsafe fn Data(&self, _: *mut JSContext) -> NonZero<*mut JSObject> {
|
||||
assert!(!self.data.get().is_null());
|
||||
NonZero::new(self.data.get())
|
||||
NonZero::new_unchecked(self.data.get())
|
||||
}
|
||||
}
|
||||
|
|
|
@ -154,7 +154,7 @@ impl TestBindingMethods for TestBinding {
|
|||
unsafe fn ArrayAttribute(&self, cx: *mut JSContext) -> NonZero<*mut JSObject> {
|
||||
rooted!(in(cx) let array = JS_NewUint8ClampedArray(cx, 16));
|
||||
assert!(!array.is_null());
|
||||
NonZero::new(array.get())
|
||||
NonZero::new_unchecked(array.get())
|
||||
}
|
||||
#[allow(unsafe_code)]
|
||||
unsafe fn AnyAttribute(&self, _: *mut JSContext) -> JSVal { NullValue() }
|
||||
|
@ -164,7 +164,7 @@ impl TestBindingMethods for TestBinding {
|
|||
unsafe fn ObjectAttribute(&self, cx: *mut JSContext) -> NonZero<*mut JSObject> {
|
||||
rooted!(in(cx) let obj = JS_NewPlainObject(cx));
|
||||
assert!(!obj.is_null());
|
||||
NonZero::new(obj.get())
|
||||
NonZero::new_unchecked(obj.get())
|
||||
}
|
||||
#[allow(unsafe_code)]
|
||||
unsafe fn SetObjectAttribute(&self, _: *mut JSContext, _: *mut JSObject) {}
|
||||
|
|
|
@ -53,6 +53,6 @@ impl TextEncoderMethods for TextEncoder {
|
|||
rooted!(in(cx) let mut js_object = ptr::null_mut());
|
||||
assert!(Uint8Array::create(cx, CreateWith::Slice(&encoded), js_object.handle_mut()).is_ok());
|
||||
|
||||
NonZero::new(js_object.get())
|
||||
NonZero::new_unchecked(js_object.get())
|
||||
}
|
||||
}
|
||||
|
|
|
@ -61,7 +61,7 @@ impl VREyeParametersMethods for VREyeParameters {
|
|||
#[allow(unsafe_code)]
|
||||
// https://w3c.github.io/webvr/#dom-vreyeparameters-offset
|
||||
unsafe fn Offset(&self, _cx: *mut JSContext) -> NonZero<*mut JSObject> {
|
||||
NonZero::new(self.offset.get())
|
||||
NonZero::new_unchecked(self.offset.get())
|
||||
}
|
||||
|
||||
// https://w3c.github.io/webvr/#dom-vreyeparameters-fieldofview
|
||||
|
|
|
@ -119,25 +119,25 @@ impl VRFrameDataMethods for VRFrameData {
|
|||
#[allow(unsafe_code)]
|
||||
// https://w3c.github.io/webvr/#dom-vrframedata-leftprojectionmatrix
|
||||
unsafe fn LeftProjectionMatrix(&self, _cx: *mut JSContext) -> NonZero<*mut JSObject> {
|
||||
NonZero::new(self.left_proj.get())
|
||||
NonZero::new_unchecked(self.left_proj.get())
|
||||
}
|
||||
|
||||
#[allow(unsafe_code)]
|
||||
// https://w3c.github.io/webvr/#dom-vrframedata-leftviewmatrix
|
||||
unsafe fn LeftViewMatrix(&self, _cx: *mut JSContext) -> NonZero<*mut JSObject> {
|
||||
NonZero::new(self.left_view.get())
|
||||
NonZero::new_unchecked(self.left_view.get())
|
||||
}
|
||||
|
||||
#[allow(unsafe_code)]
|
||||
// https://w3c.github.io/webvr/#dom-vrframedata-rightprojectionmatrix
|
||||
unsafe fn RightProjectionMatrix(&self, _cx: *mut JSContext) -> NonZero<*mut JSObject> {
|
||||
NonZero::new(self.right_proj.get())
|
||||
NonZero::new_unchecked(self.right_proj.get())
|
||||
}
|
||||
|
||||
#[allow(unsafe_code)]
|
||||
// https://w3c.github.io/webvr/#dom-vrframedata-rightviewmatrix
|
||||
unsafe fn RightViewMatrix(&self, _cx: *mut JSContext) -> NonZero<*mut JSObject> {
|
||||
NonZero::new(self.right_view.get())
|
||||
NonZero::new_unchecked(self.right_view.get())
|
||||
}
|
||||
|
||||
// https://w3c.github.io/webvr/#dom-vrframedata-pose
|
||||
|
|
|
@ -58,7 +58,7 @@ fn heap_to_option(heap: &Heap<*mut JSObject>) -> Option<NonZero<*mut JSObject>>
|
|||
None
|
||||
} else {
|
||||
unsafe {
|
||||
Some(NonZero::new(js_object))
|
||||
Some(NonZero::new_unchecked(js_object))
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -70,7 +70,7 @@ impl VRStageParametersMethods for VRStageParameters {
|
|||
#[allow(unsafe_code)]
|
||||
// https://w3c.github.io/webvr/#dom-vrstageparameters-sittingtostandingtransform
|
||||
unsafe fn SittingToStandingTransform(&self, _cx: *mut JSContext) -> NonZero<*mut JSObject> {
|
||||
NonZero::new(self.transform.get())
|
||||
NonZero::new_unchecked(self.transform.get())
|
||||
}
|
||||
|
||||
// https://w3c.github.io/webvr/#dom-vrstageparameters-sizex
|
||||
|
|
|
@ -57,7 +57,7 @@ impl<T> WebGLExtensionWrapper for TypedWebGLExtensionWrapper<T>
|
|||
self.enable(ext);
|
||||
}
|
||||
unsafe {
|
||||
NonZero::new(extension.reflector().get_jsobject().get())
|
||||
NonZero::new_unchecked(extension.reflector().get_jsobject().get())
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -1 +1 @@
|
|||
504328a31a211814f9cac6de84c5a7ed154f58eb
|
||||
599be0d18f4c6ddf36366d2a5a2ca6dc65886896
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue