Skip to content

Commit d96faf7

Browse files
committed
Remove unnecessary allocation, update API name for starting the rustc driver.
1 parent 823f108 commit d96faf7

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
@@ -149,5 +149,6 @@ mod rustc {
149149

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

0 commit comments

Comments
 (0)