]> git.lizzy.rs Git - rust.git/blobdiff - src/libstd/sys/unix/process.rs
Replace `0 as *const/mut T` with `ptr::null/null_mut()`
[rust.git] / src / libstd / sys / unix / process.rs
index 1357bbdd5a3710dfb8fb7e3e126909ffdafc71f3..0eab27de43a9f08e995a56e4ad25d555f670d127 100644 (file)
@@ -11,7 +11,8 @@
 use prelude::v1::*;
 use self::Req::*;
 
-use collections;
+use collections::HashMap;
+use collections::hash_map::Hasher;
 use ffi::CString;
 use hash::Hash;
 use io::process::{ProcessExit, ExitStatus, ExitSignal};
@@ -60,7 +61,7 @@ pub fn spawn<K, V, C, P>(cfg: &C, in_fd: Option<P>,
                               out_fd: Option<P>, err_fd: Option<P>)
                               -> IoResult<Process>
         where C: ProcessConfig<K, V>, P: AsInner<FileDesc>,
-              K: BytesContainer + Eq + Hash, V: BytesContainer
+              K: BytesContainer + Eq + Hash<Hasher>, V: BytesContainer
     {
         use libc::funcs::posix88::unistd::{fork, dup2, close, chdir, execvp};
         use libc::funcs::bsd44::getdtablesize;
@@ -250,7 +251,7 @@ fn fail(output: &mut FileDesc) -> ! {
                             fn setgroups(ngroups: libc::c_int,
                                          ptr: *const libc::c_void) -> libc::c_int;
                         }
-                        let _ = setgroups(0, 0 as *const libc::c_void);
+                        let _ = setgroups(0, ptr::null());
 
                         if libc::setuid(u as libc::uid_t) != 0 {
                             fail(&mut output);
@@ -553,11 +554,11 @@ fn with_argv<T,F>(prog: &CString, args: &[CString],
     cb(ptrs.as_ptr())
 }
 
-fn with_envp<K,V,T,F>(env: Option<&collections::HashMap<K, V>>,
+fn with_envp<K,V,T,F>(env: Option<&HashMap<K, V>>,
                       cb: F)
                       -> T
     where F : FnOnce(*const c_void) -> T,
-          K : BytesContainer + Eq + Hash,
+          K : BytesContainer + Eq + Hash<Hasher>,
           V : BytesContainer
 {
     // On posixy systems we can pass a char** for envp, which is a