Migrate run-make/allow-warnings-cmdline-stability to rmake.rs by GuillaumeGomez · Pull Request #125573 · rust-lang/rust (original) (raw)

Suggestion: I think this can be run() instead of command_output(), because run() provided by impl_common_helpers!(Rustc) is

/// Run the constructed command and assert that it is successfully run. #[track_caller] pub fn run(&mut self) -> ::std::process::Output { let caller_location = ::std::panic::Location::caller(); let caller_line_number = caller_location.line();

let output = self.command_output();
if !output.status.success() {
    handle_failed_output(&self.cmd, output, caller_line_number);
}
output

}

i.e. just

let output = rustc().input("foo.rs").arg("-Awarnings").run();