mirror of
https://github.com/servo/servo.git
synced 2025-07-30 02:30:21 +01:00
Upgrade to rustc 1.4.0-dev (cb9323ec0 2015-09-01)
This commit is contained in:
parent
ba2cb77c26
commit
40b4348824
28 changed files with 349 additions and 338 deletions
|
@ -60,6 +60,7 @@ use libc;
|
|||
use num::Float;
|
||||
use num::traits::{Bounded, Zero};
|
||||
use std::borrow::ToOwned;
|
||||
use std::char;
|
||||
use std::ptr;
|
||||
use std::rc::Rc;
|
||||
use std::slice;
|
||||
|
@ -122,7 +123,7 @@ pub trait ToJSValConvertible {
|
|||
}
|
||||
|
||||
/// A trait to convert `JSVal`s to Rust types.
|
||||
pub trait FromJSValConvertible {
|
||||
pub trait FromJSValConvertible: Sized {
|
||||
/// Optional configurable behaviour switch; use () for no configuration.
|
||||
type Config;
|
||||
/// Convert `val` to type `Self`.
|
||||
|
@ -452,11 +453,10 @@ pub fn jsstring_to_str(cx: *mut JSContext, s: *mut JSString) -> DOMString {
|
|||
slice::from_raw_parts(chars as *const u16, length as usize)
|
||||
};
|
||||
let mut s = String::with_capacity(length as usize);
|
||||
for item in ::rustc_unicode::str::utf16_items(potentially_ill_formed_utf16) {
|
||||
use ::rustc_unicode::str::Utf16Item::*;
|
||||
for item in char::decode_utf16(potentially_ill_formed_utf16.iter().cloned()) {
|
||||
match item {
|
||||
ScalarValue(c) => s.push(c),
|
||||
LoneSurrogate(_) => {
|
||||
Ok(c) => s.push(c),
|
||||
Err(_) => {
|
||||
// FIXME: Add more info like document URL in the message?
|
||||
macro_rules! message {
|
||||
() => {
|
||||
|
|
|
@ -282,7 +282,7 @@ no_jsmanaged_fields!(Size2D<T>);
|
|||
no_jsmanaged_fields!(Arc<T>);
|
||||
no_jsmanaged_fields!(Image, ImageCacheChan, ImageCacheTask);
|
||||
no_jsmanaged_fields!(Atom, Namespace);
|
||||
no_jsmanaged_fields!(Trusted<T>);
|
||||
no_jsmanaged_fields!(Trusted<T: Reflectable>);
|
||||
no_jsmanaged_fields!(PropertyDeclarationBlock);
|
||||
no_jsmanaged_fields!(HashSet<T>);
|
||||
// These three are interdependent, if you plan to put jsmanaged data
|
||||
|
|
|
@ -637,7 +637,7 @@ impl Element {
|
|||
.iter()
|
||||
.position(|decl| decl.name() == property);
|
||||
if let Some(index) = index {
|
||||
Arc::make_unique(&mut declarations.normal).remove(index);
|
||||
Arc::make_mut(&mut declarations.normal).remove(index);
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -645,7 +645,7 @@ impl Element {
|
|||
.iter()
|
||||
.position(|decl| decl.name() == property);
|
||||
if let Some(index) = index {
|
||||
Arc::make_unique(&mut declarations.important).remove(index);
|
||||
Arc::make_mut(&mut declarations.important).remove(index);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
@ -662,7 +662,7 @@ impl Element {
|
|||
|
||||
// Usually, the reference count will be 1 here. But transitions could make it greater
|
||||
// than that.
|
||||
let existing_declarations = Arc::make_unique(existing_declarations);
|
||||
let existing_declarations = Arc::make_mut(existing_declarations);
|
||||
for declaration in &mut *existing_declarations {
|
||||
if declaration.name() == property_decl.name() {
|
||||
*declaration = property_decl;
|
||||
|
@ -696,8 +696,8 @@ impl Element {
|
|||
|
||||
// Usually, the reference counts of `from` and `to` will be 1 here. But transitions
|
||||
// could make them greater than that.
|
||||
let from = Arc::make_unique(from);
|
||||
let to = Arc::make_unique(to);
|
||||
let from = Arc::make_mut(from);
|
||||
let to = Arc::make_mut(to);
|
||||
let mut new_from = Vec::new();
|
||||
for declaration in from.drain(..) {
|
||||
if properties.contains(&declaration.name()) {
|
||||
|
|
|
@ -223,6 +223,14 @@ macro_rules! no_jsmanaged_fields(
|
|||
}
|
||||
}
|
||||
);
|
||||
($ty:ident<$($gen:ident: $bound:ident),+>) => (
|
||||
impl<$($gen: $bound),+> $crate::dom::bindings::trace::JSTraceable for $ty<$($gen),+> {
|
||||
#[inline]
|
||||
fn trace(&self, _: *mut ::js::jsapi::JSTracer) {
|
||||
// Do nothing
|
||||
}
|
||||
}
|
||||
);
|
||||
);
|
||||
|
||||
/// These are used to generate a event handler which has no special case.
|
||||
|
|
|
@ -15,6 +15,7 @@
|
|||
#![feature(core_intrinsics)]
|
||||
#![feature(custom_attribute)]
|
||||
#![feature(custom_derive)]
|
||||
#![feature(decode_utf16)]
|
||||
#![feature(drain)]
|
||||
#![feature(fnbox)]
|
||||
#![feature(hashmap_hasher)]
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue