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)",
"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)",
]
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)",
]
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)",
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)",
]
[[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]]
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)",
]
[[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]]
[[package]]
name = "pkg-config"
-version = "0.2.0"
+version = "0.2.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
[[package]]
[[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)",
[[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)",
-use std::os;
+use std::env;
use cargo::ops::CompileOptions;
use cargo::ops;
";
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));
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
-use std::os;
+use std::env;
use cargo::ops;
use cargo::util::{CliResult, CliError, Config};
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 {
-use std::os;
+use std::env;
use cargo::ops;
use cargo::util::{CliResult, CliError, Config};
";
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));
-use std::os;
+use std::env;
use cargo::ops;
use cargo::util::{CliResult, CliError, Config};
";
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;
-use std::os;
+use std::env;
use cargo::ops;
use cargo::util::{CliResult, CliError, Config};
";
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));
extern crate toml;
use std::collections::HashMap;
+use std::env;
use std::old_io::File;
-use std::os;
use cargo::util::{CliResult, Config};
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))
}
-use std::os;
+use std::env;
use cargo;
use cargo::util::{CliResult, Config};
";
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());
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))
})
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 => {
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)
}
}
Err(..) => {}
}
- Ok(env::var_string("HTTP_PROXY").ok())
+ Ok(env::var("HTTP_PROXY").ok())
}
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<()> {
// 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)) => {
}
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);
}
-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 {
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() } }
// 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")
}
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 {
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();
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();
[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"
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());
.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#"
.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#"
.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");
}
"#);
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();
}
"#);
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();
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 {
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();
}
"#);
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());
}
"#)
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();
// 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);
"#, 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();
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
// 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);
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
")
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
// 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);
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;
// 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"),
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")
// 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);
"#)
.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() {}
"#);
"#)
.file("src/main.rs", r#"
#![feature(plugin)]
- #[plugin] #[no_link] extern crate bar;
+ #![plugin(bar)]
fn main() {}
"#)
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,
_ => {}
}
"#)
.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#"
"#)
.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());
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")
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();
"#)
.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());
"#)
.file("src/main.rs", r#"
#![feature(plugin)]
- #[plugin] #[no_link] extern crate bar;
+ #![plugin(bar)]
fn main() {}
"#);
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();
.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-"));
.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);
}
"#)
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"));
}
"#);
-use std::os;
+use std::env;
use std::old_path;
use support::{project, execs};
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()));
});