auto merge of #4575 : mttr/servo/warnings, r=jdm

Notes:

* This adds `#![allow(missing_copy_implementations)]` to components/*/lib.rs. I'm not sure how to approach the missing Copy warnings (are there things for which Copy should NOT be implemented, and how can I tell?) so I stuck this in to make life easier when looking through the warnings. I can easily remove this if necessary. 
* This leaves the following type of warnings, which I couldn't figure out how to approach (I'll investigate it later if no one else wants to).
```
css/matching.rs:72:23: 72:35 warning: use of deprecated item: Use overloaded core::cmp::PartialEq, #[warn(deprecated)] on by default
css/matching.rs:72         this_as_query.equiv(other)
                                         ^~~~~~~~~~~~
css/matching.rs:95:10: 95:49 warning: use of deprecated item: Use overloaded core::cmp::PartialEq, #[warn(deprecated)] on by default
css/matching.rs:95 impl<'a> Equiv<ApplicableDeclarationsCacheEntry> for ApplicableDeclarationsCacheQuery<'a> {
```
This commit is contained in:
bors-servo 2015-01-08 16:03:55 -07:00
commit 0793137631
36 changed files with 88 additions and 74 deletions

View file

@ -6,7 +6,7 @@ use std::io;
use std::io::Writer;
use std::mem;
use std::mem::size_of;
use std::slice::raw::buf_as_slice;
use std::slice;
fn hexdump_slice(buf: &[u8]) {
let mut stderr = io::stderr();
@ -28,6 +28,7 @@ pub fn hexdump<T>(obj: &T) {
unsafe {
let buf: *const u8 = mem::transmute(obj);
debug!("dumping at {:p}", buf);
buf_as_slice(buf, size_of::<T>(), hexdump_slice);
let from_buf = slice::from_raw_buf(&buf, size_of::<T>());
hexdump_slice(from_buf);
}
}

View file

@ -168,12 +168,10 @@ impl<T: Send> BufferPool<T> {
}
fn free(&self, buf: Box<Buffer<T>>) {
unsafe {
let mut pool = self.pool.lock();
match pool.iter().position(|v| v.size() > buf.size()) {
Some(i) => pool.insert(i, buf),
None => pool.push(buf),
}
let mut pool = self.pool.lock();
match pool.iter().position(|v| v.size() > buf.size()) {
Some(i) => pool.insert(i, buf),
None => pool.push(buf),
}
}
}

View file

@ -6,6 +6,7 @@
#![deny(unused_imports)]
#![deny(unused_variables)]
#![allow(missing_copy_implementations)]
#![feature(phase)]
#[phase(plugin, link)]

View file

@ -155,7 +155,7 @@ fn get_jemalloc_stat(name: &'static str) -> Option<u64> {
let mut oldlen = size_of::<size_t>() as size_t;
let rv: c_int;
unsafe {
rv = je_mallctl(c_name.unwrap(), oldp, &mut oldlen, null_mut(), 0);
rv = je_mallctl(c_name.into_inner(), oldp, &mut oldlen, null_mut(), 0);
}
if rv == 0 { Some(old as u64) } else { None }
}

View file

@ -9,7 +9,7 @@ use std::ascii::AsciiExt;
use std::iter::Filter;
use std::num::Int;
use std::str::{CharEq, CharSplits, FromStr};
use unicode::char::to_lowercase;
use unicode::char::UnicodeChar;
pub type DOMString = String;
pub type StaticCharVec = &'static [char];
@ -328,7 +328,7 @@ pub struct LowercaseString {
impl LowercaseString {
pub fn new(s: &str) -> LowercaseString {
LowercaseString {
inner: s.chars().map(to_lowercase).collect(),
inner: s.chars().map(|c| c.to_lowercase()).collect(),
}
}
}

View file

@ -33,7 +33,7 @@ pub fn spawn_named_with_send_on_failure<T: Send>(name: &'static str,
let watcher_name = format!("{}Watcher", watched_name);
TaskBuilder::new().named(watcher_name).spawn(proc() {
//rtinstrument::instrument(proc() {
match future_result.unwrap() {
match future_result.into_inner() {
Ok(()) => (),
Err(..) => {
debug!("{} failed, notifying constellation", name);

View file

@ -8,11 +8,11 @@ use std::cell::RefCell;
static mut next_tid: AtomicUint = INIT_ATOMIC_UINT;
thread_local!(static task_local_tid: Rc<RefCell<Option<uint>>> = Rc::new(RefCell::new(None)))
thread_local!(static TASK_LOCAL_TID: Rc<RefCell<Option<uint>>> = Rc::new(RefCell::new(None)))
/// Every task gets one, that's unique.
pub fn tid() -> uint {
task_local_tid.with(|ref k| {
TASK_LOCAL_TID.with(|ref k| {
let ret =
match *k.borrow() {
None => unsafe { next_tid.fetch_add(1, SeqCst) },