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

@ -28,10 +28,10 @@ struct LocalLayoutContext {
style_sharing_candidate_cache: StyleSharingCandidateCache,
}
thread_local!(static local_context_key: Cell<*mut LocalLayoutContext> = Cell::new(ptr::null_mut()))
thread_local!(static LOCAL_CONTEXT_KEY: Cell<*mut LocalLayoutContext> = Cell::new(ptr::null_mut()))
fn create_or_get_local_context(shared_layout_context: &SharedLayoutContext) -> *mut LocalLayoutContext {
local_context_key.with(|ref r| {
LOCAL_CONTEXT_KEY.with(|ref r| {
if r.get().is_null() {
let context = box LocalLayoutContext {
font_context: FontContext::new(shared_layout_context.font_cache_task.clone()),

View file

@ -14,7 +14,7 @@ use std::cell::RefCell;
use std::io::File;
use std::sync::atomic::{AtomicUint, SeqCst, INIT_ATOMIC_UINT};
thread_local!(static state_key: RefCell<Option<State>> = RefCell::new(None))
thread_local!(static STATE_KEY: RefCell<Option<State>> = RefCell::new(None))
static mut DEBUG_ID_COUNTER: AtomicUint = INIT_ATOMIC_UINT;
@ -59,7 +59,7 @@ struct State {
/// will be output at the beginning and end of this scope.
impl Scope {
pub fn new(name: String) -> Scope {
state_key.with(|ref r| {
STATE_KEY.with(|ref r| {
match &mut *r.borrow_mut() {
&Some(ref mut state) => {
let flow_trace = json::encode(&flow::base(state.flow_root.deref()));
@ -76,7 +76,7 @@ impl Scope {
#[cfg(not(ndebug))]
impl Drop for Scope {
fn drop(&mut self) {
state_key.with(|ref r| {
STATE_KEY.with(|ref r| {
match &mut *r.borrow_mut() {
&Some(ref mut state) => {
let mut current_scope = state.scope_stack.pop().unwrap();
@ -100,9 +100,9 @@ pub fn generate_unique_debug_id() -> u16 {
/// Begin a layout debug trace. If this has not been called,
/// creating debug scopes has no effect.
pub fn begin_trace(flow_root: FlowRef) {
assert!(state_key.with(|ref r| r.borrow().is_none()));
assert!(STATE_KEY.with(|ref r| r.borrow().is_none()));
state_key.with(|ref r| {
STATE_KEY.with(|ref r| {
let flow_trace = json::encode(&flow::base(flow_root.deref()));
let state = State {
scope_stack: vec![box ScopeData::new("root".into_string(), flow_trace)],
@ -116,7 +116,7 @@ pub fn begin_trace(flow_root: FlowRef) {
/// trace to disk in the current directory. The output
/// file can then be viewed with an external tool.
pub fn end_trace() {
let mut task_state = state_key.with(|ref r| r.borrow_mut().take().unwrap());
let mut task_state = STATE_KEY.with(|ref r| r.borrow_mut().take().unwrap());
assert!(task_state.scope_stack.len() == 1);
let mut root_scope = task_state.scope_stack.pop().unwrap();
root_scope.post = json::encode(&flow::base(task_state.flow_root.deref()));

View file

@ -7,6 +7,7 @@
#![deny(unused_imports)]
#![deny(unused_variables)]
#![allow(unrooted_must_root)]
#![allow(missing_copy_implementations)]
#[phase(plugin, link)]
extern crate log;