about summary refs log tree commit diff
path: root/src/libstd/sys
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2017-07-14 00:50:33 +0000
committerbors <bors@rust-lang.org>2017-07-14 00:50:33 +0000
commitab91c70cc69450bc69b76df0fd2faa82bda42d6b (patch)
treed79dcef1bcd5099dfe9617ac181dcbbc0baba97b /src/libstd/sys
parentb2c0707872082c890f332178f59fd02eea5b98f3 (diff)
parentda3f5b80ed8a0fb88aae2d2a462acc97b05ba911 (diff)
downloadrust-ab91c70cc69450bc69b76df0fd2faa82bda42d6b.tar.gz
rust-ab91c70cc69450bc69b76df0fd2faa82bda42d6b.zip
Auto merge of #43216 - steveklabnik:rollup, r=steveklabnik
Rollup of 7 pull requests

- Successful merges: #42926, #43125, #43157, #43167, #43187, #43203, #43204
- Failed merges:
Diffstat (limited to 'src/libstd/sys')
-rw-r--r--src/libstd/sys/redox/fs.rs7
-rw-r--r--src/libstd/sys/redox/mod.rs20
2 files changed, 5 insertions, 22 deletions
diff --git a/src/libstd/sys/redox/fs.rs b/src/libstd/sys/redox/fs.rs
index 87e50c40148..918893097f8 100644
--- a/src/libstd/sys/redox/fs.rs
+++ b/src/libstd/sys/redox/fs.rs
@@ -383,9 +383,10 @@ pub fn unlink(p: &Path) -> io::Result<()> {
     Ok(())
 }
 
-pub fn rename(_old: &Path, _new: &Path) -> io::Result<()> {
-    ::sys_common::util::dumb_print(format_args!("Rename\n"));
-    unimplemented!();
+pub fn rename(old: &Path, new: &Path) -> io::Result<()> {
+    copy(old, new)?;
+    unlink(old)?;
+    Ok(())
 }
 
 pub fn set_perm(p: &Path, perm: FilePermissions) -> io::Result<()> {
diff --git a/src/libstd/sys/redox/mod.rs b/src/libstd/sys/redox/mod.rs
index 31c40ea58b1..7c728ebb1af 100644
--- a/src/libstd/sys/redox/mod.rs
+++ b/src/libstd/sys/redox/mod.rs
@@ -39,25 +39,7 @@ pub mod thread_local;
 pub mod time;
 
 #[cfg(not(test))]
-pub fn init() {
-    use alloc::oom;
-
-    oom::set_oom_handler(oom_handler);
-
-    // A nicer handler for out-of-memory situations than the default one. This
-    // one prints a message to stderr before aborting. It is critical that this
-    // code does not allocate any memory since we are in an OOM situation. Any
-    // errors are ignored while printing since there's nothing we can do about
-    // them and we are about to exit anyways.
-    fn oom_handler() -> ! {
-        use intrinsics;
-        let msg = "fatal runtime error: out of memory\n";
-        unsafe {
-            let _ = syscall::write(2, msg.as_bytes());
-            intrinsics::abort();
-        }
-    }
-}
+pub fn init() {}
 
 pub fn decode_error_kind(errno: i32) -> ErrorKind {
     match errno {