auto merge of #17590 : bjadamson/rust/rustc-improvements, r=alexcrichton

Removes an unnecessary allocation when passing the command line arguments to the librustc driver.
This commit is contained in:
bors 2014-10-02 15:57:19 +00:00
commit b2d4eb186e
2 changed files with 4 additions and 6 deletions

View File

@ -29,16 +29,13 @@ use syntax::diagnostics;
use getopts; use getopts;
pub mod driver; pub mod driver;
pub mod session; pub mod session;
pub mod config; pub mod config;
pub mod pretty; pub mod pretty;
pub fn run(args: Vec<String>) -> int {
pub fn main_args(args: &[String]) -> int { monitor(proc() run_compiler(args.as_slice()));
let owned_args = args.to_vec();
monitor(proc() run_compiler(owned_args.as_slice()));
0 0
} }

View File

@ -150,5 +150,6 @@ mod rustc {
pub fn main() { pub fn main() {
let args = std::os::args(); let args = std::os::args();
std::os::set_exit_status(driver::main_args(args.as_slice())); let result = driver::run(args);
std::os::set_exit_status(result);
} }