diff --git a/components/util/lib.rs b/components/util/lib.rs index 6cebd0155a5..094bd292897 100644 --- a/components/util/lib.rs +++ b/components/util/lib.rs @@ -6,15 +6,20 @@ #![feature(box_syntax)] #![feature(collections)] #![feature(core)] -#![feature(env)] +#![feature(exit_status)] #![feature(hash)] #![feature(int_uint)] #![feature(io)] #![feature(optin_builtin_traits)] +#![feature(old_io)] +#![feature(old_path)] +#![feature(page_size)] #![feature(path)] +#![feature(path_ext)] #![feature(plugin)] #![feature(rustc_private)] #![feature(std_misc)] +#![feature(str_words)] #![feature(unicode)] #![feature(unsafe_destructor)] diff --git a/components/util/memory.rs b/components/util/memory.rs index 6c9f38c6141..4bc44b332c3 100644 --- a/components/util/memory.rs +++ b/components/util/memory.rs @@ -451,12 +451,12 @@ fn get_jemalloc_stat(value_name: &str) -> Option { // request. Without that jemalloc gives cached statistics(!) which can be // highly inaccurate. let epoch_name = "epoch"; - let epoch_c_name = CString::from_slice(epoch_name.as_bytes()); + let epoch_c_name = CString::new(epoch_name).unwrap(); let mut epoch: u64 = 0; let epoch_ptr = &mut epoch as *mut _ as *mut c_void; let mut epoch_len = size_of::() as size_t; - let value_c_name = CString::from_slice(value_name.as_bytes()); + let value_c_name = CString::new(value_name).unwrap(); let mut value: size_t = 0; let value_ptr = &mut value as *mut _ as *mut c_void; let mut value_len = size_of::() as size_t; diff --git a/components/util/str.rs b/components/util/str.rs index bc193002ff1..f4e3badab15 100644 --- a/components/util/str.rs +++ b/components/util/str.rs @@ -9,10 +9,10 @@ use cssparser::{self, RGBA, Color}; use libc::c_char; use std::ascii::AsciiExt; use std::borrow::ToOwned; -use std::ffi::c_str_to_bytes; +use std::ffi::CStr; use std::iter::Filter; use std::num::{Int, ToPrimitive}; -use std::str::{from_utf8, CharEq, FromStr, Split}; +use std::str::{from_utf8, FromStr, Split}; pub type DOMString = String; pub type StaticCharVec = &'static [char]; @@ -333,5 +333,5 @@ impl Str for LowercaseString { /// Creates a String from the given null-terminated buffer. /// Panics if the buffer does not contain UTF-8. pub unsafe fn c_str_to_string(s: *const c_char) -> String { - from_utf8(c_str_to_bytes(&s)).unwrap().to_owned() + from_utf8(CStr::from_ptr(s).to_bytes()).unwrap().to_owned() } diff --git a/components/util/task.rs b/components/util/task.rs index 88acbd65e09..97770269259 100644 --- a/components/util/task.rs +++ b/components/util/task.rs @@ -14,7 +14,7 @@ pub fn spawn_named(name: String, f: F) let builder = thread::Builder::new().name(name); builder.spawn(move || { f() - }); + }).unwrap(); } /// Arrange to send a particular message to a channel if the task fails. @@ -40,7 +40,7 @@ pub fn spawn_named_with_send_on_failure(name: &'static str, dest.send(msg).unwrap(); } } - }); + }).unwrap(); } #[test]