mirror of
https://github.com/servo/servo.git
synced 2025-08-03 04:30:10 +01:00
Upgrade to rustc 0.12.0-pre (4d2af3861 2014-09-17 15:51:11 +0000)
This commit is contained in:
parent
8a7eefefd5
commit
a640a7c5c3
74 changed files with 459 additions and 449 deletions
|
@ -8,7 +8,7 @@ use std::any::{Any, AnyRefExt, AnyMutRefExt};
|
|||
use std::collections::hashmap::HashMap;
|
||||
use std::cell::{Cell, RefCell};
|
||||
use std::io::TcpStream;
|
||||
use std::mem::{transmute, transmute_copy};
|
||||
use std::mem::{transmute, transmute_copy, replace};
|
||||
use std::raw::TraitObject;
|
||||
use serialize::json;
|
||||
|
||||
|
@ -24,7 +24,7 @@ pub trait Actor: Any {
|
|||
fn name(&self) -> String;
|
||||
}
|
||||
|
||||
impl<'a> AnyMutRefExt<'a> for &'a mut Actor {
|
||||
impl<'a> AnyMutRefExt<'a> for &'a mut Actor + 'a {
|
||||
fn downcast_mut<T: 'static>(self) -> Option<&'a mut T> {
|
||||
if self.is::<T>() {
|
||||
unsafe {
|
||||
|
@ -40,7 +40,7 @@ impl<'a> AnyMutRefExt<'a> for &'a mut Actor {
|
|||
}
|
||||
}
|
||||
|
||||
impl<'a> AnyRefExt<'a> for &'a Actor {
|
||||
impl<'a> AnyRefExt<'a> for &'a Actor + 'a {
|
||||
fn is<T: 'static>(self) -> bool {
|
||||
//FIXME: This implementation is bogus since get_type_id is private now.
|
||||
// However, this implementation is only needed so long as there's a Rust bug
|
||||
|
@ -162,10 +162,9 @@ impl ActorRegistry {
|
|||
}
|
||||
}
|
||||
}
|
||||
let mut new_actors = self.new_actors.borrow_mut();
|
||||
for &actor in new_actors.iter() {
|
||||
let mut new_actors = replace(&mut *self.new_actors.borrow_mut(), vec!());
|
||||
for actor in new_actors.into_iter() {
|
||||
self.actors.insert(actor.name().to_string(), actor);
|
||||
}
|
||||
new_actors.clear();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -22,10 +22,9 @@ extern crate collections;
|
|||
extern crate core;
|
||||
extern crate devtools_traits;
|
||||
extern crate debug;
|
||||
extern crate std;
|
||||
extern crate serialize;
|
||||
extern crate sync;
|
||||
extern crate servo_msg = "msg";
|
||||
extern crate "msg" as servo_msg;
|
||||
|
||||
use actor::{Actor, ActorRegistry};
|
||||
use actors::console::ConsoleActor;
|
||||
|
@ -181,8 +180,8 @@ fn run_server(port: Receiver<DevtoolsControlMsg>) {
|
|||
//TODO: make constellation send ServerExitMsg on shutdown.
|
||||
|
||||
// accept connections and process them, spawning a new tasks for each one
|
||||
for stream in acceptor.incoming() {
|
||||
match stream {
|
||||
loop {
|
||||
match acceptor.accept() {
|
||||
Err(ref e) if e.kind == TimedOut => {
|
||||
match port.try_recv() {
|
||||
Ok(ServerExitMsg) | Err(Disconnected) => break,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue