#![feature(box_syntax)]
#![feature(collections)]
#![feature(core)]
+#![feature(env)]
#![feature(int_uint)]
#![feature(io)]
#![feature(libc)]
use std::cmp::Ordering::Equal;
use std::old_io;
use std::iter::repeat;
-use std::os;
+use std::env;
use std::sync::mpsc::channel;
use std::thread;
// subverting the unstable features lints
let bootstrap_secret_key = option_env!("CFG_BOOTSTRAP_KEY");
// The matching key to the above, only known by the build system
- let bootstrap_provided_key = os::getenv("RUSTC_BOOTSTRAP_KEY");
+ let bootstrap_provided_key = env::var_string("RUSTC_BOOTSTRAP_KEY").ok();
match (disable_unstable_features, bootstrap_secret_key, bootstrap_provided_key) {
(_, Some(ref s), Some(ref p)) if s == p => UnstableFeatures::Cheat,
(true, _, _) => UnstableFeatures::Disallow,
println!(" {} {:7.7} {}", padded("----"), "-------", "-------");
let print_lints = |&: lints: Vec<&Lint>| {
- for lint in lints.into_iter() {
+ for lint in lints {
let name = lint.name_lower().replace("_", "-");
println!(" {} {:7.7} {}",
padded(&name[]), lint.default_level.as_str(), lint.desc);
println!(" {} {}", padded("----"), "---------");
let print_lint_groups = |&: lints: Vec<(&'static str, Vec<lint::LintId>)>| {
- for (name, to) in lints.into_iter() {
+ for (name, to) in lints {
let name = name.chars().map(|x| x.to_lowercase())
.collect::<String>().replace("_", "-");
let desc = to.into_iter().map(|x| x.as_str().replace("_", "-"))
// FIXME: Hacks on hacks. If the env is trying to override the stack size
// then *don't* set it explicitly.
- if os::getenv("RUST_MIN_STACK").is_none() {
+ if env::var("RUST_MIN_STACK").is_none() {
cfg = cfg.stack_size(STACK_SIZE);
}
}
pub fn main() {
- let args = std::os::args();
- let result = run(args);
- std::os::set_exit_status(result);
+ let args = env::args().map(|s| s.into_string().unwrap());
+ let result = run(args.collect());
+ std::env::set_exit_status(result as i32);
}