@@ -53,7 +53,7 @@ use rustc_target::spec::{
5353} ;
5454use tracing:: { debug, info, warn} ;
5555
56- use super :: archive:: { ArchiveBuilder , ArchiveBuilderBuilder , ArchiveEntryKind } ;
56+ use super :: archive:: { AddArchiveKind , ArchiveBuilder , ArchiveBuilderBuilder , ArchiveEntryKind } ;
5757use super :: command:: Command ;
5858use super :: linker:: { self , Linker } ;
5959use super :: metadata:: { MetadataPosition , create_wrapper_file} ;
@@ -419,7 +419,7 @@ fn link_rlib<'a>(
419419 packed_bundled_libs. push ( wrapper_file) ;
420420 } else {
421421 let path = find_native_static_library ( lib. name . as_str ( ) , lib. verbatim , sess) ;
422- ab. add_archive ( & path, None ) . unwrap_or_else ( |error| {
422+ ab. add_archive ( & path, AddArchiveKind :: Other ) . unwrap_or_else ( |error| {
423423 sess. dcx ( ) . emit_fatal ( errors:: AddNativeLibrary { library_path : path, error } )
424424 } ) ;
425425 }
@@ -436,7 +436,7 @@ fn link_rlib<'a>(
436436 tmpdir. as_ref ( ) ,
437437 true ,
438438 ) {
439- ab. add_archive ( & output_path, None ) . unwrap_or_else ( |error| {
439+ ab. add_archive ( & output_path, AddArchiveKind :: Other ) . unwrap_or_else ( |error| {
440440 sess. dcx ( )
441441 . emit_fatal ( errors:: AddNativeLibrary { library_path : output_path, error } ) ;
442442 } ) ;
@@ -529,7 +529,7 @@ fn link_staticlib(
529529 let bundled_libs: FxIndexSet < _ > = native_libs. filter_map ( |lib| lib. filename ) . collect ( ) ;
530530 ab. add_archive (
531531 path,
532- Some ( Box :: new ( move |fname : & str , entry_kind| {
532+ AddArchiveKind :: Rlib ( & |fname : & str , entry_kind| {
533533 // Ignore metadata and rmeta-link files.
534534 if fname == METADATA_FILENAME || fname == rmeta_link:: FILENAME {
535535 return true ;
@@ -546,7 +546,7 @@ fn link_staticlib(
546546 }
547547
548548 false
549- } ) ) ,
549+ } ) ,
550550 )
551551 . unwrap ( ) ;
552552
@@ -557,7 +557,7 @@ fn link_staticlib(
557557 for filename in relevant_libs. iter ( ) {
558558 let joined = tempdir. as_ref ( ) . join ( filename. as_str ( ) ) ;
559559 let path = joined. as_path ( ) ;
560- ab. add_archive ( path, None ) . unwrap ( ) ;
560+ ab. add_archive ( path, AddArchiveKind :: Other ) . unwrap ( ) ;
561561 }
562562
563563 all_native_libs. extend ( crate_info. native_libraries [ & cnum] . iter ( ) . cloned ( ) ) ;
@@ -3240,7 +3240,7 @@ fn add_static_crate(
32403240 let mut archive = archive_builder_builder. new_archive_builder ( sess) ;
32413241 if let Err ( error) = archive. add_archive (
32423242 cratepath,
3243- Some ( Box :: new ( move |f, entry_kind| {
3243+ AddArchiveKind :: Rlib ( & |f, entry_kind| {
32443244 if f == METADATA_FILENAME || f == rmeta_link:: FILENAME {
32453245 return true ;
32463246 }
@@ -3266,7 +3266,7 @@ fn add_static_crate(
32663266 }
32673267
32683268 false
3269- } ) ) ,
3269+ } ) ,
32703270 ) {
32713271 sess. dcx ( )
32723272 . emit_fatal ( errors:: RlibArchiveBuildFailure { path : cratepath. clone ( ) , error } ) ;
0 commit comments