Upgrade to rustc ba2f13ef0 2015-02-04

This commit is contained in:
Simon Sapin 2015-01-31 14:36:05 +01:00 committed by Matt Brubeck
parent bc6882bdef
commit d5dd1d658e
136 changed files with 1091 additions and 878 deletions

View file

@ -20,7 +20,7 @@ use std::ffi::CString;
use std::ptr;
/// DOM exceptions that can be thrown by a native DOM method.
#[derive(Show, Clone)]
#[derive(Debug, Clone)]
pub enum Error {
/// IndexSizeError
IndexSize,

View file

@ -152,7 +152,8 @@ impl Hash<SipHasher> for ByteString {
}
impl FromStr for ByteString {
fn from_str(s: &str) -> Option<ByteString> {
Some(ByteString::new(s.to_owned().into_bytes()))
type Err = ();
fn from_str(s: &str) -> Result<ByteString, ()> {
Ok(ByteString::new(s.to_owned().into_bytes()))
}
}

View file

@ -57,7 +57,7 @@ use std::collections::HashMap;
use std::collections::hash_state::HashState;
use std::ffi::CString;
use std::hash::{Hash, Hasher};
use std::io::timer::Timer;
use std::old_io::timer::Timer;
use std::rc::Rc;
use std::sync::mpsc::{Receiver, Sender};
use string_cache::{Atom, Namespace};

View file

@ -14,7 +14,7 @@ use util::str::DOMString;
use std::borrow::ToOwned;
#[repr(uint)]
#[derive(Copy, Show)]
#[derive(Copy, Debug)]
#[jstraceable]
pub enum DOMErrorName {
IndexSizeError = DOMExceptionConstants::INDEX_SIZE_ERR as uint,

View file

@ -92,7 +92,7 @@ impl ElementDerived for EventTarget {
}
}
#[derive(Copy, PartialEq, Show)]
#[derive(Copy, PartialEq, Debug)]
#[jstraceable]
pub enum ElementTypeId {
HTMLElement(HTMLElementTypeId),
@ -1404,8 +1404,8 @@ impl<'a> style::node::TElement<'a> for JSRef<'a, Element> {
has_class(self, name)
}
fn each_class<F>(self, callback: F)
where F: Fn(&Atom)
fn each_class<F>(self, mut callback: F)
where F: FnMut(&Atom)
{
match self.get_attribute(ns!(""), &atom!("class")).root() {
None => {}

View file

@ -165,9 +165,7 @@ impl HTMLCollection {
}
fn traverse<'a>(root: JSRef<'a, Node>)
-> FilterMap<JSRef<'a, Node>,
JSRef<'a, Element>,
Skip<TreeIterator<'a>>,
-> FilterMap<Skip<TreeIterator<'a>>,
fn(JSRef<Node>) -> Option<JSRef<Element>>> {
root.traverse_preorder()
.skip(1)

View file

@ -206,7 +206,7 @@ impl<'a> VirtualMethods for JSRef<'a, HTMLElement> {
}
}
#[derive(Copy, PartialEq, Show)]
#[derive(Copy, PartialEq, Debug)]
#[jstraceable]
pub enum HTMLElementTypeId {
HTMLElement,

View file

@ -23,7 +23,7 @@ use dom::htmlbuttonelement::{HTMLButtonElement};
use dom::htmltextareaelement::{HTMLTextAreaElement, HTMLTextAreaElementHelpers};
use dom::node::{Node, NodeHelpers, NodeTypeId, document_from_node, window_from_node};
use hyper::method::Method;
use hyper::header::common::ContentType;
use hyper::header::ContentType;
use hyper::mime;
use msg::constellation_msg::LoadData;
use util::str::DOMString;

View file

@ -38,7 +38,7 @@ impl HTMLMediaElement {
}
}
#[derive(Copy, PartialEq, Show)]
#[derive(Copy, PartialEq, Debug)]
#[jstraceable]
pub enum HTMLMediaElementTypeId {
HTMLAudioElement,

View file

@ -22,7 +22,7 @@ pub fn serialize(iterator: &mut NodeIterator) -> String {
let mut html = String::new();
let mut open_elements: Vec<String> = vec!();
let depth = iterator.depth;
for node in *iterator {
for node in iterator {
while open_elements.len() > depth {
html.push_str("</");
html.push_str(open_elements.pop().unwrap().as_slice());

View file

@ -16,7 +16,7 @@ use cssparser::RGBA;
use util::str::{self, DOMString, LengthOrPercentageOrAuto};
use std::cell::Cell;
#[derive(Copy, PartialEq, Show)]
#[derive(Copy, PartialEq, Debug)]
#[jstraceable]
pub enum HTMLTableCellElementTypeId {
HTMLTableDataCellElement,

View file

@ -261,7 +261,7 @@ impl LayoutDataRef {
unsafe impl Send for LayoutDataRef {}
/// The different types of nodes.
#[derive(Copy, PartialEq, Show)]
#[derive(Copy, PartialEq, Debug)]
#[jstraceable]
pub enum NodeTypeId {
DocumentType,
@ -1020,10 +1020,7 @@ impl RawLayoutNodeHelpers for Node {
//
pub type ChildElementIterator<'a> =
Peekable<JSRef<'a, Element>,
FilterMap<JSRef<'a, Node>,
JSRef<'a, Element>,
NodeChildrenIterator<'a>,
Peekable<FilterMap<NodeChildrenIterator<'a>,
fn(JSRef<Node>) -> Option<JSRef<Element>>>>;
pub struct NodeChildrenIterator<'a> {

View file

@ -92,7 +92,8 @@ struct Tracer {
trc: *mut JSTracer,
}
impl tree_builder::Tracer<JS<Node>> for Tracer {
impl tree_builder::Tracer for Tracer {
type Handle = JS<Node>;
#[allow(unrooted_must_root)]
fn trace_handle(&self, node: JS<Node>) {
node.trace(self.trc);
@ -107,7 +108,7 @@ impl JSTraceable for ServoHTMLParser {
let tracer = Tracer {
trc: trc,
};
let tracer = &tracer as &tree_builder::Tracer<JS<Node>>;
let tracer = &tracer as &tree_builder::Tracer<Handle=JS<Node>>;
unsafe {
// Assertion: If the parser is mutably borrowed, we're in the

View file

@ -47,7 +47,7 @@ use js::rust::with_compartment;
use url::{Url, UrlParser};
use libc;
use rustc_serialize::base64::{FromBase64, ToBase64, STANDARD};
use serialize::base64::{FromBase64, ToBase64, STANDARD};
use std::cell::{Ref, RefMut};
use std::default::Default;
use std::ffi::CString;
@ -140,7 +140,7 @@ pub fn base64_btoa(btoa: DOMString) -> Fallible<DOMString> {
// http://www.whatwg.org/html/#atob
pub fn base64_atob(atob: DOMString) -> Fallible<DOMString> {
// "Let input be the string being parsed."
let mut input = atob.as_slice();
let input = atob.as_slice();
// "Remove all space characters from input."
// serialize::base64::from_base64 ignores \r and \n,
@ -152,7 +152,7 @@ pub fn base64_atob(atob: DOMString) -> Fallible<DOMString> {
let without_spaces = input.chars()
.filter(|&c| ! is_html_space(c))
.collect::<String>();
input = without_spaces.as_slice();
let mut input = without_spaces.as_slice();
// "If the length of input divides by 4 leaving no remainder, then:
// if input ends with one or two U+003D EQUALS SIGN (=) characters,

View file

@ -33,8 +33,7 @@ use encoding::label::encoding_from_whatwg_label;
use encoding::types::{DecoderTrap, Encoding, EncodingRef, EncoderTrap};
use hyper::header::Headers;
use hyper::header::common::{Accept, ContentLength, ContentType};
use hyper::header::quality_item::QualityItem;
use hyper::header::{Accept, ContentLength, ContentType, QualityItem};
use hyper::http::RawStatus;
use hyper::mime::{self, Mime};
use hyper::method::Method;
@ -55,7 +54,7 @@ use std::borrow::ToOwned;
use std::cell::Cell;
use std::sync::mpsc::{Sender, Receiver, channel};
use std::default::Default;
use std::io::Timer;
use std::old_io::Timer;
use std::str::FromStr;
use std::time::duration::Duration;
use time;
@ -361,8 +360,8 @@ impl<'a> XMLHttpRequestMethods for JSRef<'a, XMLHttpRequest> {
match upper.as_slice() {
"DELETE" | "GET" | "HEAD" | "OPTIONS" |
"POST" | "PUT" | "CONNECT" | "TRACE" |
"TRACK" => upper.parse(),
_ => s.parse()
"TRACK" => upper.parse().ok(),
_ => s.parse().ok()
}
});
// Step 2
@ -830,7 +829,7 @@ impl<'a> PrivateXMLHttpRequestHelpers for JSRef<'a, XMLHttpRequest> {
// Substep 2
status.map(|RawStatus(code, reason)| {
self.status.set(code);
*self.status_text.borrow_mut() = ByteString::new(reason.into_bytes());
*self.status_text.borrow_mut() = ByteString::new(reason.into_owned().into_bytes());
});
headers.as_ref().map(|h| *self.response_headers.borrow_mut() = h.clone());
@ -990,13 +989,13 @@ impl<'a> PrivateXMLHttpRequestHelpers for JSRef<'a, XMLHttpRequest> {
// http://fetch.spec.whatwg.org/#concept-response-header-list
use std::fmt;
use hyper::header::{Header, HeaderFormat};
use hyper::header::common::SetCookie;
use hyper::header::SetCookie;
// a dummy header so we can use headers.remove::<SetCookie2>()
#[derive(Clone)]
struct SetCookie2;
impl Header for SetCookie2 {
fn header_name(_: Option<SetCookie2>) -> &'static str {
fn header_name() -> &'static str {
"set-cookie2"
}