From b40681e2312a2c3fd3c34f0f70760c768dda0753 Mon Sep 17 00:00:00 2001 From: Anthony Ramine Date: Tue, 6 Dec 2016 10:31:52 -1000 Subject: [PATCH] Make the impl of JSTraceable for LayoutRPC sound with a Send bound --- components/script/dom/bindings/trace.rs | 3 ++- components/script/dom/window.rs | 4 ++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/components/script/dom/bindings/trace.rs b/components/script/dom/bindings/trace.rs index cb5deabd3f4..b0d4621e36b 100644 --- a/components/script/dom/bindings/trace.rs +++ b/components/script/dom/bindings/trace.rs @@ -391,7 +391,8 @@ unsafe impl JSTraceable for IpcSender where T: Deserialize + Serialize { } } -unsafe impl JSTraceable for Box { +// Safe thanks to the Send bound. +unsafe impl JSTraceable for Box { #[inline] unsafe fn trace(&self, _: *mut JSTracer) { // Do nothing diff --git a/components/script/dom/window.rs b/components/script/dom/window.rs index 4b4b74b846e..51436a3c793 100644 --- a/components/script/dom/window.rs +++ b/components/script/dom/window.rs @@ -196,7 +196,7 @@ pub struct Window { /// A handle to perform RPC calls into the layout, quickly. #[ignore_heap_size_of = "trait objects are hard"] - layout_rpc: Box, + layout_rpc: Box, /// The current size of the window, in pixels. window_size: Cell>, @@ -1538,7 +1538,7 @@ impl Window { parent_info: Option<(PipelineId, FrameType)>, window_size: Option) -> Root { - let layout_rpc: Box = { + let layout_rpc: Box = { let (rpc_send, rpc_recv) = channel(); layout_chan.send(Msg::GetRPC(rpc_send)).unwrap(); rpc_recv.recv().unwrap()