use object::read::macho::FatArch;
use crate::common;
+use crate::errors::ErrorCreatingImportLibrary;
use crate::llvm::archive_ro::{ArchiveRO, Child};
use crate::llvm::{self, ArchiveKind, LLVMMachineType, LLVMRustCOFFShortExport};
use rustc_codegen_ssa::back::archive::{ArchiveBuilder, ArchiveBuilderBuilder};
};
if result == crate::llvm::LLVMRustResult::Failure {
- sess.fatal(&format!(
- "Error creating import library for {}: {}",
+ sess.emit_fatal(ErrorCreatingImportLibrary {
lib_name,
- llvm::last_error().unwrap_or("unknown LLVM error".to_string())
- ));
+ error: llvm::last_error().unwrap_or("unknown LLVM error".to_string()),
+ });
}
};
use rustc_errors::fluent;
use rustc_errors::DiagnosticBuilder;
+use rustc_macros::SessionDiagnostic;
use rustc_session::SessionDiagnostic;
pub(crate) enum UnknownCTargetFeature<'a> {
}
}
}
+
+#[derive(SessionDiagnostic)]
+#[diag(codegen_llvm::error_creating_import_library)]
+pub(crate) struct ErrorCreatingImportLibrary<'a> {
+ pub lib_name: &'a str,
+ pub error: String,
+}