diff options
author | Eli Friedman <eli.friedman@gmail.com> | 2015-10-18 14:52:18 -0700 |
---|---|---|
committer | Eli Friedman <eli.friedman@gmail.com> | 2015-10-23 14:43:44 -0700 |
commit | 81ecf7824cae9629be020332c836205fedaae1a2 (patch) | |
tree | e4bf83a26f9850ab16905ca1556eb882fd6b658a /components/script/dom/bindings/js.rs | |
parent | e3bcf7bab7d0340fc7ebd0e58a2cde34e534c1cf (diff) | |
download | servo-81ecf7824cae9629be020332c836205fedaae1a2.tar.gz servo-81ecf7824cae9629be020332c836205fedaae1a2.zip |
Make unrooted_must_root a bit more aggressive.
Basically, instead of trying to check for specific kinds of statements,
just check the types of all local variables.
Also included are some commented-out proposals for some slightly more
aggressive lints which might be useful (but trigger a little too
frequently at the moment).
Diffstat (limited to 'components/script/dom/bindings/js.rs')
-rw-r--r-- | components/script/dom/bindings/js.rs | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/components/script/dom/bindings/js.rs b/components/script/dom/bindings/js.rs index 6faef9b111b..7abebcac971 100644 --- a/components/script/dom/bindings/js.rs +++ b/components/script/dom/bindings/js.rs @@ -310,11 +310,13 @@ impl<T: Reflectable> MutNullableHeap<JS<T>> { /// Retrieve a copy of the inner optional `JS<T>` as `LayoutJS<T>`. /// For use by layout, which can't use safe types like Temporary. + #[allow(unrooted_must_root)] pub unsafe fn get_inner_as_layout(&self) -> Option<LayoutJS<T>> { ptr::read(self.ptr.get()).map(|js| js.to_layout()) } /// Get a rooted value out of this object + #[allow(unrooted_must_root)] pub fn get(&self) -> Option<Root<T>> { unsafe { ptr::read(self.ptr.get()).map(|o| o.root()) |