diff options
| author | bors <bors@rust-lang.org> | 2014-10-02 15:57:19 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2014-10-02 15:57:19 +0000 |
| commit | b2d4eb186e99b66051be9089f836c66a558dd995 (patch) | |
| tree | c673e08917d9220e873499708200bdf63a449e6d | |
| parent | b419e9e7396852d698602c10216051fa9f3ec2b8 (diff) | |
| parent | d96faf7e7178f211148e2abcdb3282579817364e (diff) | |
| download | rust-b2d4eb186e99b66051be9089f836c66a558dd995.tar.gz rust-b2d4eb186e99b66051be9089f836c66a558dd995.zip | |
auto merge of #17590 : bjadamson/rust/rustc-improvements, r=alexcrichton
Removes an unnecessary allocation when passing the command line arguments to the librustc driver.
| -rw-r--r-- | src/librustc/driver/mod.rs | 7 | ||||
| -rw-r--r-- | src/librustc/lib.rs | 3 |
2 files changed, 4 insertions, 6 deletions
diff --git a/src/librustc/driver/mod.rs b/src/librustc/driver/mod.rs index d9ccfd26010..88059dc814f 100644 --- a/src/librustc/driver/mod.rs +++ b/src/librustc/driver/mod.rs @@ -29,16 +29,13 @@ use syntax::diagnostics; use getopts; - pub mod driver; pub mod session; pub mod config; pub mod pretty; - -pub fn main_args(args: &[String]) -> int { - let owned_args = args.to_vec(); - monitor(proc() run_compiler(owned_args.as_slice())); +pub fn run(args: Vec<String>) -> int { + monitor(proc() run_compiler(args.as_slice())); 0 } diff --git a/src/librustc/lib.rs b/src/librustc/lib.rs index 478aa6d9805..e38f1f24f01 100644 --- a/src/librustc/lib.rs +++ b/src/librustc/lib.rs @@ -150,5 +150,6 @@ mod rustc { pub fn main() { 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); } |
