diff options
author | Josh Matthews <josh@joshmatthews.net> | 2015-01-15 13:26:44 -0500 |
---|---|---|
committer | Glenn Watson <gw@intuitionlibrary.com> | 2015-01-28 10:16:49 +1000 |
commit | 95fc29fa0db21959df99d81cdbb9561226321d2f (patch) | |
tree | a48e171165ec155062ef13c550b2c0f72d127425 /components/layout/layout_debug.rs | |
parent | ff8cbff81016c157373c1675f3eee69dd70ae544 (diff) | |
download | servo-95fc29fa0db21959df99d81cdbb9561226321d2f.tar.gz servo-95fc29fa0db21959df99d81cdbb9561226321d2f.zip |
Update rustc to 00b112c45a604fa6f4b59af2a40c9deeadfdb7c6/rustc-1.0.0-dev.
Diffstat (limited to 'components/layout/layout_debug.rs')
-rw-r--r-- | components/layout/layout_debug.rs | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/components/layout/layout_debug.rs b/components/layout/layout_debug.rs index 26d2f8b3ef7..5f0851b1f36 100644 --- a/components/layout/layout_debug.rs +++ b/components/layout/layout_debug.rs @@ -14,11 +14,11 @@ use serialize::json; use std::borrow::ToOwned; use std::cell::RefCell; use std::io::File; -use std::sync::atomic::{AtomicUint, Ordering, INIT_ATOMIC_UINT}; +use std::sync::atomic::{AtomicUint, Ordering, ATOMIC_UINT_INIT}; -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; +static mut DEBUG_ID_COUNTER: AtomicUint = ATOMIC_UINT_INIT; pub struct Scope; @@ -31,9 +31,9 @@ macro_rules! layout_debug_scope( layout_debug::Scope } ) -) +); -#[deriving(Encodable)] +#[derive(RustcEncodable)] struct ScopeData { name: String, pre: String, @@ -63,12 +63,12 @@ impl Scope { pub fn new(name: String) -> Scope { STATE_KEY.with(|ref r| { match &mut *r.borrow_mut() { - &Some(ref mut state) => { + &mut Some(ref mut state) => { let flow_trace = json::encode(&flow::base(&*state.flow_root)); let data = box ScopeData::new(name.clone(), flow_trace); state.scope_stack.push(data); } - &None => {} + &mut None => {} } }); Scope @@ -80,13 +80,13 @@ impl Drop for Scope { fn drop(&mut self) { STATE_KEY.with(|ref r| { match &mut *r.borrow_mut() { - &Some(ref mut state) => { + &mut Some(ref mut state) => { let mut current_scope = state.scope_stack.pop().unwrap(); current_scope.post = json::encode(&flow::base(&*state.flow_root)); let previous_scope = state.scope_stack.last_mut().unwrap(); previous_scope.children.push(current_scope); } - &None => {} + &mut None => {} } }); } |