mirror of
https://github.com/rust-lang/rust.git
synced 2025-02-02 10:04:23 +00:00
rollup merge of #21333: stepancheg/trans-write-diag
File cannot be written, for example, if directory does not exist. Before this commit: ``` % rustc -o nonexistent/program program.rs error: could not write output: No such file or directory ``` With this commit: ``` % rustc -o nonexistent/program program.rs error: could not write output to nonexistent/program.0.o: No such file or directory ``` This is useful when full rust command is not displayed, or when last error is followed by thousands of warnings.
This commit is contained in:
commit
5da25386b3
@ -67,11 +67,11 @@ pub fn write_output_file(
|
||||
output: &Path,
|
||||
file_type: llvm::FileType) {
|
||||
unsafe {
|
||||
let output = CString::from_slice(output.as_vec());
|
||||
let output_c = CString::from_slice(output.as_vec());
|
||||
let result = llvm::LLVMRustWriteOutputFile(
|
||||
target, pm, m, output.as_ptr(), file_type);
|
||||
target, pm, m, output_c.as_ptr(), file_type);
|
||||
if !result {
|
||||
llvm_err(handler, "could not write output".to_string());
|
||||
llvm_err(handler, format!("could not write output to {}", output.display()));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user