about summary refs log tree commit diff
path: root/src/librustc_back
diff options
context:
space:
mode:
authorAlex Crichton <alex@alexcrichton.com>2015-03-30 11:00:05 -0700
committerAlex Crichton <alex@alexcrichton.com>2015-03-31 15:49:57 -0700
commitd4a2c941809f303b97d153e06ba07e95cd245f88 (patch)
treef876f056ff60aeac3f0098deb2dbe1fabfd13091 /src/librustc_back
parentd754722a04b99fdcae0fd97fa2a4395521145ef2 (diff)
downloadrust-d4a2c941809f303b97d153e06ba07e95cd245f88.tar.gz
rust-d4a2c941809f303b97d153e06ba07e95cd245f88.zip
std: Clean out #[deprecated] APIs
This commit cleans out a large amount of deprecated APIs from the standard
library and some of the facade crates as well, updating all users in the
compiler and in tests as it goes along.
Diffstat (limited to 'src/librustc_back')
-rw-r--r--src/librustc_back/fs.rs5
-rw-r--r--src/librustc_back/lib.rs2
-rw-r--r--src/librustc_back/sha2.rs6
-rw-r--r--src/librustc_back/tempdir.rs8
4 files changed, 10 insertions, 11 deletions
diff --git a/src/librustc_back/fs.rs b/src/librustc_back/fs.rs
index 6d8891dd4fe..d3f3b1dad78 100644
--- a/src/librustc_back/fs.rs
+++ b/src/librustc_back/fs.rs
@@ -9,6 +9,7 @@
 // except according to those terms.
 
 use std::io;
+use std::env;
 #[allow(deprecated)] use std::old_path::{self, GenericPath};
 #[allow(deprecated)] use std::old_io;
 use std::path::{Path, PathBuf};
@@ -29,9 +30,9 @@ pub fn realpath(original: &Path) -> io::Result<PathBuf> {
 #[allow(deprecated)]
 fn old_realpath(original: &old_path::Path) -> old_io::IoResult<old_path::Path> {
     use std::old_io::fs;
-    use std::os;
     const MAX_LINKS_FOLLOWED: usize = 256;
-    let original = try!(os::getcwd()).join(original);
+    let original = old_path::Path::new(env::current_dir().unwrap()
+                                           .to_str().unwrap()).join(original);
 
     // Right now lstat on windows doesn't work quite well
     if cfg!(windows) {
diff --git a/src/librustc_back/lib.rs b/src/librustc_back/lib.rs
index fe457841e91..0814d53acd1 100644
--- a/src/librustc_back/lib.rs
+++ b/src/librustc_back/lib.rs
@@ -39,12 +39,10 @@
 #![feature(io)]
 #![feature(old_io)]
 #![feature(old_path)]
-#![feature(os)]
 #![feature(rustc_private)]
 #![feature(staged_api)]
 #![feature(rand)]
 #![feature(path_ext)]
-#![feature(std_misc)]
 #![feature(step_by)]
 #![feature(convert)]
 #![cfg_attr(test, feature(test, rand))]
diff --git a/src/librustc_back/sha2.rs b/src/librustc_back/sha2.rs
index 8f0387059e4..898f20e7451 100644
--- a/src/librustc_back/sha2.rs
+++ b/src/librustc_back/sha2.rs
@@ -14,7 +14,7 @@
 
 #![allow(deprecated)] // to_be32
 
-use std::iter::{range_step, repeat};
+use std::iter::repeat;
 use std::num::Int;
 use std::slice::bytes::{MutableByteVector, copy_memory};
 use serialize::hex::ToHex;
@@ -368,7 +368,7 @@ impl Engine256State {
 
         // Putting the message schedule inside the same loop as the round calculations allows for
         // the compiler to generate better code.
-        for t in range_step(0, 48, 8) {
+        for t in (0..48).step_by(8) {
             schedule_round!(t + 16);
             schedule_round!(t + 17);
             schedule_round!(t + 18);
@@ -388,7 +388,7 @@ impl Engine256State {
             sha2_round!(b, c, d, e, f, g, h, a, K32, t + 7);
         }
 
-        for t in range_step(48, 64, 8) {
+        for t in (48..64).step_by(8) {
             sha2_round!(a, b, c, d, e, f, g, h, K32, t);
             sha2_round!(h, a, b, c, d, e, f, g, K32, t + 1);
             sha2_round!(g, h, a, b, c, d, e, f, K32, t + 2);
diff --git a/src/librustc_back/tempdir.rs b/src/librustc_back/tempdir.rs
index d4503ae7fc9..6935499f5a0 100644
--- a/src/librustc_back/tempdir.rs
+++ b/src/librustc_back/tempdir.rs
@@ -11,7 +11,7 @@
 use std::env;
 use std::io::{self, Error, ErrorKind};
 use std::fs;
-use std::path::{self, PathBuf, AsPath};
+use std::path::{self, PathBuf, Path};
 use std::rand::{thread_rng, Rng};
 
 /// A wrapper for a path to temporary directory implementing automatic
@@ -36,10 +36,10 @@ impl TempDir {
     ///
     /// If no directory can be created, `Err` is returned.
     #[allow(deprecated)] // rand usage
-    pub fn new_in<P: AsPath + ?Sized>(tmpdir: &P, prefix: &str)
-                                      -> io::Result<TempDir> {
+    pub fn new_in<P: AsRef<Path>>(tmpdir: P, prefix: &str)
+                                  -> io::Result<TempDir> {
         let storage;
-        let mut tmpdir = tmpdir.as_path();
+        let mut tmpdir = tmpdir.as_ref();
         if !tmpdir.is_absolute() {
             let cur_dir = try!(env::current_dir());
             storage = cur_dir.join(tmpdir);