diff --git a/components/gfx/display_list/mod.rs b/components/gfx/display_list/mod.rs index 2b5b8707780..99a7cc5fe0c 100644 --- a/components/gfx/display_list/mod.rs +++ b/components/gfx/display_list/mod.rs @@ -353,7 +353,7 @@ impl StackingContext { fn hit_test_in_list<'a,I>(point: Point2D, result: &mut Vec, topmost_only: bool, - mut iterator: I) + iterator: I) where I: Iterator { for item in iterator { // TODO(pcwalton): Use a precise algorithm here. This will allow us to properly hit diff --git a/components/gfx/display_list/optimizer.rs b/components/gfx/display_list/optimizer.rs index 485cc1816a6..f14ff8a74a8 100644 --- a/components/gfx/display_list/optimizer.rs +++ b/components/gfx/display_list/optimizer.rs @@ -43,7 +43,7 @@ impl DisplayListOptimizer { /// Adds display items that intersect the visible rect to `result_list`. fn add_in_bounds_display_items<'a,I>(&self, result_list: &mut DList, - mut display_items: I) + display_items: I) where I: Iterator { for display_item in display_items { if self.visible_rect.intersects(&display_item.base().bounds) && @@ -56,7 +56,7 @@ impl DisplayListOptimizer { /// Adds child stacking contexts whose boundaries intersect the visible rect to `result_list`. fn add_in_bounds_stacking_contexts<'a,I>(&self, result_list: &mut DList>, - mut stacking_contexts: I) + stacking_contexts: I) where I: Iterator> { for stacking_context in stacking_contexts { let overflow = stacking_context.overflow.translate(&stacking_context.bounds.origin); diff --git a/components/gfx/font.rs b/components/gfx/font.rs index 0e676b6f3e3..21ab30ca0af 100644 --- a/components/gfx/font.rs +++ b/components/gfx/font.rs @@ -58,7 +58,7 @@ impl FontTableTagConversions for FontTableTag { fn tag_to_str(&self) -> String { unsafe { let pointer = mem::transmute::<&u32, *const u8>(self); - let mut bytes = slice::from_raw_buf(&pointer, 4).to_vec(); + let mut bytes = slice::from_raw_parts(pointer, 4).to_vec(); bytes.reverse(); String::from_utf8_unchecked(bytes) } diff --git a/components/gfx/lib.rs b/components/gfx/lib.rs index 8274da13714..5ccf043d3b7 100644 --- a/components/gfx/lib.rs +++ b/components/gfx/lib.rs @@ -2,10 +2,22 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ -#![feature(unsafe_destructor, int_uint, plugin, box_syntax)] +#![feature(alloc)] +#![feature(box_syntax)] +#![feature(collections)] +#![feature(core)] +#![feature(hash)] +#![feature(int_uint)] +#![feature(io)] +#![feature(libc)] +#![feature(path)] +#![feature(plugin)] +#![feature(rustc_private)] +#![feature(std_misc)] +#![feature(unicode)] +#![feature(unsafe_destructor)] #![allow(missing_copy_implementations)] -#![allow(unstable)] #[macro_use] extern crate log; diff --git a/components/gfx/text/glyph.rs b/components/gfx/text/glyph.rs index 1389be3fa62..7341036e6d3 100644 --- a/components/gfx/text/glyph.rs +++ b/components/gfx/text/glyph.rs @@ -345,7 +345,7 @@ impl<'a> DetailedGlyphStore { // FIXME: Is this right? --pcwalton // TODO: should fix this somewhere else if count == 0 { - return self.detail_buffer.slice(0, 0); + return &self.detail_buffer[0..0]; } assert!((count as uint) <= self.detail_buffer.len()); @@ -361,7 +361,7 @@ impl<'a> DetailedGlyphStore { assert!(i + (count as uint) <= self.detail_buffer.len()); // return a slice into the buffer - self.detail_buffer.slice(i, i + count as uint) + &self.detail_buffer[i .. i + count as uint] } fn get_detailed_glyph_with_index(&'a self, diff --git a/components/gfx/text/text_run.rs b/components/gfx/text/text_run.rs index 20429079c7e..9c28462411e 100644 --- a/components/gfx/text/text_run.rs +++ b/components/gfx/text/text_run.rs @@ -231,7 +231,7 @@ impl<'a> TextRun { // Create a glyph store for this slice if it's nonempty. if can_break_before && byte_i > byte_last_boundary { - let slice = text.slice(byte_last_boundary, byte_i); + let slice = &text[byte_last_boundary .. byte_i]; debug!("creating glyph store for slice {} (ws? {}), {} - {} in run {}", slice, !cur_slice_is_whitespace, byte_last_boundary, byte_i, text); @@ -254,7 +254,7 @@ impl<'a> TextRun { // Create a glyph store for the final slice if it's nonempty. if byte_i > byte_last_boundary { - let slice = text.slice_from(byte_last_boundary); + let slice = &text[byte_last_boundary..]; debug!("creating glyph store for final slice {} (ws? {}), {} - {} in run {}", slice, cur_slice_is_whitespace, byte_last_boundary, text.len(), text); @@ -343,7 +343,7 @@ impl<'a> TextRun { Some(index) => index, }; NaturalWordSliceIterator { - glyph_iter: self.glyphs.slice_from(index).iter(), + glyph_iter: self.glyphs[index..].iter(), range: *range, } } @@ -356,7 +356,7 @@ impl<'a> TextRun { None => self.glyphs.len(), Some(index) => index, }; - let mut glyph_run_iter = self.glyphs.slice_from(index).iter(); + let mut glyph_run_iter = self.glyphs[index..].iter(); let first_glyph_run = glyph_run_iter.next(); CharacterSliceIterator { glyph_run: first_glyph_run,