From a094c0a7f3be56c1d510e861562a8b4c08d92c47 Mon Sep 17 00:00:00 2001 From: Ms2ger Date: Thu, 1 Jan 2015 12:21:08 +0100 Subject: [PATCH] Remove unsound Root::deref() call in Attr::set_value. This changes those calls whose unsoundness was not picked up by the type system because of a lifetime constraint that cannot be expressed at this time. --- components/script/dom/attr.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/components/script/dom/attr.rs b/components/script/dom/attr.rs index 028a91ea422..9a062679a4f 100644 --- a/components/script/dom/attr.rs +++ b/components/script/dom/attr.rs @@ -8,6 +8,7 @@ use dom::bindings::codegen::Bindings::AttrBinding::AttrMethods; use dom::bindings::codegen::InheritTypes::NodeCast; use dom::bindings::global::GlobalRef; use dom::bindings::js::{JS, JSRef, Temporary}; +use dom::bindings::js::{OptionalRootedRootable, RootedReference}; use dom::bindings::utils::{Reflector, reflect_dom_object}; use dom::element::{Element, AttributeHandlers}; use dom::node::Node; @@ -207,7 +208,7 @@ pub trait AttrHelpers<'a> { impl<'a> AttrHelpers<'a> for JSRef<'a, Attr> { fn set_value(self, set_type: AttrSettingType, value: AttrValue, owner: JSRef) { - assert!(Some(owner) == self.owner.map(|o| *o.root())); + assert!(Some(owner) == self.owner.root().r()); let node: JSRef = NodeCast::from_ref(owner); let namespace_is_null = self.namespace == ns!("");