From 62fb2074e1ad55293d6f058793e77012235f5631 Mon Sep 17 00:00:00 2001 From: Anthony Ramine Date: Thu, 8 Dec 2016 15:05:26 -1000 Subject: [PATCH] Clean up ROOTED_TRACEABLES --- components/script/dom/bindings/trace.rs | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) diff --git a/components/script/dom/bindings/trace.rs b/components/script/dom/bindings/trace.rs index 4c650719bff..58583077e62 100644 --- a/components/script/dom/bindings/trace.rs +++ b/components/script/dom/bindings/trace.rs @@ -82,7 +82,7 @@ use serde::{Deserialize, Serialize}; use servo_atoms::Atom; use servo_url::ServoUrl; use smallvec::SmallVec; -use std::cell::{Cell, UnsafeCell}; +use std::cell::{Cell, RefCell, UnsafeCell}; use std::collections::{BTreeMap, HashMap, HashSet, VecDeque}; use std::hash::{BuildHasher, Hash}; use std::ops::{Deref, DerefMut}; @@ -579,16 +579,11 @@ pub struct RootedTraceableSet { set: Vec, } -#[allow(missing_docs)] // FIXME -mod dummy { // Attributes don’t apply through the macro. - use std::cell::RefCell; - use std::rc::Rc; - use super::RootedTraceableSet; +thread_local!( /// TLV Holds a set of JSTraceables that need to be rooted - thread_local!(pub static ROOTED_TRACEABLES: Rc> = - Rc::new(RefCell::new(RootedTraceableSet::new()))); -} -pub use self::dummy::ROOTED_TRACEABLES; + static ROOTED_TRACEABLES: Rc> = + Rc::new(RefCell::new(RootedTraceableSet::new())); +); impl RootedTraceableSet { fn new() -> RootedTraceableSet {