From e9982dc68680e76dc472c2135c6152e8775b457f Mon Sep 17 00:00:00 2001
From: Jeremy Soller <jackpot51@gmail.com>
Date: Sun, 20 Mar 2016 20:44:15 -0600
Subject: [PATCH] Update rust, update submodules, get libextra

---
 Makefile                           | 11 ++++++-----
 crates/extra                       |  2 +-
 kernel/main.rs                     |  1 -
 kernel/network/ethernet.rs         |  2 +-
 kernel/network/ipv4.rs             |  4 ++--
 kernel/syscall/execute.rs          |  2 +-
 libstd/src/collections/hash_map.rs |  1 -
 libstd/src/ffi/os_str.rs           |  5 +++--
 libstd/src/lib.rs                  |  2 --
 libstd/src/path.rs                 | 18 +-----------------
 rust                               |  2 +-
 11 files changed, 16 insertions(+), 34 deletions(-)

diff --git a/Makefile b/Makefile
index a2976ea..fae7053 100644
--- a/Makefile
+++ b/Makefile
@@ -188,13 +188,11 @@ coreutils: \
 	filesystem/bin/shutdown \
 	filesystem/bin/sleep \
 	filesystem/bin/tail \
-	filesystem/bin/test \
 	filesystem/bin/touch \
 	filesystem/bin/true \
 	filesystem/bin/wc \
 	filesystem/bin/yes
-	#TODO: filesystem/bin/env
-
+	#TODO: filesystem/bin/env filesystem/bin/test
 
 $(BUILD)/libbinutils.rlib: crates/binutils/src/lib.rs crates/binutils/src/*.rs $(BUILD)/libextra.rlib
 	$(RUSTC) $(RUSTCFLAGS) --crate-name binutils --crate-type lib -o $@ $<
@@ -255,6 +253,10 @@ filesystem/bin/launcher: crates/orbutils/src/launcher/main.rs crates/orbutils/sr
 	mkdir -p filesystem/bin
 	$(RUSTC) $(RUSTCFLAGS) --crate-type bin -o $@ $<
 
+filesystem/bin/zfs: crates/zfs/src/main.rs crates/zfs/src/*.rs $(BUILD)/crt0.o $(BUILD)/libstd.rlib
+	mkdir -p filesystem/bin
+	$(RUSTC) $(RUSTCFLAGS) --crate-type bin -o $@ $<
+
 bins: \
 	coreutils \
 	extrautils \
@@ -277,8 +279,7 @@ bins: \
   	filesystem/bin/sdl-ttf-test \
   	filesystem/bin/sh \
 	filesystem/bin/tar \
-	filesystem/bin/zfs
-	#TODO: binutils
+	#TODO: binutils	filesystem/bin/zfs
 
 initfs/redoxfsd: crates/redoxfs/scheme/main.rs crates/redoxfs/scheme/*.rs $(BUILD)/crt0.o $(BUILD)/libstd.rlib $(BUILD)/libredoxfs.rlib
 	mkdir -p initfs/
diff --git a/crates/extra b/crates/extra
index dd01a09..8f60539 160000
--- a/crates/extra
+++ b/crates/extra
@@ -1 +1 @@
-Subproject commit dd01a09283df73e8e62a6fa59ede41897459dcbd
+Subproject commit 8f605399ba0cd8a266669995ca6ca634c0ae162a
diff --git a/kernel/main.rs b/kernel/main.rs
index 0100160..599ba13 100644
--- a/kernel/main.rs
+++ b/kernel/main.rs
@@ -16,7 +16,6 @@
 #![feature(unboxed_closures)]
 #![feature(unsafe_no_drop_flag)]
 #![feature(unwind_attributes)]
-#![feature(vec_push_all)]
 #![feature(zero_one)]
 #![feature(collections_range)]
 #![no_std]
diff --git a/kernel/network/ethernet.rs b/kernel/network/ethernet.rs
index 4e76157..e477c5e 100644
--- a/kernel/network/ethernet.rs
+++ b/kernel/network/ethernet.rs
@@ -40,7 +40,7 @@ impl ToBytes for EthernetII {
             let header_ptr: *const EthernetIIHeader = &self.header;
             let mut ret = Vec::from(slice::from_raw_parts(header_ptr as *const u8,
                                                           mem::size_of::<EthernetIIHeader>()));
-            ret.push_all(&self.data);
+            ret.extend_from_slice(&self.data);
             ret
         }
     }
diff --git a/kernel/network/ipv4.rs b/kernel/network/ipv4.rs
index aaea629..8f30ccc 100644
--- a/kernel/network/ipv4.rs
+++ b/kernel/network/ipv4.rs
@@ -52,8 +52,8 @@ impl ToBytes for Ipv4 {
             let header_ptr: *const Ipv4Header = &self.header;
             let mut ret = Vec::<u8>::from(slice::from_raw_parts(header_ptr as *const u8,
                                                                 mem::size_of::<Ipv4Header>()));
-            ret.push_all(&self.options);
-            ret.push_all(&self.data);
+            ret.extend_from_slice(&self.options);
+            ret.extend_from_slice(&self.data);
             ret
         }
     }
diff --git a/kernel/syscall/execute.rs b/kernel/syscall/execute.rs
index 28b04a6..194d0d1 100644
--- a/kernel/syscall/execute.rs
+++ b/kernel/syscall/execute.rs
@@ -133,7 +133,7 @@ pub fn execute(mut args: Vec<String>) -> Result<usize> {
             let mut bytes = [0; 4096];
             match resource.read(&mut bytes) {
                 Ok(0) => break 'reading,
-                Ok(count) => vec.push_all(bytes.get_slice(.. count)),
+                Ok(count) => vec.extend_from_slice(bytes.get_slice(.. count)),
                 Err(err) => return Err(err)
             }
         }
diff --git a/libstd/src/collections/hash_map.rs b/libstd/src/collections/hash_map.rs
index 3dfab86..cf79100 100644
--- a/libstd/src/collections/hash_map.rs
+++ b/libstd/src/collections/hash_map.rs
@@ -33,7 +33,6 @@ mod raw_table {
     use marker;
     use mem::{align_of, size_of};
     use mem;
-    use num::wrapping::OverflowingOps;
     use ops::{Deref, DerefMut};
     use ptr::{self, Unique};
     use super::super::hash_state::HashState;
diff --git a/libstd/src/ffi/os_str.rs b/libstd/src/ffi/os_str.rs
index 2d939e2..d8034a2 100644
--- a/libstd/src/ffi/os_str.rs
+++ b/libstd/src/ffi/os_str.rs
@@ -8,7 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
-use borrow::{Borrow, Cow, IntoCow, ToOwned};
+use borrow::{Borrow, Cow, ToOwned};
+use convert::Into;
 use fmt::{self, Debug};
 use mem;
 use string::String;
@@ -245,7 +246,7 @@ impl OsStr {
     /// Any non-Unicode sequences are replaced with U+FFFD REPLACEMENT CHARACTER.
 
     pub fn to_string_lossy(&self) -> Cow<str> {
-        self.inner.into_cow()
+        self.inner.into()
     }
 
     /// Copies the slice into an owned `OsString`.
diff --git a/libstd/src/lib.rs b/libstd/src/lib.rs
index 4b5d121..e667e5c 100644
--- a/libstd/src/lib.rs
+++ b/libstd/src/lib.rs
@@ -24,10 +24,8 @@
 #![feature(filling_drop)]
 #![feature(heap_api)]
 #![feature(int_error_internals)]
-#![feature(into_cow)]
 #![feature(lang_items)]
 #![feature(macro_reexport)]
-#![feature(old_wrapping)]
 #![feature(oom)]
 #![feature(prelude_import)]
 #![feature(rand)]
diff --git a/libstd/src/path.rs b/libstd/src/path.rs
index 16f7874..a7cffb6 100644
--- a/libstd/src/path.rs
+++ b/libstd/src/path.rs
@@ -101,7 +101,7 @@
 
 use ascii::*;
 #[allow(deprecated)]
-use borrow::{Borrow, IntoCow, ToOwned, Cow};
+use borrow::{Borrow, ToOwned, Cow};
 use cmp;
 use error::Error;
 use fmt;
@@ -1215,22 +1215,6 @@ impl Borrow<Path> for PathBuf {
 }
 
 
-#[allow(deprecated)]
-impl IntoCow<'static, Path> for PathBuf {
-    fn into_cow(self) -> Cow<'static, Path> {
-        Cow::Owned(self)
-    }
-}
-
-
-#[allow(deprecated)]
-impl<'a> IntoCow<'a, Path> for &'a Path {
-    fn into_cow(self) -> Cow<'a, Path> {
-        Cow::Borrowed(self)
-    }
-}
-
-
 impl<'a> From<&'a Path> for Cow<'a, Path> {
     #[inline]
     fn from(s: &'a Path) -> Cow<'a, Path> {
diff --git a/rust b/rust
index e55dd31..3791e34 160000
--- a/rust
+++ b/rust
@@ -1 +1 @@
-Subproject commit e55dd318c102819cbd00771fd4a3660eec041a67
+Subproject commit 3791e34cd3f2f6936f8beb9095ca6d9024d0bb16
