Skip to content

Commit 0cf17e7

Browse files
committed
rustbuild: fix bad usage of UNIX exec() in rustc wrapper
exec never returns, it replaces the current process. so anything after it is unreachable. that's not how exec_cmd() is used in the surrounding code
1 parent c709862 commit 0cf17e7

File tree

1 file changed

+0
-7
lines changed

1 file changed

+0
-7
lines changed

src/bootstrap/bin/rustc.rs

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -186,13 +186,6 @@ fn main() {
186186
std::process::exit(code);
187187
}
188188

189-
#[cfg(unix)]
190-
fn exec_cmd(cmd: &mut Command) -> io::Result<i32> {
191-
use std::os::unix::process::CommandExt;
192-
Err(cmd.exec())
193-
}
194-
195-
#[cfg(not(unix))]
196189
fn exec_cmd(cmd: &mut Command) -> io::Result<i32> {
197190
cmd.status().map(|status| status.code().unwrap())
198191
}

0 commit comments

Comments
 (0)