]> git.proxmox.com Git - cargo.git/commitdiff
update Rust
authorAndrew Paseltiner <apaseltiner@gmail.com>
Fri, 13 Feb 2015 04:10:07 +0000 (23:10 -0500)
committerAndrew Paseltiner <apaseltiner@gmail.com>
Fri, 13 Feb 2015 04:10:25 +0000 (23:10 -0500)
26 files changed:
Cargo.lock
src/bin/build.rs
src/bin/cargo.rs
src/bin/clean.rs
src/bin/generate_lockfile.rs
src/bin/new.rs
src/bin/update.rs
src/bin/verify_project.rs
src/bin/version.rs
src/cargo/lib.rs
src/cargo/ops/cargo_new.rs
src/cargo/ops/cargo_rustc/engine.rs
src/cargo/ops/registry.rs
src/cargo/sources/git/utils.rs
src/cargo/util/config.rs
src/cargo/util/hex.rs
src/cargo/util/profile.rs
src/rustversion.txt
tests/support/mod.rs
tests/test_cargo.rs
tests/test_cargo_compile.rs
tests/test_cargo_compile_custom_build.rs
tests/test_cargo_compile_git_deps.rs
tests/test_cargo_compile_plugins.rs
tests/test_cargo_cross_compile.rs
tests/test_cargo_profiles.rs

index 14dd8761b97de3314f610dd1d8bb8b32d02a75b0..629585c5d99f02256b8aaa4a403c4725abf1fdd9 100644 (file)
@@ -4,7 +4,7 @@ version = "0.1.0"
 dependencies = [
  "advapi32-sys 0.0.4 (registry+https://github.com/rust-lang/crates.io-index)",
  "curl 0.1.14 (registry+https://github.com/rust-lang/crates.io-index)",
- "docopt 0.6.36 (registry+https://github.com/rust-lang/crates.io-index)",
+ "docopt 0.6.37 (registry+https://github.com/rust-lang/crates.io-index)",
  "env_logger 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)",
  "flate2 0.1.8 (registry+https://github.com/rust-lang/crates.io-index)",
  "git2 0.1.17 (registry+https://github.com/rust-lang/crates.io-index)",
@@ -18,8 +18,8 @@ dependencies = [
  "semver 0.1.14 (registry+https://github.com/rust-lang/crates.io-index)",
  "tar 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)",
  "term 0.1.11 (registry+https://github.com/rust-lang/crates.io-index)",
- "time 0.1.16 (registry+https://github.com/rust-lang/crates.io-index)",
- "toml 0.1.16 (registry+https://github.com/rust-lang/crates.io-index)",
+ "time 0.1.17 (registry+https://github.com/rust-lang/crates.io-index)",
+ "toml 0.1.17 (registry+https://github.com/rust-lang/crates.io-index)",
  "url 0.2.20 (registry+https://github.com/rust-lang/crates.io-index)",
  "winapi 0.1.11 (registry+https://github.com/rust-lang/crates.io-index)",
 ]
@@ -44,7 +44,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
 dependencies = [
  "curl-sys 0.1.8 (registry+https://github.com/rust-lang/crates.io-index)",
  "libc 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)",
- "openssl-sys 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)",
+ "openssl-sys 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)",
  "url 0.2.20 (registry+https://github.com/rust-lang/crates.io-index)",
 ]
 
@@ -55,13 +55,13 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
 dependencies = [
  "libc 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)",
  "libz-sys 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)",
- "openssl-sys 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)",
+ "openssl-sys 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)",
  "pkg-config 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)",
 ]
 
 [[package]]
 name = "docopt"
-version = "0.6.36"
+version = "0.6.37"
 source = "registry+https://github.com/rust-lang/crates.io-index"
 dependencies = [
  "regex 0.1.14 (registry+https://github.com/rust-lang/crates.io-index)",
@@ -97,7 +97,7 @@ version = "0.1.17"
 source = "registry+https://github.com/rust-lang/crates.io-index"
 dependencies = [
  "bitflags 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)",
- "libgit2-sys 0.1.12 (registry+https://github.com/rust-lang/crates.io-index)",
+ "libgit2-sys 0.1.13 (registry+https://github.com/rust-lang/crates.io-index)",
  "url 0.2.20 (registry+https://github.com/rust-lang/crates.io-index)",
 ]
 
@@ -136,13 +136,13 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
 
 [[package]]
 name = "libgit2-sys"
-version = "0.1.12"
+version = "0.1.13"
 source = "registry+https://github.com/rust-lang/crates.io-index"
 dependencies = [
  "libssh2-sys 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)",
  "libz-sys 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)",
- "openssl-sys 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)",
- "pkg-config 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)",
+ "openssl-sys 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)",
+ "pkg-config 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)",
 ]
 
 [[package]]
@@ -159,7 +159,7 @@ version = "0.1.5"
 source = "registry+https://github.com/rust-lang/crates.io-index"
 dependencies = [
  "libz-sys 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)",
- "openssl-sys 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)",
+ "openssl-sys 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)",
  "pkg-config 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)",
 ]
 
@@ -192,12 +192,12 @@ dependencies = [
 
 [[package]]
 name = "openssl-sys"
-version = "0.3.3"
+version = "0.3.6"
 source = "registry+https://github.com/rust-lang/crates.io-index"
 dependencies = [
  "gcc 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)",
  "libressl-pnacl-sys 2.1.4 (registry+https://github.com/rust-lang/crates.io-index)",
- "pkg-config 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)",
+ "pkg-config 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)",
 ]
 
 [[package]]
@@ -207,7 +207,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
 
 [[package]]
 name = "pkg-config"
-version = "0.2.0"
+version = "0.2.1"
 source = "registry+https://github.com/rust-lang/crates.io-index"
 
 [[package]]
@@ -255,7 +255,7 @@ dependencies = [
 
 [[package]]
 name = "time"
-version = "0.1.16"
+version = "0.1.17"
 source = "registry+https://github.com/rust-lang/crates.io-index"
 dependencies = [
  "gcc 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)",
@@ -264,7 +264,7 @@ dependencies = [
 
 [[package]]
 name = "toml"
-version = "0.1.16"
+version = "0.1.17"
 source = "registry+https://github.com/rust-lang/crates.io-index"
 dependencies = [
  "rustc-serialize 0.2.12 (registry+https://github.com/rust-lang/crates.io-index)",
index a617f6459abd98ba49d32d81b2700a331640e06d..0784c047a971ea0370070a9c0ab41fcba1906ba3 100644 (file)
@@ -1,4 +1,4 @@
-use std::os;
+use std::env;
 
 use cargo::ops::CompileOptions;
 use cargo::ops;
@@ -47,7 +47,7 @@ the --release flag will use the `release` profile instead.
 ";
 
 pub fn execute(options: Options, config: &Config) -> CliResult<Option<()>> {
-    debug!("executing; cmd=cargo-build; args={:?}", os::args());
+    debug!("executing; cmd=cargo-build; args={:?}", env::args().collect::<Vec<_>>());
     config.shell().set_verbose(options.flag_verbose);
 
     let root = try!(find_root_manifest_for_cwd(options.flag_manifest_path));
index 7bf0a1161ac13979412f7d165b2aefa77fc4b20b..53c904d341057296022fc7a5b11e6b38550c01dc 100644 (file)
@@ -245,7 +245,7 @@ fn list_command_directory() -> Vec<Path> {
         dirs.push(path.join("../lib/cargo"));
         dirs.push(path);
     }
-    if let Some(val) = env::var("PATH") {
+    if let Some(val) = env::var_os("PATH") {
         dirs.extend(env::split_paths(&val));
     }
     dirs
index dcc013e46ba65f61288471793e5fba063a72f7a7..a530b9b245a478bd93bc595370dddb11d2af5e85 100644 (file)
@@ -1,4 +1,4 @@
-use std::os;
+use std::env;
 
 use cargo::ops;
 use cargo::util::{CliResult, CliError, Config};
@@ -33,7 +33,7 @@ and its format, see the `cargo help pkgid` command.
 
 pub fn execute(options: Options, config: &Config) -> CliResult<Option<()>> {
     config.shell().set_verbose(options.flag_verbose);
-    debug!("executing; cmd=cargo-clean; args={:?}", os::args());
+    debug!("executing; cmd=cargo-clean; args={:?}", env::args().collect::<Vec<_>>());
 
     let root = try!(find_root_manifest_for_cwd(options.flag_manifest_path));
     let opts = ops::CleanOptions {
index a350ab63204550aa7caeca3dfa25902790734e0f..d9777ef663a852a7bb4bbce6acaeb2517468d1b0 100644 (file)
@@ -1,4 +1,4 @@
-use std::os;
+use std::env;
 
 use cargo::ops;
 use cargo::util::{CliResult, CliError, Config};
@@ -23,7 +23,7 @@ Options:
 ";
 
 pub fn execute(options: Options, config: &Config) -> CliResult<Option<()>> {
-    debug!("executing; cmd=cargo-generate-lockfile; args={:?}", os::args());
+    debug!("executing; cmd=cargo-generate-lockfile; args={:?}", env::args().collect::<Vec<_>>());
     config.shell().set_verbose(options.flag_verbose);
     let root = try!(find_root_manifest_for_cwd(options.flag_manifest_path));
 
index 4126e3826e7d0e08be8c853345433b9ebc2b8e7f..0abff6a5747f4677a32d51cac57d4b93d6fbea07 100644 (file)
@@ -1,4 +1,4 @@
-use std::os;
+use std::env;
 
 use cargo::ops;
 use cargo::util::{CliResult, CliError, Config};
@@ -28,7 +28,7 @@ Options:
 ";
 
 pub fn execute(options: Options, config: &Config) -> CliResult<Option<()>> {
-    debug!("executing; cmd=cargo-new; args={:?}", os::args());
+    debug!("executing; cmd=cargo-new; args={:?}", env::args().collect::<Vec<_>>());
     config.shell().set_verbose(options.flag_verbose);
 
     let Options { flag_bin, arg_path, flag_vcs, .. } = options;
index fa75506bcd253f2a03065d694cc396c46755e9fc..4fdeebfb68529de081c750372346025dd998db44 100644 (file)
@@ -1,4 +1,4 @@
-use std::os;
+use std::env;
 
 use cargo::ops;
 use cargo::util::{CliResult, CliError, Config};
@@ -49,7 +49,7 @@ For more information about package id specifications, see `cargo help pkgid`.
 ";
 
 pub fn execute(options: Options, config: &Config) -> CliResult<Option<()>> {
-    debug!("executing; cmd=cargo-update; args={:?}", os::args());
+    debug!("executing; cmd=cargo-update; args={:?}", env::args().collect::<Vec<_>>());
     config.shell().set_verbose(options.flag_verbose);
     let root = try!(find_root_manifest_for_cwd(options.flag_manifest_path));
 
index 54f8d6e80f5a3a9413bb0fc46df66643c247d396..816c5e9bb790f1624657c81b628c3db4c5bae5e1 100644 (file)
@@ -1,8 +1,8 @@
 extern crate toml;
 
 use std::collections::HashMap;
+use std::env;
 use std::old_io::File;
-use std::os;
 
 use cargo::util::{CliResult, Config};
 
@@ -47,6 +47,6 @@ pub fn execute(args: Flags, config: &Config) -> CliResult<Option<Error>> {
 fn fail(reason: &str, value: &str) -> CliResult<Option<Error>>{
     let mut h = HashMap::new();
     h.insert(reason.to_string(), value.to_string());
-    os::set_exit_status(1);
+    env::set_exit_status(1);
     Ok(Some(h))
 }
index e1bc0116f215fbf01b4308b44bc546a2b8a4c3cc..b5622f225c906681dad51ff12db626eced1b8d7e 100644 (file)
@@ -1,4 +1,4 @@
-use std::os;
+use std::env;
 
 use cargo;
 use cargo::util::{CliResult, Config};
@@ -16,7 +16,7 @@ Options:
 ";
 
 pub fn execute(_: Options, _: &Config) -> CliResult<Option<()>> {
-    debug!("executing; cmd=cargo-version; args={:?}", os::args());
+    debug!("executing; cmd=cargo-version; args={:?}", env::args().collect::<Vec<_>>());
 
     println!("{}", cargo::version());
 
index 609e1bd84baed243c4cac37a17358c562c61e9e8..d5737efd955ba1758e337c50509038ad5c6ffbb9 100644 (file)
@@ -95,7 +95,7 @@ fn process<V, F>(mut callback: F)
     let mut shell = shell(true);
     process_executed((|| {
         let config = try!(Config::new(&mut shell));
-        let args: Vec<_> = try!(env::args().map(|s| {
+        let args: Vec<_> = try!(env::args_os().map(|s| {
             s.into_string().map_err(|s| {
                 human(format!("invalid unicode in argument: {:?}", s))
             })
index 09d83185af1f047c64e9c79f4e7ed9e6543628ee..ae9d5e54f5829ec2f8916c1c995524e37ccc9c2a 100644 (file)
@@ -134,8 +134,8 @@ fn discover_author() -> CargoResult<(String, Option<String>)> {
     let git_config = git_config.as_ref();
     let name = git_config.and_then(|g| g.get_str("user.name").ok())
                          .map(|s| s.to_string())
-                         .or_else(|| env::var_string("USER").ok())      // unix
-                         .or_else(|| env::var_string("USERNAME").ok()); // windows
+                         .or_else(|| env::var("USER").ok())      // unix
+                         .or_else(|| env::var("USERNAME").ok()); // windows
     let name = match name {
         Some(name) => name,
         None => {
index 5c6a0efdd20aad44623b8abd1d169fab877637ad..9d234f88237097df141bf306f4389bc0ba035a96 100644 (file)
@@ -85,7 +85,7 @@ impl CommandPrototype {
 
     pub fn get_env(&self, var: &str) -> Option<CString> {
         self.env.get(var).cloned().or_else(|| {
-            Some(env::var_string(var).ok().map(|s| CString::from_vec(s.into_bytes())))
+            Some(env::var(var).ok().map(|s| CString::from_vec(s.into_bytes())))
         }).and_then(|val| val)
     }
 
index 2461981b83593b2b137b6aa90cbde594e6ffe949..59754f20ba7b5bcb3d662c92a980d70dbf241ba6 100644 (file)
@@ -191,7 +191,7 @@ pub fn http_proxy(config: &Config) -> CargoResult<Option<String>> {
         }
         Err(..) => {}
     }
-    Ok(env::var_string("HTTP_PROXY").ok())
+    Ok(env::var("HTTP_PROXY").ok())
 }
 
 pub fn http_timeout(config: &Config) -> CargoResult<Option<i64>> {
@@ -199,7 +199,7 @@ pub fn http_timeout(config: &Config) -> CargoResult<Option<i64>> {
         Some((s, _)) => return Ok(Some(s)),
         None => {}
     }
-    Ok(env::var_string("HTTP_TIMEOUT").ok().and_then(|s| s.parse().ok()))
+    Ok(env::var("HTTP_TIMEOUT").ok().and_then(|s| s.parse().ok()))
 }
 
 pub fn registry_login(config: &Config, token: String) -> CargoResult<()> {
index 898f082705c4960103ba22c8609e219211dedf75..9861ed6e7e8e8fd26da17d787dee41f99b7aa8e9 100644 (file)
@@ -308,7 +308,8 @@ impl<'a> GitCheckout<'a> {
                 // as the submodule's head, then we can bail out and go to the
                 // next submodule.
                 let head_and_repo = child.open().and_then(|repo| {
-                    Ok((try!(repo.head()).target(), repo))
+                    let target = try!(repo.head()).target();
+                    Ok((target, repo))
                 });
                 let repo = match head_and_repo {
                     Ok((head, repo)) => {
index 217d02811104f709689b581f5d66e2764d2a2bb0..076e68d60bab6a940dea7477d509306ec46996ab 100644 (file)
@@ -380,7 +380,7 @@ impl ConfigValue {
 }
 
 fn homedir() -> Option<Path> {
-    let cargo_home = env::var_string("CARGO_HOME").map(|p| Path::new(p)).ok();
+    let cargo_home = env::var("CARGO_HOME").map(|p| Path::new(p)).ok();
     let user_home = env::home_dir().map(|p| p.join(".cargo"));
     return cargo_home.or(user_home);
 }
index 2bce7ea2ee9d32c570e79908f043c7d2158c7e5b..3e8d9629a55f66ea07591a7f4b07b6f7b3ab262f 100644 (file)
@@ -1,12 +1,11 @@
-use std::old_io::MemWriter;
 use std::hash::{Hasher, Hash, SipHasher};
 
 use rustc_serialize::hex::ToHex;
 
 pub fn to_hex(num: u64) -> String {
-    let mut writer = MemWriter::with_capacity(8);
+    let mut writer = Vec::with_capacity(8);
     writer.write_le_u64(num).unwrap(); // this should never fail
-    writer.get_ref().to_hex()
+    writer.to_hex()
 }
 
 pub fn short_hash<H: Hash<SipHasher>>(hashable: &H) -> String {
index 9d19c36dd8122f7126af08281fc974d8cf4cfb9d..100fd2c36c12baccaedf6be7eade3435c43bc11b 100644 (file)
@@ -14,7 +14,7 @@ pub struct Profiler {
     desc: String,
 }
 
-fn enabled() -> bool { env::var("CARGO_PROFILE").is_some() }
+fn enabled() -> bool { env::var_os("CARGO_PROFILE").is_some() }
 
 pub fn start<T: fmt::Display>(desc: T) -> Profiler {
     if !enabled() { return Profiler { desc: String::new() } }
index e2a057dc79862b23cb56e46597af3fba5fad7969..17cae77fb6c7718bdbe3086d45d10c446c4c0e34 100644 (file)
@@ -1 +1 @@
-2015-02-09
+2015-02-12
index 83be2957b78e00cc1bb453d363970020e0b57fbe..7c10756ae891951855c7a023ff3f07537570912a 100644 (file)
@@ -227,7 +227,7 @@ impl<T, E: fmt::Display> ErrMsg<T> for Result<T, E> {
 
 // Path to cargo executables
 pub fn cargo_dir() -> Path {
-    env::var_string("CARGO_BIN_PATH").map(Path::new).ok()
+    env::var("CARGO_BIN_PATH").map(Path::new).ok()
         .or_else(|| env::current_exe().ok().map(|s| s.dir_path()))
         .unwrap_or_else(|| {
             panic!("CARGO_BIN_PATH wasn't set. Cannot continue running test")
index b4b1abd14984fb3505a4569f85aaa22ce7582302..64e4c758c9aeb049bc86b919b2a44206f6dd50e1 100644 (file)
@@ -25,7 +25,7 @@ fn fake_executable(proj: ProjectBuilder, dir: &Path, name: &str) -> ProjectBuild
 }
 
 fn path() -> Vec<Path> {
-    env::split_paths(&env::var("PATH").unwrap_or(OsString::new())).collect()
+    env::split_paths(&env::var_os("PATH").unwrap_or(OsString::new())).collect()
 }
 
 test!(list_commands_looks_at_path {
index 20fcab8d794a8ec2158f418ed5b5ca58729cfbc7..9c5b9343570597d6b0f3dafa8e684855315df28f 100644 (file)
@@ -1259,7 +1259,7 @@ test!(freshness_ignores_excluded {
             exclude = ["src/b*.rs"]
         "#)
         .file("build.rs", "fn main() {}")
-        .file("src/lib.rs", "pub fn bar() -> int { 1 }");
+        .file("src/lib.rs", "pub fn bar() -> i32 { 1 }");
     foo.build();
     foo.root().move_into_the_past().unwrap();
 
@@ -1297,15 +1297,15 @@ test!(rebuild_preserves_out_dir {
             use std::old_io::File;
 
             fn main() {
-                let path = Path::new(env::var_string("OUT_DIR").unwrap()).join("foo");
-                if env::var("FIRST").is_some() {
+                let path = Path::new(env::var("OUT_DIR").unwrap()).join("foo");
+                if env::var_os("FIRST").is_some() {
                     File::create(&path).unwrap();
                 } else {
                     File::create(&path).unwrap();
                 }
             }
         "#)
-        .file("src/lib.rs", "pub fn bar() -> int { 1 }");
+        .file("src/lib.rs", "pub fn bar() -> i32 { 1 }");
     foo.build();
     foo.root().move_into_the_past().unwrap();
 
@@ -1335,7 +1335,7 @@ test!(dep_no_libs {
             [dependencies.bar]
             path = "bar"
         "#)
-        .file("src/lib.rs", "pub fn bar() -> int { 1 }")
+        .file("src/lib.rs", "pub fn bar() -> i32 { 1 }")
         .file("bar/Cargo.toml", r#"
             [package]
             name = "bar"
index b110b86be4c08289d4397545f293e883cceb96d5..4ef727bdd60206f0d6fab886b33de2904c16c219 100644 (file)
@@ -79,32 +79,32 @@ test!(custom_build_env_vars {
             use std::env;
             use std::old_io::fs::PathExtensions;
             fn main() {{
-                let _target = env::var_string("TARGET").unwrap();
+                let _target = env::var("TARGET").unwrap();
 
-                let _ncpus = env::var_string("NUM_JOBS").unwrap();
+                let _ncpus = env::var("NUM_JOBS").unwrap();
 
-                let out = env::var_string("CARGO_MANIFEST_DIR").unwrap();
+                let out = env::var("CARGO_MANIFEST_DIR").unwrap();
                 let p1 = Path::new(out);
                 let cwd = env::current_dir().unwrap();
                 let p2 = cwd.join(Path::new(file!()).dir_path().dir_path());
                 assert!(p1 == p2, "{{}} != {{}}", p1.display(), p2.display());
 
-                let opt = env::var_string("OPT_LEVEL").unwrap();
+                let opt = env::var("OPT_LEVEL").unwrap();
                 assert_eq!(opt.as_slice(), "0");
 
-                let opt = env::var_string("PROFILE").unwrap();
+                let opt = env::var("PROFILE").unwrap();
                 assert_eq!(opt.as_slice(), "compile");
 
-                let debug = env::var_string("DEBUG").unwrap();
+                let debug = env::var("DEBUG").unwrap();
                 assert_eq!(debug.as_slice(), "true");
 
-                let out = env::var_string("OUT_DIR").unwrap();
+                let out = env::var("OUT_DIR").unwrap();
                 assert!(out.as_slice().starts_with(r"{0}"));
                 assert!(Path::new(out).is_dir());
 
-                let _host = env::var_string("HOST").unwrap();
+                let _host = env::var("HOST").unwrap();
 
-                let _feat = env::var_string("CARGO_FEATURE_FOO").unwrap();
+                let _feat = env::var("CARGO_FEATURE_FOO").unwrap();
             }}
         "#,
         p.root().join("target").join("build").display());
@@ -269,8 +269,8 @@ test!(overrides_and_links {
         .file("build.rs", r#"
             use std::env;
             fn main() {
-                assert_eq!(env::var_string("DEP_FOO_FOO").unwrap().as_slice(), "bar");
-                assert_eq!(env::var_string("DEP_FOO_BAR").unwrap().as_slice(), "baz");
+                assert_eq!(env::var("DEP_FOO_FOO").unwrap().as_slice(), "bar");
+                assert_eq!(env::var("DEP_FOO_BAR").unwrap().as_slice(), "baz");
             }
         "#)
         .file(".cargo/config", format!(r#"
@@ -342,8 +342,8 @@ test!(links_passes_env_vars {
         .file("build.rs", r#"
             use std::env;
             fn main() {
-                assert_eq!(env::var_string("DEP_FOO_FOO").unwrap().as_slice(), "bar");
-                assert_eq!(env::var_string("DEP_FOO_BAR").unwrap().as_slice(), "baz");
+                assert_eq!(env::var("DEP_FOO_FOO").unwrap().as_slice(), "bar");
+                assert_eq!(env::var("DEP_FOO_BAR").unwrap().as_slice(), "baz");
             }
         "#)
         .file("a/Cargo.toml", r#"
@@ -441,8 +441,8 @@ test!(rebuild_continues_to_pass_env_vars {
         .file("build.rs", r#"
             use std::env;
             fn main() {
-                assert_eq!(env::var_string("DEP_FOO_FOO").unwrap().as_slice(), "bar");
-                assert_eq!(env::var_string("DEP_FOO_BAR").unwrap().as_slice(), "baz");
+                assert_eq!(env::var("DEP_FOO_FOO").unwrap().as_slice(), "bar");
+                assert_eq!(env::var("DEP_FOO_BAR").unwrap().as_slice(), "baz");
             }
         "#);
 
@@ -727,7 +727,7 @@ test!(out_dir_is_preserved {
             use std::env;
             use std::old_io::File;
             fn main() {
-                let out = env::var_string("OUT_DIR").unwrap();
+                let out = env::var("OUT_DIR").unwrap();
                 File::create(&Path::new(out).join("foo")).unwrap();
             }
         "#);
@@ -742,7 +742,7 @@ test!(out_dir_is_preserved {
         use std::env;
         use std::old_io::File;
         fn main() {
-            let out = env::var_string("OUT_DIR").unwrap();
+            let out = env::var("OUT_DIR").unwrap();
             File::open(&Path::new(out).join("foo")).unwrap();
         }
     "#).unwrap();
@@ -808,7 +808,7 @@ test!(code_generation {
             use std::old_io::File;
 
             fn main() {
-                let dst = Path::new(env::var_string("OUT_DIR").unwrap());
+                let dst = Path::new(env::var("OUT_DIR").unwrap());
                 let mut f = File::create(&dst.join("hello.rs")).unwrap();
                 f.write_str("
                     pub fn message() -> &'static str {
@@ -972,9 +972,9 @@ test!(test_a_lib_with_a_build_command {
             use std::old_io::File;
 
             fn main() {
-                let out = Path::new(env::var_string("OUT_DIR").unwrap());
+                let out = Path::new(env::var("OUT_DIR").unwrap());
                 File::create(&out.join("foo.rs")).write_str("
-                    fn foo() -> int { 1 }
+                    fn foo() -> i32 { 1 }
                 ").unwrap();
             }
         "#);
@@ -1062,7 +1062,7 @@ test!(build_script_with_dynamic_native_dependency {
             use std::env;
 
             fn main() {
-                let src = Path::new(env::var_string("SRC").unwrap());
+                let src = Path::new(env::var("SRC").unwrap());
                 println!("cargo:rustc-flags=-L {}", src.dir_path().display());
             }
         "#)
index 5777e1a523d2eb7f8e6429db7f5eb1de05b869d0..11a152fbb1af0e5cc6d1e8b5b62743f8f2bb7bf6 100644 (file)
@@ -461,7 +461,7 @@ test!(two_revs_same_deps {
             version = "0.0.0"
             authors = []
         "#)
-        .file("src/lib.rs", "pub fn bar() -> int { 1 }")
+        .file("src/lib.rs", "pub fn bar() -> i32 { 1 }")
     }).unwrap();
 
     let repo = git2::Repository::open(&bar.root()).unwrap();
@@ -469,7 +469,7 @@ test!(two_revs_same_deps {
 
     // Commit the changes and make sure we trigger a recompile
     File::create(&bar.root().join("src/lib.rs")).write_str(r#"
-        pub fn bar() -> int { 2 }
+        pub fn bar() -> i32 { 2 }
     "#).unwrap();
     add(&repo);
     let rev2 = commit(&repo);
@@ -511,7 +511,7 @@ test!(two_revs_same_deps {
         "#, bar.url(), rev2).as_slice())
         .file("src/lib.rs", r#"
             extern crate bar;
-            pub fn baz() -> int { bar::bar() }
+            pub fn baz() -> i32 { bar::bar() }
         "#);
 
     baz.build();
@@ -860,7 +860,7 @@ test!(stale_cached_version {
             version = "0.0.0"
             authors = []
         "#)
-        .file("src/lib.rs", "pub fn bar() -> int { 1 }")
+        .file("src/lib.rs", "pub fn bar() -> i32 { 1 }")
     }).unwrap();
 
     // Update the git database in the cache with the current state of the git
@@ -887,7 +887,7 @@ test!(stale_cached_version {
     // Update the repo, and simulate someone else updating the lockfile and then
     // us pulling it down.
     File::create(&bar.root().join("src/lib.rs")).write_str(r#"
-        pub fn bar() -> int { 1 + 0 }
+        pub fn bar() -> i32 { 1 + 0 }
     "#).unwrap();
     let repo = git2::Repository::open(&bar.root()).unwrap();
     add(&repo);
@@ -1090,7 +1090,7 @@ test!(git_build_cmd_freshness {
             build = "build.rs"
         "#)
         .file("build.rs", "fn main() {}")
-        .file("src/lib.rs", "pub fn bar() -> int { 1 }")
+        .file("src/lib.rs", "pub fn bar() -> i32 { 1 }")
         .file(".gitignore", "
             src/bar.rs
         ")
@@ -1166,7 +1166,7 @@ test!(git_repo_changing_no_rebuild {
             version = "0.5.0"
             authors = ["wycats@example.com"]
         "#)
-        .file("src/lib.rs", "pub fn bar() -> int { 1 }")
+        .file("src/lib.rs", "pub fn bar() -> i32 { 1 }")
     }).unwrap();
 
     // Lock p1 to the first rev in the git repo
@@ -1193,7 +1193,7 @@ test!(git_repo_changing_no_rebuild {
 
     // Make a commit to lock p2 to a different rev
     File::create(&bar.root().join("src/lib.rs")).write_str(r#"
-        pub fn bar() -> int { 2 }
+        pub fn bar() -> i32 { 2 }
     "#).unwrap();
     let repo = git2::Repository::open(&bar.root()).unwrap();
     add(&repo);
@@ -1256,7 +1256,7 @@ test!(git_dep_build_cmd {
             name = "bar"
         "#)
         .file("bar/src/bar.rs.in", r#"
-            pub fn gimme() -> int { 0 }
+            pub fn gimme() -> i32 { 0 }
         "#)
         .file("bar/build.rs", r#"
             use std::old_io::fs;
@@ -1278,7 +1278,7 @@ test!(git_dep_build_cmd {
 
     // Touching bar.rs.in should cause the `build` command to run again.
     let mut file = fs::File::create(&p.root().join("bar/src/bar.rs.in")).unwrap();
-    file.write_str(r#"pub fn gimme() -> int { 1 }"#).unwrap();
+    file.write_str(r#"pub fn gimme() -> i32 { 1 }"#).unwrap();
     drop(file);
 
     assert_that(p.process(cargo_dir().join("cargo")).arg("build"),
@@ -1297,7 +1297,7 @@ test!(fetch_downloads {
             version = "0.5.0"
             authors = ["wycats@example.com"]
         "#)
-        .file("src/lib.rs", "pub fn bar() -> int { 1 }")
+        .file("src/lib.rs", "pub fn bar() -> i32 { 1 }")
     }).unwrap();
 
     let p = project("p1")
@@ -1569,7 +1569,7 @@ test!(update_one_source_updates_all_packages_in_that_git_source {
 
     // Just be sure to change a file
     File::create(&dep.root().join("src/lib.rs")).write_str(r#"
-        pub fn bar() -> int { 2 }
+        pub fn bar() -> i32 { 2 }
     "#).unwrap();
     add(&repo);
     commit(&repo);
index 853038ff3536afa9a9dfb6a0c26b249994735797..ca44a4dbf79d60d8abbfeaa6bbed2431a1463b81 100644 (file)
@@ -23,14 +23,14 @@ test!(plugin_to_the_max {
         "#)
         .file("src/main.rs", r#"
             #![feature(plugin)]
-            #[plugin] #[no_link] extern crate bar;
+            #![plugin(bar)]
             extern crate foo_lib;
 
             fn main() { foo_lib::foo(); }
         "#)
         .file("src/foo_lib.rs", r#"
             #![feature(plugin)]
-            #[plugin] #[no_link] extern crate bar;
+            #![plugin(bar)]
 
             pub fn foo() {}
         "#);
@@ -122,7 +122,7 @@ test!(plugin_with_dynamic_native_dependency {
         "#)
         .file("src/main.rs", r#"
             #![feature(plugin)]
-            #[plugin] #[no_link] extern crate bar;
+            #![plugin(bar)]
 
             fn main() {}
         "#)
index a2d53e0bbf79d7f32acde6a6f0505dafde6cdb3c..cf6b9a58660dcef3149c197b0b1ef3cd2359ce92 100644 (file)
@@ -12,7 +12,7 @@ fn setup() {
 
 fn disabled() -> bool {
     // First, disable if ./configure requested so
-    match env::var_string("CFG_DISABLE_CROSS_TESTS") {
+    match env::var("CFG_DISABLE_CROSS_TESTS") {
         Ok(ref s) if s.as_slice() == "1" => return true,
         _ => {}
     }
@@ -44,7 +44,7 @@ test!(simple_cross {
         "#)
         .file("build.rs", format!(r#"
             fn main() {{
-                assert_eq!(std::env::var_string("TARGET").unwrap().as_slice(), "{}");
+                assert_eq!(std::env::var("TARGET").unwrap().as_slice(), "{}");
             }}
         "#, alternate()).as_slice())
         .file("src/main.rs", r#"
@@ -119,8 +119,7 @@ test!(plugin_deps {
         "#)
         .file("src/main.rs", r#"
             #![feature(plugin)]
-            #[plugin] #[no_link]
-            extern crate bar;
+            #![plugin(bar)]
             extern crate baz;
             fn main() {
                 assert_eq!(bar!(), baz::baz());
@@ -155,7 +154,7 @@ test!(plugin_deps {
 
             fn expand_bar(cx: &mut ExtCtxt, sp: Span, tts: &[TokenTree])
                           -> Box<MacResult + 'static> {
-                MacExpr::new(quote_expr!(cx, 1i))
+                MacExpr::new(quote_expr!(cx, 1))
             }
         "#);
     let baz = project("baz")
@@ -165,7 +164,7 @@ test!(plugin_deps {
             version = "0.0.1"
             authors = []
         "#)
-        .file("src/lib.rs", "pub fn baz() -> int { 1 }");
+        .file("src/lib.rs", "pub fn baz() -> i32 { 1 }");
     bar.build();
     baz.build();
 
@@ -197,8 +196,7 @@ test!(plugin_to_the_max {
         "#)
         .file("src/main.rs", r#"
             #![feature(plugin)]
-            #[plugin] #[no_link]
-            extern crate bar;
+            #![plugin(bar)]
             extern crate baz;
             fn main() {
                 assert_eq!(bar!(), baz::baz());
@@ -320,7 +318,7 @@ test!(plugin_with_extra_dylib_dep {
         "#)
         .file("src/main.rs", r#"
             #![feature(plugin)]
-            #[plugin] #[no_link] extern crate bar;
+            #![plugin(bar)]
 
             fn main() {}
         "#);
@@ -362,7 +360,7 @@ test!(plugin_with_extra_dylib_dep {
             name = "baz"
             crate_type = ["dylib"]
         "#)
-        .file("src/lib.rs", "pub fn baz() -> int { 1 }");
+        .file("src/lib.rs", "pub fn baz() -> i32 { 1 }");
     bar.build();
     baz.build();
 
@@ -464,8 +462,8 @@ test!(cross_with_a_build_script {
         .file("build.rs", format!(r#"
             use std::env;
             fn main() {{
-                assert_eq!(env::var_string("TARGET").unwrap().as_slice(), "{0}");
-                let mut path = Path::new(env::var_string("OUT_DIR").unwrap());
+                assert_eq!(env::var("TARGET").unwrap().as_slice(), "{0}");
+                let mut path = Path::new(env::var("OUT_DIR").unwrap());
                 assert_eq!(path.filename().unwrap(), b"out");
                 path.pop();
                 assert!(path.filename().unwrap().starts_with(b"foo-"));
@@ -530,7 +528,7 @@ test!(build_script_needed_for_host_and_target {
         .file("d1/build.rs", r#"
             use std::env;
             fn main() {
-                let target = env::var_string("TARGET").unwrap();
+                let target = env::var("TARGET").unwrap();
                 println!("cargo:rustc-flags=-L /path/to/{}", target);
             }
         "#)
@@ -643,9 +641,9 @@ test!(build_script_only_host {
             use std::env;
 
             fn main() {
-                assert!(env::var_string("OUT_DIR").unwrap()
+                assert!(env::var("OUT_DIR").unwrap()
                                              .contains("target/build/d1-"),
-                        "bad: {:?}", env::var_string("OUT_DIR"));
+                        "bad: {:?}", env::var("OUT_DIR"));
             }
         "#);
 
index b71eadb344942e9772389406c1fdaf205182f17f..827393f92c280e79e5150bfd51b4450185dccb41 100644 (file)
@@ -1,4 +1,4 @@
-use std::os;
+use std::env;
 use std::old_path;
 
 use support::{project, execs};
@@ -110,6 +110,6 @@ test!(top_level_overrides_deps {
                     dir = p.root().display(),
                     url = p.url(),
                     sep = old_path::SEP,
-                    prefix = os::consts::DLL_PREFIX,
-                    suffix = os::consts::DLL_SUFFIX).as_slice()));
+                    prefix = env::consts::DLL_PREFIX,
+                    suffix = env::consts::DLL_SUFFIX).as_slice()));
 });