Skip to content

Commit b2d4eb1

Browse files
committedOct 2, 2014
auto merge of #17590 : bjadamson/rust/rustc-improvements, r=alexcrichton
Removes an unnecessary allocation when passing the command line arguments to the librustc driver.
2 parents b419e9e + d96faf7 commit b2d4eb1

File tree

2 files changed

+4
-6
lines changed

2 files changed

+4
-6
lines changed
 

‎src/librustc/driver/mod.rs

+2-5
Original file line numberDiff line numberDiff line change
@@ -29,16 +29,13 @@ use syntax::diagnostics;
2929

3030
use getopts;
3131

32-
3332
pub mod driver;
3433
pub mod session;
3534
pub mod config;
3635
pub mod pretty;
3736

38-
39-
pub fn main_args(args: &[String]) -> int {
40-
let owned_args = args.to_vec();
41-
monitor(proc() run_compiler(owned_args.as_slice()));
37+
pub fn run(args: Vec<String>) -> int {
38+
monitor(proc() run_compiler(args.as_slice()));
4239
0
4340
}
4441

‎src/librustc/lib.rs

+2-1
Original file line numberDiff line numberDiff line change
@@ -150,5 +150,6 @@ mod rustc {
150150

151151
pub fn main() {
152152
let args = std::os::args();
153-
std::os::set_exit_status(driver::main_args(args.as_slice()));
153+
let result = driver::run(args);
154+
std::os::set_exit_status(result);
154155
}

0 commit comments

Comments
 (0)
Please sign in to comment.