mirror of
https://github.com/servo/servo.git
synced 2025-08-09 23:45:35 +01:00
Upgrade rustc to d3c49d2140fc65e8bb7d7cf25bfe74dda6ce5ecf/rustc-1.0.0-dev.
This commit is contained in:
parent
65d4b12bf2
commit
5f15eb5fbf
140 changed files with 1420 additions and 1222 deletions
|
@ -54,11 +54,12 @@ use js::jsval::{StringValue, ObjectValue, ObjectOrNullValue};
|
|||
use libc;
|
||||
use std::borrow::ToOwned;
|
||||
use std::default;
|
||||
use std::marker::MarkerTrait;
|
||||
use std::slice;
|
||||
|
||||
/// A trait to retrieve the constants necessary to check if a `JSObject`
|
||||
/// implements a given interface.
|
||||
pub trait IDLInterface {
|
||||
pub trait IDLInterface: MarkerTrait {
|
||||
/// Returns the prototype ID.
|
||||
fn get_prototype_id() -> PrototypeList::ID;
|
||||
/// Returns the prototype depth, i.e., the number of interfaces this
|
||||
|
@ -74,6 +75,7 @@ pub trait ToJSValConvertible {
|
|||
|
||||
/// A trait to convert `JSVal`s to Rust types.
|
||||
pub trait FromJSValConvertible {
|
||||
/// Optional configurable behaviour switch; use () for no configuration.
|
||||
type Config;
|
||||
/// Convert `val` to type `Self`.
|
||||
/// Optional configuration of type `T` can be passed as the `option`
|
||||
|
|
|
@ -62,7 +62,7 @@ use util::smallvec::{SmallVec, SmallVec16};
|
|||
use core::nonzero::NonZero;
|
||||
use std::cell::{Cell, UnsafeCell};
|
||||
use std::default::Default;
|
||||
use std::marker::ContravariantLifetime;
|
||||
use std::marker::PhantomData;
|
||||
use std::mem;
|
||||
use std::ops::Deref;
|
||||
|
||||
|
@ -677,7 +677,7 @@ impl<T: Reflectable> Root<T> {
|
|||
pub fn r<'b>(&'b self) -> JSRef<'b, T> {
|
||||
JSRef {
|
||||
ptr: self.ptr,
|
||||
chain: ContravariantLifetime,
|
||||
chain: PhantomData,
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -688,7 +688,7 @@ impl<T: Reflectable> Root<T> {
|
|||
pub fn get_unsound_ref_forever<'b>(&self) -> JSRef<'b, T> {
|
||||
JSRef {
|
||||
ptr: self.ptr,
|
||||
chain: ContravariantLifetime,
|
||||
chain: PhantomData,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -713,7 +713,7 @@ impl<'a, T: Reflectable> Deref for JSRef<'a, T> {
|
|||
/// copyable.
|
||||
pub struct JSRef<'a, T> {
|
||||
ptr: NonZero<*const T>,
|
||||
chain: ContravariantLifetime<'a>,
|
||||
chain: PhantomData<&'a ()>,
|
||||
}
|
||||
|
||||
impl<'a, T> Copy for JSRef<'a, T> {}
|
||||
|
|
|
@ -32,6 +32,7 @@ use libc;
|
|||
use std::cell::RefCell;
|
||||
use std::collections::hash_map::HashMap;
|
||||
use std::collections::hash_map::Entry::{Vacant, Occupied};
|
||||
use std::marker::PhantomData;
|
||||
use std::rc::Rc;
|
||||
use std::sync::{Arc, Mutex};
|
||||
|
||||
|
@ -53,6 +54,7 @@ pub struct Trusted<T> {
|
|||
refcount: Arc<Mutex<usize>>,
|
||||
script_chan: Box<ScriptChan + Send>,
|
||||
owner_thread: *const libc::c_void,
|
||||
phantom: PhantomData<T>,
|
||||
}
|
||||
|
||||
unsafe impl<T: Reflectable> Send for Trusted<T> {}
|
||||
|
@ -71,6 +73,7 @@ impl<T: Reflectable> Trusted<T> {
|
|||
refcount: refcount,
|
||||
script_chan: script_chan.clone(),
|
||||
owner_thread: (&*live_references) as *const _ as *const libc::c_void,
|
||||
phantom: PhantomData,
|
||||
}
|
||||
})
|
||||
}
|
||||
|
@ -102,6 +105,7 @@ impl<T: Reflectable> Clone for Trusted<T> {
|
|||
refcount: self.refcount.clone(),
|
||||
script_chan: self.script_chan.clone(),
|
||||
owner_thread: self.owner_thread,
|
||||
phantom: PhantomData,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
//! The `ByteString` struct.
|
||||
|
||||
use std::borrow::ToOwned;
|
||||
use std::hash::{Hash, SipHasher};
|
||||
use std::hash::{Hash, Hasher};
|
||||
use std::str;
|
||||
use std::str::FromStr;
|
||||
|
||||
|
@ -144,8 +144,8 @@ impl ByteString {
|
|||
}
|
||||
}
|
||||
|
||||
impl Hash<SipHasher> for ByteString {
|
||||
fn hash(&self, state: &mut SipHasher) {
|
||||
impl Hash for ByteString {
|
||||
fn hash<H: Hasher>(&self, state: &mut H) {
|
||||
let ByteString(ref vec) = *self;
|
||||
vec.hash(state);
|
||||
}
|
||||
|
|
|
@ -184,10 +184,10 @@ impl<T: JSTraceable> JSTraceable for Option<T> {
|
|||
}
|
||||
|
||||
impl<K,V,S> JSTraceable for HashMap<K, V, S>
|
||||
where K: Hash<<S as HashState>::Hasher> + Eq + JSTraceable,
|
||||
where K: Hash + Eq + JSTraceable,
|
||||
V: JSTraceable,
|
||||
S: HashState,
|
||||
<S as HashState>::Hasher: Hasher<Output=u64>,
|
||||
<S as HashState>::Hasher: Hasher,
|
||||
{
|
||||
#[inline]
|
||||
fn trace(&self, trc: *mut JSTracer) {
|
||||
|
|
|
@ -577,7 +577,10 @@ pub extern fn outerize_global(_cx: *mut JSContext, obj: JSHandleObject) -> *mut
|
|||
debug!("outerizing");
|
||||
let obj = *obj.unnamed_field1;
|
||||
let win: Root<window::Window> = native_from_reflector_jsmanaged(obj).unwrap().root();
|
||||
win.r().browser_context().as_ref().unwrap().window_proxy()
|
||||
// FIXME(https://github.com/rust-lang/rust/issues/23338)
|
||||
let win = win.r();
|
||||
let context = win.browser_context();
|
||||
context.as_ref().unwrap().window_proxy()
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue