about summary refs log tree commit diff
path: root/src/librustrt
diff options
context:
space:
mode:
Diffstat (limited to 'src/librustrt')
-rw-r--r--src/librustrt/c_str.rs17
-rw-r--r--src/librustrt/lib.rs2
-rw-r--r--src/librustrt/rtio.rs2
3 files changed, 19 insertions, 2 deletions
diff --git a/src/librustrt/c_str.rs b/src/librustrt/c_str.rs
index 06f4e71871d..396d51f4fcb 100644
--- a/src/librustrt/c_str.rs
+++ b/src/librustrt/c_str.rs
@@ -69,6 +69,7 @@ use core::prelude::*;
 
 use alloc::libc_heap::malloc_raw;
 use collections::string::String;
+use collections::hash;
 use core::kinds::marker;
 use core::mem;
 use core::ptr;
@@ -116,6 +117,22 @@ impl PartialEq for CString {
     }
 }
 
+impl PartialOrd for CString {
+    #[inline]
+    fn partial_cmp(&self, other: &CString) -> Option<Ordering> {
+        self.as_bytes().partial_cmp(&other.as_bytes())
+    }
+}
+
+impl Eq for CString {}
+
+impl<S: hash::Writer> hash::Hash<S> for CString {
+    #[inline]
+    fn hash(&self, state: &mut S) {
+        self.as_bytes().hash(state)
+    }
+}
+
 impl CString {
     /// Create a C String from a pointer.
     pub unsafe fn new(buf: *const libc::c_char, owns_buffer: bool) -> CString {
diff --git a/src/librustrt/lib.rs b/src/librustrt/lib.rs
index b707c62bb70..c830b2e122e 100644
--- a/src/librustrt/lib.rs
+++ b/src/librustrt/lib.rs
@@ -17,7 +17,7 @@
        html_root_url = "http://doc.rust-lang.org/0.11.0/")]
 
 #![feature(macro_rules, phase, globs, thread_local, managed_boxes, asm)]
-#![feature(linkage, lang_items, unsafe_destructor)]
+#![feature(linkage, lang_items, unsafe_destructor, default_type_params)]
 #![no_std]
 #![experimental]
 
diff --git a/src/librustrt/rtio.rs b/src/librustrt/rtio.rs
index 0205f2405f9..7a91cca6265 100644
--- a/src/librustrt/rtio.rs
+++ b/src/librustrt/rtio.rs
@@ -75,7 +75,7 @@ pub struct ProcessConfig<'a> {
 
     /// Optional environment to specify for the program. If this is None, then
     /// it will inherit the current process's environment.
-    pub env: Option<&'a [(CString, CString)]>,
+    pub env: Option<&'a [(&'a CString, &'a CString)]>,
 
     /// Optional working directory for the new process. If this is None, then
     /// the current directory of the running process is inherited.