diff --git a/components/layout/block.rs b/components/layout/block.rs index 231f406d25a..abaa80a06ab 100644 --- a/components/layout/block.rs +++ b/components/layout/block.rs @@ -1869,11 +1869,11 @@ impl Flow for BlockFlow { self.fragment.border_box - self.fragment.style().logical_border_width() } - fn layer_id(&self, fragment_index: uint) -> LayerId { + fn layer_id(&self, fragment_index: u32) -> LayerId { // FIXME(#2010, pcwalton): This is a hack and is totally bogus in the presence of pseudo- // elements. But until we have incremental reflow we can't do better--we recreate the flow // for every DOM node so otherwise we nuke layers on every reflow. - LayerId(self.fragment.node.id() as uint, fragment_index) + LayerId(self.fragment.node.id() as usize, fragment_index) } fn is_absolute_containing_block(&self) -> bool { diff --git a/components/layout/flow.rs b/components/layout/flow.rs index 46b69e2deaa..2840f071411 100644 --- a/components/layout/flow.rs +++ b/components/layout/flow.rs @@ -311,12 +311,9 @@ pub trait Flow: fmt::Debug + Sync { /// Returns a layer ID for the given fragment. #[allow(unsafe_code)] - fn layer_id(&self, fragment_id: uint) -> LayerId { - unsafe { - let obj = mem::transmute::<&&Self, &raw::TraitObject>(&self); - let pointer: uint = mem::transmute(obj.data); - LayerId(pointer, fragment_id) - } + fn layer_id(&self, fragment_id: u32) -> LayerId { + let obj = unsafe { mem::transmute::<&&Self, &raw::TraitObject>(&self) }; + LayerId(obj.data as usize, fragment_id) } /// Attempts to perform incremental fixup of this flow by replacing its fragment's style with diff --git a/components/msg/compositor_msg.rs b/components/msg/compositor_msg.rs index c51a0df6a0c..d306af649a9 100644 --- a/components/msg/compositor_msg.rs +++ b/components/msg/compositor_msg.rs @@ -44,7 +44,7 @@ impl Epoch { } #[derive(Clone, PartialEq, Eq, Copy)] -pub struct LayerId(pub uint, pub uint); +pub struct LayerId(pub usize, pub u32); impl Debug for LayerId { fn fmt(&self, f: &mut Formatter) -> fmt::Result {