diff options
-rw-r--r-- | components/layout/wrapper.rs | 8 | ||||
-rw-r--r-- | components/script/dom/bindings/js.rs | 4 |
2 files changed, 5 insertions, 7 deletions
diff --git a/components/layout/wrapper.rs b/components/layout/wrapper.rs index 94b536e1a4e..6b8db9b1b98 100644 --- a/components/layout/wrapper.rs +++ b/components/layout/wrapper.rs @@ -369,10 +369,8 @@ impl<'ln> TNode<'ln, LayoutElement<'ln>> for LayoutNode<'ln> { None => panic!("not an element") }; - let element = &*elem.unsafe_get(); - LayoutElement { - element: mem::transmute(element), + element: &*elem.unsafe_get(), } } } @@ -719,7 +717,7 @@ impl<'ln> TLayoutNode for ThreadSafeLayoutNode<'ln> { } unsafe fn get<'a>(&'a self) -> &'a Node { // this change. - mem::transmute::<*mut Node,&'a Node>(self.get_jsmanaged().unsafe_get()) + &*self.get_jsmanaged().unsafe_get() } fn first_child(&self) -> Option<ThreadSafeLayoutNode<'ln>> { @@ -819,7 +817,7 @@ impl<'ln> ThreadSafeLayoutNode<'ln> { // FIXME(pcwalton): Workaround until Rust gets multiple lifetime parameters on // implementations. ThreadSafeLayoutElement { - element: &mut *element, + element: &*element, } } } diff --git a/components/script/dom/bindings/js.rs b/components/script/dom/bindings/js.rs index e220f181a34..bc2d52a24bd 100644 --- a/components/script/dom/bindings/js.rs +++ b/components/script/dom/bindings/js.rs @@ -311,8 +311,8 @@ impl<T: Reflectable> JS<T> { /// Returns an unsafe pointer to the interior of this object. This is the /// only method that be safely accessed from layout. (The fact that this is /// unsafe is what necessitates the layout wrappers.) - pub unsafe fn unsafe_get(&self) -> *mut T { - self.ptr as *mut T + pub unsafe fn unsafe_get(&self) -> *const T { + self.ptr } /// Store an unrooted value in this field. This is safe under the assumption that JS<T> |