diff options
author | Jack Moffitt <jack@metajack.im> | 2014-11-05 12:33:11 -0700 |
---|---|---|
committer | Glenn Watson <gw@intuitionlibrary.com> | 2014-11-13 11:17:43 +1000 |
commit | d1b433a3b3bab353f320b2f39fa953ce326d2d55 (patch) | |
tree | d7a197abb65827b36c47e6b5c3adcce9071643d3 /components/script/dom/bindings/js.rs | |
parent | 26045d7fcbab8851fbefe2851cd904203f8fd8dd (diff) | |
download | servo-d1b433a3b3bab353f320b2f39fa953ce326d2d55.tar.gz servo-d1b433a3b3bab353f320b2f39fa953ce326d2d55.zip |
Rust upgrade to rustc hash b03a2755193cd756583bcf5831cf4545d75ecb8a
Diffstat (limited to 'components/script/dom/bindings/js.rs')
-rw-r--r-- | components/script/dom/bindings/js.rs | 14 |
1 files changed, 4 insertions, 10 deletions
diff --git a/components/script/dom/bindings/js.rs b/components/script/dom/bindings/js.rs index 2cd327397ad..17853287590 100644 --- a/components/script/dom/bindings/js.rs +++ b/components/script/dom/bindings/js.rs @@ -94,7 +94,7 @@ impl<T: Reflectable> Temporary<T> { pub fn root<'a, 'b>(self) -> Root<'a, 'b, T> { let collection = StackRoots.get().unwrap(); unsafe { - (**collection).new_root(&self.inner) + Root::new(&**collection, &self.inner) } } @@ -171,7 +171,7 @@ impl<T: Reflectable> JS<T> { pub fn root<'a, 'b>(&self) -> Root<'a, 'b, T> { let collection = StackRoots.get().unwrap(); unsafe { - (**collection).new_root(self) + Root::new(&**collection, self) } } } @@ -431,18 +431,12 @@ impl RootCollection { } } - /// Create a new stack-bounded root that will not outlive this collection - #[allow(unrooted_must_root)] - fn new_root<'b, 'a: 'b, T: Reflectable>(&'a self, unrooted: &JS<T>) -> Root<'a, 'b, T> { - Root::new(self, unrooted) - } - /// Track a stack-based root to ensure LIFO root ordering fn root<'a, 'b, T: Reflectable>(&self, untracked: &Root<'a, 'b, T>) { unsafe { let roots = self.roots.get(); (*roots).push(untracked.js_ptr); - debug!(" rooting {:?}", untracked.js_ptr); + debug!(" rooting {}", untracked.js_ptr); } } @@ -450,7 +444,7 @@ impl RootCollection { fn unroot<'a, 'b, T: Reflectable>(&self, rooted: &Root<'a, 'b, T>) { unsafe { let roots = self.roots.get(); - debug!("unrooting {:?} (expecting {:?}", + debug!("unrooting {} (expecting {}", (*roots).as_slice().last().unwrap(), rooted.js_ptr); assert!(*(*roots).as_slice().last().unwrap() == rooted.js_ptr); |