diff options
Diffstat (limited to 'src/librustc_driver/lib.rs')
| -rw-r--r-- | src/librustc_driver/lib.rs | 40 |
1 files changed, 12 insertions, 28 deletions
diff --git a/src/librustc_driver/lib.rs b/src/librustc_driver/lib.rs index 89b2e0f257a..5af114abeea 100644 --- a/src/librustc_driver/lib.rs +++ b/src/librustc_driver/lib.rs @@ -22,11 +22,9 @@ html_favicon_url = "http://www.rust-lang.org/favicon.ico", html_root_url = "http://doc.rust-lang.org/nightly/")] -#![feature(default_type_params, globs, macro_rules, phase, quote)] +#![feature(quote)] #![feature(slicing_syntax, unsafe_destructor)] #![feature(rustc_diagnostic_macros)] -#![feature(unboxed_closures)] -#![feature(associated_types)] extern crate arena; extern crate flate; @@ -41,22 +39,8 @@ extern crate rustc_trans; extern crate rustc_typeck; extern crate serialize; extern crate "rustc_llvm" as llvm; - -#[cfg(stage0)] -#[phase(plugin, link)] -extern crate log; - -#[cfg(not(stage0))] -#[macro_use] -extern crate log; - -#[cfg(stage0)] -#[phase(plugin, link)] -extern crate syntax; - -#[cfg(not(stage0))] -#[macro_use] -extern crate syntax; +#[macro_use] extern crate log; +#[macro_use] extern crate syntax; pub use syntax::diagnostic; @@ -105,12 +89,12 @@ fn run_compiler(args: &[String]) { let descriptions = diagnostics::registry::Registry::new(&DIAGNOSTICS); match matches.opt_str("explain") { Some(ref code) => { - match descriptions.find_description(code[]) { + match descriptions.find_description(code.index(&FullRange)) { Some(ref description) => { println!("{}", description); } None => { - early_error(format!("no extended information for {}", code)[]); + early_error(format!("no extended information for {}", code).index(&FullRange)); } } return; @@ -136,7 +120,7 @@ fn run_compiler(args: &[String]) { early_error("no input filename given"); } 1u => { - let ifile = matches.free[0][]; + let ifile = matches.free[0].index(&FullRange); if ifile == "-" { let contents = io::stdin().read_to_end().unwrap(); let src = String::from_utf8(contents).unwrap(); @@ -313,7 +297,7 @@ Available lint options: for lint in lints.into_iter() { let name = lint.name_lower().replace("_", "-"); println!(" {} {:7.7} {}", - padded(name[]), lint.default_level.as_str(), lint.desc); + padded(name.index(&FullRange)), lint.default_level.as_str(), lint.desc); } println!("\n"); }; @@ -343,7 +327,7 @@ Available lint options: let desc = to.into_iter().map(|x| x.as_str().replace("_", "-")) .collect::<Vec<String>>().connect(", "); println!(" {} {}", - padded(name[]), desc); + padded(name.index(&FullRange)), desc); } println!("\n"); }; @@ -409,7 +393,7 @@ pub fn handle_options(mut args: Vec<String>) -> Option<getopts::Matches> { } let matches = - match getopts::getopts(args[], config::optgroups()[]) { + match getopts::getopts(args.index(&FullRange), config::optgroups().index(&FullRange)) { Ok(m) => m, Err(f_stable_attempt) => { // redo option parsing, including unstable options this time, @@ -559,7 +543,7 @@ pub fn monitor<F:FnOnce()+Send>(f: F) { cfg = cfg.stack_size(STACK_SIZE); } - match cfg.spawn(move || { std::io::stdio::set_stderr(box w); f() }).join() { + match cfg.scoped(move || { std::io::stdio::set_stderr(box w); f() }).join() { Ok(()) => { /* fallthrough */ } Err(value) => { // Thread panicked without emitting a fatal diagnostic @@ -583,7 +567,7 @@ pub fn monitor<F:FnOnce()+Send>(f: F) { "run with `RUST_BACKTRACE=1` for a backtrace".to_string(), ]; for note in xs.iter() { - emitter.emit(None, note[], None, diagnostic::Note) + emitter.emit(None, note.index(&FullRange), None, diagnostic::Note) } match r.read_to_string() { @@ -591,7 +575,7 @@ pub fn monitor<F:FnOnce()+Send>(f: F) { Err(e) => { emitter.emit(None, format!("failed to read internal \ - stderr: {}", e)[], + stderr: {}", e).index(&FullRange), None, diagnostic::Error) } |
