UPDATE - LibDefWriteFailure to accept type instead of formatted string
This follows team’s suggestions in this thread https://rust-lang.zulipchat.com/#narrow/stream/336883-i18n/topic/.23100717.20diag.20translation/near/295305249
This commit is contained in:
parent
4e0de5319c
commit
0a2d7f83cb
@ -666,8 +666,8 @@ impl<'a> Linker for GccLinker<'a> {
|
||||
writeln!(f, "_{}", sym)?;
|
||||
}
|
||||
};
|
||||
if let Err(e) = res {
|
||||
self.sess.emit_fatal(LibDefWriteFailure { error_description: format!("{e}") });
|
||||
if let Err(error) = res {
|
||||
self.sess.emit_fatal(LibDefWriteFailure { error });
|
||||
}
|
||||
} else if is_windows {
|
||||
let res: io::Result<()> = try {
|
||||
@ -681,8 +681,8 @@ impl<'a> Linker for GccLinker<'a> {
|
||||
writeln!(f, " {}", symbol)?;
|
||||
}
|
||||
};
|
||||
if let Err(e) = res {
|
||||
self.sess.emit_fatal(LibDefWriteFailure { error_description: format!("{e}") });
|
||||
if let Err(error) = res {
|
||||
self.sess.emit_fatal(LibDefWriteFailure { error });
|
||||
}
|
||||
} else {
|
||||
// Write an LD version script
|
||||
@ -972,8 +972,8 @@ impl<'a> Linker for MsvcLinker<'a> {
|
||||
writeln!(f, " {}", symbol)?;
|
||||
}
|
||||
};
|
||||
if let Err(e) = res {
|
||||
self.sess.emit_fatal(LibDefWriteFailure { error_description: format!("{e}") });
|
||||
if let Err(error) = res {
|
||||
self.sess.emit_fatal(LibDefWriteFailure { error });
|
||||
}
|
||||
let mut arg = OsString::from("/DEF:");
|
||||
arg.push(path);
|
||||
|
@ -1,6 +1,7 @@
|
||||
//! Errors emitted by codegen_ssa
|
||||
|
||||
use rustc_macros::SessionDiagnostic;
|
||||
use std::io::Error;
|
||||
|
||||
#[derive(SessionDiagnostic)]
|
||||
#[diag(codegen_ssa::missing_native_static_library)]
|
||||
@ -11,5 +12,5 @@ pub struct MissingNativeStaticLibrary<'a> {
|
||||
#[derive(SessionDiagnostic)]
|
||||
#[diag(codegen_ssa::lib_def_write_failure)]
|
||||
pub struct LibDefWriteFailure {
|
||||
pub error_description: String,
|
||||
pub error: Error,
|
||||
}
|
||||
|
@ -1,3 +1,3 @@
|
||||
codegen_ssa_missing_native_static_library = could not find native static library `{$library_name}`, perhaps an -L flag is missing?
|
||||
|
||||
codegen_ssa_lib_def_write_failure = failed to write lib.def file: {$error_description}
|
||||
codegen_ssa_lib_def_write_failure = failed to write lib.def file: {$error}
|
||||
|
Loading…
x
Reference in New Issue
Block a user