mirror of
https://github.com/servo/servo.git
synced 2025-08-02 20:20:14 +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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue