File tree Expand file tree Collapse file tree 3 files changed +12
-3
lines changed
rustc_error_messages/locales/en-US Expand file tree Collapse file tree 3 files changed +12
-3
lines changed Original file line number Diff line number Diff line change 11use super :: command:: Command ;
22use super :: symbol_export;
3+ use crate :: errors:: LibDefWriteFailure ;
34use rustc_span:: symbol:: sym;
45
56use std:: ffi:: { OsStr , OsString } ;
@@ -666,7 +667,7 @@ impl<'a> Linker for GccLinker<'a> {
666667 }
667668 } ;
668669 if let Err ( e) = res {
669- self . sess . fatal ( & format ! ( "failed to write lib.def file: {}" , e ) ) ;
670+ self . sess . emit_fatal ( LibDefWriteFailure { error_description : format ! ( "{e}" ) } ) ;
670671 }
671672 } else if is_windows {
672673 let res: io:: Result < ( ) > = try {
@@ -681,7 +682,7 @@ impl<'a> Linker for GccLinker<'a> {
681682 }
682683 } ;
683684 if let Err ( e) = res {
684- self . sess . fatal ( & format ! ( "failed to write list.def file: {}" , e ) ) ;
685+ self . sess . emit_fatal ( LibDefWriteFailure { error_description : format ! ( "{e}" ) } ) ;
685686 }
686687 } else {
687688 // Write an LD version script
@@ -972,7 +973,7 @@ impl<'a> Linker for MsvcLinker<'a> {
972973 }
973974 } ;
974975 if let Err ( e) = res {
975- self . sess . fatal ( & format ! ( "failed to write lib.def file: {}" , e ) ) ;
976+ self . sess . emit_fatal ( LibDefWriteFailure { error_description : format ! ( "{e}" ) } ) ;
976977 }
977978 let mut arg = OsString :: from ( "/DEF:" ) ;
978979 arg. push ( path) ;
Original file line number Diff line number Diff line change @@ -7,3 +7,9 @@ use rustc_macros::SessionDiagnostic;
77pub struct MissingNativeStaticLibrary < ' a > {
88 pub library_name : & ' a str ,
99}
10+
11+ #[ derive( SessionDiagnostic ) ]
12+ #[ diag( codegen_ssa:: lib_def_write_failure) ]
13+ pub struct LibDefWriteFailure {
14+ pub error_description : String ,
15+ }
Original file line number Diff line number Diff line change 11codegen_ssa_missing_native_static_library = could not find native static library `{ $library_name } `, perhaps an -L flag is missing?
2+
3+ codegen_ssa_lib_def_write_failure = failed to write lib.def file: { $error_description }
You can’t perform that action at this time.
0 commit comments