diff options
author | bors-servo <metajack+bors@gmail.com> | 2015-02-13 05:33:49 -0700 |
---|---|---|
committer | bors-servo <metajack+bors@gmail.com> | 2015-02-13 05:33:49 -0700 |
commit | 66f4faf44fbc6e8703d4336219a20dd3b19fb493 (patch) | |
tree | c018ce182aeb613f8ab46a2c403abb1340e6defc | |
parent | 11b627704d539122bdf9755644fb5bc0c6a03bb6 (diff) | |
parent | 830e6741c76a5eef85096d0378484d62f70c911a (diff) | |
download | servo-66f4faf44fbc6e8703d4336219a20dd3b19fb493.tar.gz servo-66f4faf44fbc6e8703d4336219a20dd3b19fb493.zip |
auto merge of #4922 : servo/servo/warnings, r=jdm
31 files changed, 115 insertions, 82 deletions
diff --git a/components/canvas/lib.rs b/components/canvas/lib.rs index 3e8350b8c37..af26c94d3ba 100644 --- a/components/canvas/lib.rs +++ b/components/canvas/lib.rs @@ -2,8 +2,9 @@ * 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(core)] + #![allow(missing_copy_implementations)] -#![allow(unstable)] extern crate azure; extern crate geom; diff --git a/components/compositing/compositor.rs b/components/compositing/compositor.rs index 3d1de33be16..3ed89b37604 100644 --- a/components/compositing/compositor.rs +++ b/components/compositing/compositor.rs @@ -1190,9 +1190,9 @@ impl<Window: WindowMethods> IOCompositor<Window> { for y in range(0, height) { let dst_start = y * stride; let src_start = (height - y - 1) * stride; - let src_slice = orig_pixels.slice(src_start, src_start + stride); - copy_memory(pixels.slice_mut(dst_start, dst_start + stride), - src_slice.slice_to(stride)); + let src_slice = &orig_pixels[src_start .. src_start + stride]; + copy_memory(&mut pixels[dst_start .. dst_start + stride], + &src_slice[..stride]); } let mut img = png::Image { width: width as u32, diff --git a/components/compositing/constellation.rs b/components/compositing/constellation.rs index d3a8aa43474..07c1faea6dd 100644 --- a/components/compositing/constellation.rs +++ b/components/compositing/constellation.rs @@ -1084,7 +1084,7 @@ impl<LTF: LayoutTaskFactory, STF: ScriptTaskFactory> Constellation<LTF, STF> { return; // Our message has been discarded, probably shutting down. } - let mut iter = frame_tree.iter(); + let iter = frame_tree.iter(); for frame in iter { frame.has_compositor_layer.set(true); frame.pipeline.borrow().grant_paint_permission(); diff --git a/components/compositing/lib.rs b/components/compositing/lib.rs index 742f4a72d8d..2fcf680cbf4 100644 --- a/components/compositing/lib.rs +++ b/components/compositing/lib.rs @@ -2,8 +2,13 @@ * 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(box_syntax, plugin)] -#![feature(int_uint, core, libc, std_misc)] +#![feature(box_syntax)] +#![feature(core)] +#![feature(int_uint)] +#![feature(io)] +#![feature(libc)] +#![feature(rustc_private)] +#![feature(std_misc)] #![allow(missing_copy_implementations)] diff --git a/components/devtools_traits/lib.rs b/components/devtools_traits/lib.rs index 8a76012099d..349452bc40f 100644 --- a/components/devtools_traits/lib.rs +++ b/components/devtools_traits/lib.rs @@ -10,13 +10,13 @@ #![crate_type = "rlib"] #![feature(int_uint)] +#![feature(rustc_private)] #![allow(non_snake_case)] #![allow(missing_copy_implementations)] -#![allow(unstable)] extern crate msg; -extern crate serialize; +extern crate "serialize" as rustc_serialize; extern crate url; extern crate util; @@ -24,7 +24,7 @@ pub use self::DevtoolsControlMsg::*; pub use self::DevtoolScriptControlMsg::*; pub use self::EvaluateJSReply::*; -use serialize::{Decodable, Decoder}; +use rustc_serialize::{Decodable, Decoder}; use msg::constellation_msg::PipelineId; use util::str::DOMString; use url::Url; @@ -105,7 +105,7 @@ pub enum ScriptDevtoolControlMsg { ReportConsoleMsg(String), } -#[derive(Encodable)] +#[derive(RustcEncodable)] pub struct Modification{ pub attributeName: String, pub newValue: Option<String>, 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<Au>, result: &mut Vec<DisplayItemMetadata>, topmost_only: bool, - mut iterator: I) + iterator: I) where I: Iterator<Item=&'a DisplayItem> { 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<DisplayItem>, - mut display_items: I) + display_items: I) where I: Iterator<Item=&'a DisplayItem> { 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<Arc<StackingContext>>, - mut stacking_contexts: I) + stacking_contexts: I) where I: Iterator<Item=&'a Arc<StackingContext>> { 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, diff --git a/components/msg/compositor_msg.rs b/components/msg/compositor_msg.rs index 111636c349c..54dc125f589 100644 --- a/components/msg/compositor_msg.rs +++ b/components/msg/compositor_msg.rs @@ -8,7 +8,7 @@ use geom::point::Point2D; use geom::rect::Rect; use layers::platform::surface::NativeGraphicsMetadata; use layers::layers::LayerBufferSet; -use std::fmt::{Formatter, Show}; +use std::fmt::{Formatter, Debug}; use std::fmt; use constellation_msg::PipelineId; @@ -20,7 +20,7 @@ pub enum PaintState { Painting, } -#[derive(Eq, Ord, PartialEq, PartialOrd, Clone, Show, Copy)] +#[derive(Eq, Ord, PartialEq, PartialOrd, Clone, Debug, Copy)] pub enum ReadyState { /// Informs the compositor that nothing has been done yet. Used for setting status Blank, @@ -33,7 +33,7 @@ pub enum ReadyState { } /// A newtype struct for denoting the age of messages; prevents race conditions. -#[derive(PartialEq, Eq, Show, Copy)] +#[derive(PartialEq, Eq, Debug, Copy)] pub struct Epoch(pub uint); impl Epoch { @@ -46,7 +46,7 @@ impl Epoch { #[derive(Clone, PartialEq, Eq, Copy)] pub struct LayerId(pub uint, pub uint); -impl Show for LayerId { +impl Debug for LayerId { fn fmt(&self, f: &mut Formatter) -> fmt::Result { let LayerId(a, b) = *self; write!(f, "Layer({}, {})", a, b) diff --git a/components/msg/constellation_msg.rs b/components/msg/constellation_msg.rs index 67449d4d9ec..27a187edfde 100644 --- a/components/msg/constellation_msg.rs +++ b/components/msg/constellation_msg.rs @@ -60,7 +60,7 @@ pub enum KeyState { } //N.B. Based on the glutin key enum -#[derive(Show, PartialEq, Eq, Copy, Clone)] +#[derive(Debug, PartialEq, Eq, Copy, Clone)] pub enum Key { Space, Apostrophe, @@ -237,22 +237,22 @@ impl LoadData { } /// Represents the two different ways to which a page can be navigated -#[derive(Clone, PartialEq, Eq, Copy, Hash, Show)] +#[derive(Clone, PartialEq, Eq, Copy, Hash, Debug)] pub enum NavigationType { Load, // entered or clicked on a url Navigate, // browser forward/back buttons } -#[derive(Clone, PartialEq, Eq, Copy, Hash, Show)] +#[derive(Clone, PartialEq, Eq, Copy, Hash, Debug)] pub enum NavigationDirection { Forward, Back, } -#[derive(Clone, PartialEq, Eq, Copy, Hash, Show)] +#[derive(Clone, PartialEq, Eq, Copy, Hash, Debug)] pub struct PipelineId(pub uint); -#[derive(Clone, PartialEq, Eq, Copy, Hash, Show)] +#[derive(Clone, PartialEq, Eq, Copy, Hash, Debug)] pub struct SubpageId(pub uint); // The type of pipeline exit. During complete shutdowns, pipelines do not have to diff --git a/components/msg/lib.rs b/components/msg/lib.rs index 869b095a882..3fed347b085 100644 --- a/components/msg/lib.rs +++ b/components/msg/lib.rs @@ -2,10 +2,11 @@ * 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(hash)] #![feature(int_uint)] +#![feature(rustc_private)] #![allow(missing_copy_implementations)] -#![allow(unstable)] extern crate azure; #[macro_use] extern crate bitflags; diff --git a/components/net/cookie.rs b/components/net/cookie.rs index 35c5d4dbe73..dfca6912c94 100644 --- a/components/net/cookie.rs +++ b/components/net/cookie.rs @@ -100,7 +100,7 @@ impl Cookie { request_path.chars().filter(|&c| c == '/').count() == 1 { "/".to_owned() } else if request_path.ends_with("/") { - request_path.slice_to(request_path.len()-1).to_owned() + request_path[..request_path.len() - 1].to_owned() } else { request_path.to_owned() } diff --git a/components/net/data_loader.rs b/components/net/data_loader.rs index 987b39568f3..bdaca050477 100644 --- a/components/net/data_loader.rs +++ b/components/net/data_loader.rs @@ -55,7 +55,7 @@ fn load(load_data: LoadData, start_chan: Sender<TargetedLoadResponse>) { let mut ct_str = parts[0]; if ct_str.ends_with(";base64") { is_base64 = true; - ct_str = ct_str.slice_to(ct_str.as_bytes().len() - 7); + ct_str = &ct_str[..ct_str.as_bytes().len() - 7]; } // Parse the content type using rust-http. diff --git a/components/net/http_loader.rs b/components/net/http_loader.rs index b23450c38df..9cb33763866 100644 --- a/components/net/http_loader.rs +++ b/components/net/http_loader.rs @@ -126,7 +126,7 @@ reason: \"certificate verify failed\" }]"; req.headers_mut().set(host); let (tx, rx) = channel(); - cookies_chan.send(ControlMsg::GetCookiesForUrl(url.clone(), tx, CookieSource::HTTP)); + cookies_chan.send(ControlMsg::GetCookiesForUrl(url.clone(), tx, CookieSource::HTTP)).unwrap(); if let Some(cookie_list) = rx.recv().unwrap() { let mut v = Vec::new(); v.push(cookie_list.into_bytes()); @@ -157,7 +157,7 @@ reason: \"certificate verify failed\" }]"; return; } }; - match writer.write(data.as_slice()) { + match writer.write_all(&*data) { Err(e) => { send_error(url, e.desc.to_string(), senders); return; @@ -201,7 +201,7 @@ reason: \"certificate verify failed\" }]"; if let Ok(cookies) = String::from_utf8(cookie.clone()) { cookies_chan.send(ControlMsg::SetCookiesForUrl(url.clone(), cookies, - CookieSource::HTTP)); + CookieSource::HTTP)).unwrap(); } } } diff --git a/components/net/lib.rs b/components/net/lib.rs index 4beb588047c..45a6c4c114e 100644 --- a/components/net/lib.rs +++ b/components/net/lib.rs @@ -2,12 +2,18 @@ * 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(box_syntax)] +#![feature(collections)] +#![feature(core)] +#![feature(env)] #![feature(int_uint)] +#![feature(io)] +#![feature(path)] +#![feature(rustc_private)] +#![feature(std_misc)] #![feature(unboxed_closures)] -#![feature(box_syntax)] #![allow(missing_copy_implementations)] -#![allow(unstable)] extern crate "cookie" as cookie_rs; extern crate collections; diff --git a/components/net/resource_task.rs b/components/net/resource_task.rs index b8c7190ebd9..c6f6414f125 100644 --- a/components/net/resource_task.rs +++ b/components/net/resource_task.rs @@ -23,12 +23,12 @@ use hyper::mime::{Mime, Attr}; use url::Url; use std::borrow::{ToOwned, IntoCow}; -use std::sync::mpsc::{channel, Receiver, Sender}; -use std::thunk::Invoke; use std::collections::HashMap; -use std::old_io::{BufferedReader, File}; +use std::env; use std::mem; -use std::os; +use std::old_io::{BufferedReader, File}; +use std::sync::mpsc::{channel, Receiver, Sender}; +use std::thunk::Invoke; #[cfg(test)] use std::old_io::{Listener, Acceptor, TimedOut}; @@ -38,7 +38,7 @@ use std::old_io::net::tcp::TcpListener; static mut HOST_TABLE: Option<*mut HashMap<String, String>> = None; pub fn global_init() { - if let Some(host_file_path) = os::getenv("HOST_FILE") { + if let Ok(host_file_path) = env::var_string("HOST_FILE") { //TODO: handle bad file path and corrupted file let path = Path::new(host_file_path); let mut file = BufferedReader::new(File::open(&path)); @@ -291,7 +291,7 @@ impl ResourceManager { } } ControlMsg::GetCookiesForUrl(url, consumer, source) => { - consumer.send(self.cookie_storage.cookies_for_url(&url, source)); + consumer.send(self.cookie_storage.cookies_for_url(&url, source)).unwrap(); } ControlMsg::Exit => { break diff --git a/components/script_traits/lib.rs b/components/script_traits/lib.rs index 895f290da2b..8b5f509544c 100644 --- a/components/script_traits/lib.rs +++ b/components/script_traits/lib.rs @@ -2,10 +2,12 @@ * 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(core)] #![feature(int_uint)] +#![feature(libc)] +#![feature(rustc_private)] #![allow(missing_copy_implementations)] -#![allow(unstable)] extern crate devtools_traits; extern crate geom; diff --git a/components/util/debug_utils.rs b/components/util/debug_utils.rs index 1eaa5085c8b..8d9789de029 100644 --- a/components/util/debug_utils.rs +++ b/components/util/debug_utils.rs @@ -10,25 +10,25 @@ use std::slice; fn hexdump_slice(buf: &[u8]) { let mut stderr = io::stderr(); - stderr.write(b" ").unwrap(); + stderr.write_all(b" ").unwrap(); for (i, &v) in buf.iter().enumerate() { let output = format!("{:02X} ", v as uint); - stderr.write(output.as_bytes()).unwrap(); + stderr.write_all(output.as_bytes()).unwrap(); match i % 16 { - 15 => { stderr.write(b"\n ").unwrap(); }, - 7 => { stderr.write(b" ").unwrap(); }, + 15 => { stderr.write_all(b"\n ").unwrap(); }, + 7 => { stderr.write_all(b" ").unwrap(); }, _ => () } stderr.flush().unwrap(); } - stderr.write(b"\n").unwrap(); + stderr.write_all(b"\n").unwrap(); } pub fn hexdump<T>(obj: &T) { unsafe { let buf: *const u8 = mem::transmute(obj); debug!("dumping at {:p}", buf); - let from_buf = slice::from_raw_buf(&buf, size_of::<T>()); + let from_buf = slice::from_raw_parts(buf, size_of::<T>()); hexdump_slice(from_buf); } } diff --git a/components/util/deque/mod.rs b/components/util/deque/mod.rs index 04d8ab76f39..6dce728679b 100644 --- a/components/util/deque/mod.rs +++ b/components/util/deque/mod.rs @@ -42,8 +42,6 @@ //! let mut stealer2 = stealer.clone(); //! stealer2.steal(); -#![experimental] - // NB: the "buffer pool" strategy is not done for speed, but rather for // correctness. For more info, see the comment on `swap_buffer` diff --git a/components/util/lib.rs b/components/util/lib.rs index 045760a037d..36b61f6ed6a 100644 --- a/components/util/lib.rs +++ b/components/util/lib.rs @@ -2,16 +2,24 @@ * 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)] -#![feature(plugin)] -#![feature(int_uint)] +#![feature(alloc)] #![feature(box_syntax)] +#![feature(collections)] +#![feature(core)] +#![feature(env)] +#![feature(hash)] +#![feature(int_uint)] +#![feature(io)] +#![feature(libc)] #![feature(optin_builtin_traits)] -#![feature(core, rustc_private, hash, alloc)] -#![feature(collections, libc, std_misc)] +#![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/util/memory.rs b/components/util/memory.rs index 566b6ad3590..d52500b62a3 100644 --- a/components/util/memory.rs +++ b/components/util/memory.rs @@ -13,7 +13,7 @@ use std::old_io::File; use std::mem; use std::mem::size_of; #[cfg(target_os="linux")] -use std::os::page_size; +use std::env::page_size; use std::ptr::null_mut; use std::sync::mpsc::{Sender, channel, Receiver}; use std::time::duration::Duration; diff --git a/components/util/opts.rs b/components/util/opts.rs index 26f0651580f..aeee40ac249 100644 --- a/components/util/opts.rs +++ b/components/util/opts.rs @@ -13,9 +13,9 @@ use layers::geometry::DevicePixel; use getopts; use std::collections::HashSet; use std::cmp; +use std::env; use std::old_io as io; use std::mem; -use std::os; use std::ptr; use std::rt; @@ -137,7 +137,7 @@ pub fn print_debug_usage(app: &str) { fn args_fail(msg: &str) { io::stderr().write_line(msg).unwrap(); - os::set_exit_status(1); + env::set_exit_status(1); } // Always use CPU painting on android. diff --git a/components/util/resource_files.rs b/components/util/resource_files.rs index 2df0d059d95..c1defd887f0 100644 --- a/components/util/resource_files.rs +++ b/components/util/resource_files.rs @@ -5,14 +5,6 @@ use std::old_io::{File, IoResult}; use std::old_path::Path; -#[cfg(not(target_os = "android"))] -use opts; - -#[cfg(not(target_os = "android"))] -use std::old_io::fs::PathExtensions; -#[cfg(not(target_os = "android"))] -use std::os; - #[cfg(target_os = "android")] pub fn resources_dir_path() -> Path { Path::new("/sdcard/servo/") @@ -20,13 +12,18 @@ pub fn resources_dir_path() -> Path { #[cfg(not(target_os = "android"))] pub fn resources_dir_path() -> Path { + use opts; + use std::env; + use std::old_io::fs::PathExtensions; + match opts::get().resources_path { Some(ref path) => Path::new(path), None => { // FIXME: Find a way to not rely on the executable being // under `<servo source>/components/servo/target` // or `<servo source>/components/servo/target/release`. - let mut path = os::self_exe_path().expect("can't get exe path"); + let mut path = env::current_exe().ok().expect("can't get exe path"); + path.pop(); path.pop(); path.pop(); path.pop(); diff --git a/components/util/smallvec.rs b/components/util/smallvec.rs index 1707c0a6eba..14d983376e8 100644 --- a/components/util/smallvec.rs +++ b/components/util/smallvec.rs @@ -44,7 +44,7 @@ impl<T> VecLike<T> for Vec<T> { #[inline] fn vec_slice_mut<'a>(&'a mut self, start: uint, end: uint) -> &'a mut [T] { - self.slice_mut(start, end) + &mut self[start..end] } } @@ -410,7 +410,7 @@ macro_rules! def_small_vector( } impl<T> FromIterator<T> for $name<T> { - fn from_iter<I: Iterator<Item=T>>(mut iter: I) -> $name<T> { + fn from_iter<I: Iterator<Item=T>>(iter: I) -> $name<T> { let mut v = $name::new(); let (lower_size_bound, _) = iter.size_hint(); @@ -428,7 +428,7 @@ macro_rules! def_small_vector( } impl<T> $name<T> { - pub fn extend<I: Iterator<Item=T>>(&mut self, mut iter: I) { + pub fn extend<I: Iterator<Item=T>>(&mut self, iter: I) { let (lower_size_bound, _) = iter.size_hint(); let target_len = self.len() + lower_size_bound; diff --git a/components/util/str.rs b/components/util/str.rs index 4b785de0a3b..80cdd1ae230 100644 --- a/components/util/str.rs +++ b/components/util/str.rs @@ -273,7 +273,7 @@ pub fn parse_legacy_color(mut input: &str) -> Result<RGBA,()> { // Step 12. let mut length = input.len() / 3; - let (mut red, mut green, mut blue) = (input.slice_to(length), + let (mut red, mut green, mut blue) = (&input[..length], &input[length..length * 2], &input[length * 2..]); diff --git a/components/util/tid.rs b/components/util/tid.rs index e52dbf7fd61..7351f85f085 100644 --- a/components/util/tid.rs +++ b/components/util/tid.rs @@ -2,11 +2,11 @@ * 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/. */ -use std::sync::atomic::{AtomicUint, ATOMIC_UINT_INIT, Ordering}; +use std::sync::atomic::{AtomicUsize, ATOMIC_USIZE_INIT, Ordering}; use std::rc::Rc; use std::cell::RefCell; -static mut next_tid: AtomicUint = ATOMIC_UINT_INIT; +static mut next_tid: AtomicUsize = ATOMIC_USIZE_INIT; thread_local!(static TASK_LOCAL_TID: Rc<RefCell<Option<uint>>> = Rc::new(RefCell::new(None))); diff --git a/ports/glutin/lib.rs b/ports/glutin/lib.rs index 824b151bb8b..4ac0a2c18aa 100644 --- a/ports/glutin/lib.rs +++ b/ports/glutin/lib.rs @@ -4,8 +4,11 @@ //! A simple application that uses glutin to open a window for Servo to display in. -#![feature(box_syntax, int_uint)] -#![allow(unstable)] +#![feature(int_uint)] +#![feature(core)] +#![feature(hash)] +#![feature(box_syntax)] +#![feature(libc)] #[macro_use] extern crate bitflags; #[cfg(target_os="macos")] diff --git a/ports/glutin/window.rs b/ports/glutin/window.rs index c7707108b48..8fe2f02599b 100644 --- a/ports/glutin/window.rs +++ b/ports/glutin/window.rs @@ -47,7 +47,7 @@ static mut g_nested_event_loop_listener: Option<*mut (NestedEventLoopListener + #[cfg(feature = "window")] bitflags! { - #[derive(Show)] + #[derive(Debug)] flags KeyModifiers: u8 { const LEFT_CONTROL = 1, const RIGHT_CONTROL = 2, |