Upgrade rustc to d3c49d2140fc65e8bb7d7cf25bfe74dda6ce5ecf/rustc-1.0.0-dev.

This commit is contained in:
Ms2ger 2015-03-11 11:08:57 +01:00 committed by Josh Matthews
parent 65d4b12bf2
commit 5f15eb5fbf
140 changed files with 1420 additions and 1222 deletions

View file

@ -13,10 +13,6 @@ path = "../util"
[dependencies.geom]
git = "https://github.com/servo/rust-geom"
[dependencies.hyper]
git = "https://github.com/servo/hyper"
branch = "servo"
[dependencies.png]
git = "https://github.com/servo/rust-png"
@ -26,8 +22,9 @@ git = "https://github.com/servo/rust-stb-image"
[dependencies]
url = "0.2.16"
time = "0.1.17"
openssl="0.3.1"
rustc-serialize = "0.2"
openssl="0.5.1"
rustc-serialize = "0.3"
cookie="*"
regex = "0.1.14"
regex_macros = "0.1.8"
hyper = "0.3"

View file

@ -11,7 +11,7 @@ use hyper::http::RawStatus;
use util::resource_files::resources_dir_path;
use std::borrow::IntoCow;
use std::old_io::fs::PathExtensions;
use std::fs::PathExt;
use std::sync::mpsc::Sender;
pub fn factory(mut load_data: LoadData, start_chan: Sender<TargetedLoadResponse>) {
@ -36,7 +36,7 @@ pub fn factory(mut load_data: LoadData, start_chan: Sender<TargetedLoadResponse>
let mut path = resources_dir_path();
path.push("failure.html");
assert!(path.exists());
load_data.url = Url::from_file_path(&path).unwrap();
load_data.url = Url::from_file_path(&*path).unwrap();
}
_ => {
start_sending(senders, Metadata::default(load_data.url))

View file

@ -93,7 +93,7 @@ impl CookieStorage {
// http://tools.ietf.org/html/rfc6265#section-5.4
pub fn cookies_for_url(&mut self, url: &Url, source: CookieSource) -> Option<String> {
let filterer = |&:c: &&mut Cookie| -> bool {
let filterer = |c: &&mut Cookie| -> bool {
info!(" === SENT COOKIE : {} {} {:?} {:?}", c.cookie.name, c.cookie.value, c.cookie.domain, c.cookie.path);
info!(" === SENT COOKIE RESULT {}", c.appropriate_for_url(url, source));
// Step 1
@ -104,7 +104,7 @@ impl CookieStorage {
let mut url_cookies: Vec<&mut Cookie> = self.cookies.iter_mut().filter(filterer).collect();
url_cookies.sort_by(|a, b| CookieStorage::cookie_comparator(*a, *b));
let reducer = |&:acc: String, c: &mut &mut Cookie| -> String {
let reducer = |acc: String, c: &mut &mut Cookie| -> String {
// Step 3
c.touch();

View file

@ -19,7 +19,7 @@ use hyper::net::HttpConnector;
use hyper::status::{StatusCode, StatusClass};
use std::error::Error;
use openssl::ssl::{SslContext, SslVerifyMode};
use std::old_io::{IoError, IoErrorKind, Reader};
use std::io::{self, Read, Write};
use std::sync::mpsc::{Sender, channel};
use std::thunk::Invoke;
use util::task::spawn_named;
@ -119,12 +119,14 @@ reason: \"certificate verify failed\" }]";
let mut req = match Request::with_connector(load_data.method.clone(), url.clone(), &mut connector) {
Ok(req) => req,
Err(HttpError::HttpIoError(IoError {kind: IoErrorKind::OtherIoError,
desc: "Error in OpenSSL",
detail: Some(ref det)})) if det.as_slice() == ssl_err_string => {
Err(HttpError::HttpIoError(ref io_error)) if (
io_error.kind() == io::ErrorKind::Other &&
io_error.description() == "Error in OpenSSL" &&
io_error.detail() == Some(ssl_err_string.to_owned())
) => {
let mut image = resources_dir_path();
image.push("badcert.html");
let load_data = LoadData::new(Url::from_file_path(&image).unwrap(), senders.eventual_consumer);
let load_data = LoadData::new(Url::from_file_path(&*image).unwrap(), senders.eventual_consumer);
file_loader::factory(load_data, senders.immediate_consumer);
return;
},
@ -186,7 +188,7 @@ reason: \"certificate verify failed\" }]";
};
match writer.write_all(&*data) {
Err(e) => {
send_error(url, e.desc.to_string(), senders);
send_error(url, e.description().to_string(), senders);
return;
}
_ => {}
@ -301,7 +303,7 @@ reason: \"certificate verify failed\" }]";
unsafe { buf.set_len(1024); }
match response.read(buf.as_mut_slice()) {
Ok(len) => {
Ok(len) if len > 0 => {
unsafe { buf.set_len(len); }
if progress_chan.send(Payload(buf)).is_err() {
// The send errors when the receiver is out of scope,
@ -310,7 +312,7 @@ reason: \"certificate verify failed\" }]";
return;
}
}
Err(_) => {
Ok(_) | Err(_) => {
let _ = progress_chan.send(Done(Ok(())));
break;
}

View file

@ -24,7 +24,7 @@ pub struct ImageHolder<NodeAddress> {
local_image_cache: Arc<Mutex<LocalImageCache<NodeAddress>>>,
}
impl<NodeAddress: Send> ImageHolder<NodeAddress> {
impl<NodeAddress: Send + 'static> ImageHolder<NodeAddress> {
pub fn new(url: Url, local_image_cache: Arc<Mutex<LocalImageCache<NodeAddress>>>)
-> ImageHolder<NodeAddress> {
debug!("ImageHolder::new() {}", url.serialize());

View file

@ -470,8 +470,8 @@ fn load_image_data(url: Url, resource_task: ResourceTask) -> Result<Vec<u8>, ()>
pub fn spawn_listener<F, A>(f: F) -> Sender<A>
where F: FnOnce(Receiver<A>) + Send,
A: Send
where F: FnOnce(Receiver<A>) + Send + 'static,
A: Send + 'static
{
let (setup_chan, setup_port) = channel();
@ -566,7 +566,7 @@ mod tests {
}
}
fn mock_resource_task<T: Closure+Send>(on_load: Box<T>) -> ResourceTask {
fn mock_resource_task<T: Closure + Send + 'static>(on_load: Box<T>) -> ResourceTask {
spawn_listener(move |port: Receiver<resource_task::ControlMsg>| {
loop {
match port.recv().unwrap() {
@ -602,8 +602,8 @@ mod tests {
}
#[test]
#[should_fail]
fn should_fail_if_unprefetched_image_is_requested() {
#[should_panic]
fn should_panic_if_unprefetched_image_is_requested() {
let mock_resource_task = mock_resource_task(box DoesNothing);
let image_cache_task = ImageCacheTask::new(mock_resource_task.clone(), TaskPool::new(4), profiler());

View file

@ -16,6 +16,8 @@
#![allow(missing_copy_implementations)]
#![plugin(regex_macros)]
extern crate "cookie" as cookie_rs;
extern crate collections;
extern crate geom;
@ -30,8 +32,6 @@ extern crate stb_image;
extern crate time;
extern crate url;
#[plugin] #[no_link]
extern crate regex_macros;
extern crate regex;
/// Image handling.

View file

@ -47,7 +47,7 @@ struct ImageState {
last_response: ImageResponseMsg
}
impl<NodeAddress: Send> LocalImageCache<NodeAddress> {
impl<NodeAddress: Send + 'static> LocalImageCache<NodeAddress> {
/// The local cache will only do a single remote request for a given
/// URL in each 'round'. Layout should call this each time it begins
pub fn next_round(&mut self, on_image_available: Box<ImageResponder<NodeAddress> + Send>) {

View file

@ -38,7 +38,7 @@ use std::old_io::net::tcp::TcpListener;
static mut HOST_TABLE: Option<*mut HashMap<String, String>> = None;
pub fn global_init() {
if let Ok(host_file_path) = env::var_string("HOST_FILE") {
if let Ok(host_file_path) = env::var("HOST_FILE") {
//TODO: handle bad file path
let path = Path::new(host_file_path);
let mut file = BufferedReader::new(File::open(&path));
@ -241,7 +241,7 @@ pub fn parse_hostsfile(hostsfile_content: &str) -> Box<HashMap<String, String>>
let address = ip_host[0].to_owned();
for token in ip_host.iter().skip(1) {
if token[].as_bytes()[0] == b'#' {
if token.as_bytes()[0] == b'#' {
break;
}
host_table.insert(token.to_owned().to_string(), address.clone());
@ -326,7 +326,7 @@ impl ResourceManager {
fn from_factory(factory: fn(LoadData, Sender<TargetedLoadResponse>))
-> Box<Invoke<(LoadData, Sender<TargetedLoadResponse>)> + Send> {
box move |&:(load_data, start_chan)| {
box move |(load_data, start_chan)| {
factory(load_data, start_chan)
}
}