@@ -423,7 +423,7 @@ pub struct UnableToRunDsymutil {
423
423
#[ derive( Diagnostic ) ]
424
424
#[ diag( codegen_ssa_stripping_debu_info_failed) ]
425
425
#[ note]
426
- pub struct StrippingDebuInfoFailed < ' a > {
426
+ pub struct StrippingDebugInfoFailed < ' a > {
427
427
pub util : & ' a str ,
428
428
pub status : ExitStatus ,
429
429
pub output : String ,
@@ -485,52 +485,28 @@ pub struct RlibArchiveBuildFailure {
485
485
#[ diag( codegen_ssa_option_gcc_only) ]
486
486
pub struct OptionGccOnly ;
487
487
488
- pub struct ExtractBundledLibsError < ' a > {
489
- pub kind : ExtractBundledLibsErrorKind ,
490
- pub rlib : & ' a Path ,
491
- pub error : String ,
492
- }
488
+ #[ derive( Diagnostic ) ]
489
+ pub enum ExtractBundledLibsError < ' a > {
490
+ #[ diag( codegen_ssa_extract_bundled_libs_open_file) ]
491
+ OpenFile { rlib : & ' a Path , error : String } ,
493
492
494
- pub enum ExtractBundledLibsErrorKind {
495
- OpenFile ,
496
- MmapFile ,
497
- ParseArchive ,
498
- ReadEntry ,
499
- ArchiveMember ,
500
- ConvertName ,
501
- WriteFile ,
502
- }
493
+ #[ diag( codegen_ssa_extract_bundled_libs_mmap_file) ]
494
+ MmapFile { rlib : & ' a Path , error : String } ,
503
495
504
- impl IntoDiagnostic < ' _ , !> for ExtractBundledLibsError < ' _ > {
505
- fn into_diagnostic ( self , handler : & ' _ Handler ) -> DiagnosticBuilder < ' _ , !> {
506
- let mut diag = match self . kind {
507
- ExtractBundledLibsErrorKind :: OpenFile => {
508
- handler. struct_fatal ( fluent:: codegen_ssa_extract_bundled_libs_open_file)
509
- }
510
- ExtractBundledLibsErrorKind :: MmapFile => {
511
- handler. struct_fatal ( fluent:: codegen_ssa_extract_bundled_libs_mmap_file)
512
- }
513
- ExtractBundledLibsErrorKind :: ParseArchive => {
514
- handler. struct_fatal ( fluent:: codegen_ssa_extract_bundled_libs_parse_archive)
515
- }
516
- ExtractBundledLibsErrorKind :: ReadEntry => {
517
- handler. struct_fatal ( fluent:: codegen_ssa_extract_bundled_libs_read_entry)
518
- }
519
- ExtractBundledLibsErrorKind :: ArchiveMember => {
520
- handler. struct_fatal ( fluent:: codegen_ssa_extract_bundled_libs_archive_member)
521
- }
522
- ExtractBundledLibsErrorKind :: ConvertName => {
523
- handler. struct_fatal ( fluent:: codegen_ssa_extract_bundled_libs_convert_name)
524
- }
525
- ExtractBundledLibsErrorKind :: WriteFile => {
526
- handler. struct_fatal ( fluent:: codegen_ssa_extract_bundled_libs_write_file)
527
- }
528
- } ;
496
+ #[ diag( codegen_ssa_extract_bundled_libs_parse_archive) ]
497
+ ParseArchive { rlib : & ' a Path , error : String } ,
529
498
530
- diag. set_arg ( "rlib" , self . rlib ) ;
531
- diag. set_arg ( "error" , self . error ) ;
532
- diag
533
- }
499
+ #[ diag( codegen_ssa_extract_bundled_libs_read_entry) ]
500
+ ReadEntry { rlib : & ' a Path , error : String } ,
501
+
502
+ #[ diag( codegen_ssa_extract_bundled_libs_archive_member) ]
503
+ ArchiveMember { rlib : & ' a Path , error : String } ,
504
+
505
+ #[ diag( codegen_ssa_extract_bundled_libs_convert_name) ]
506
+ ConvertName { rlib : & ' a Path , error : String } ,
507
+
508
+ #[ diag( codegen_ssa_extract_bundled_libs_write_file) ]
509
+ WriteFile { rlib : & ' a Path , error : String } ,
534
510
}
535
511
536
512
#[ derive( Diagnostic ) ]
0 commit comments