@@ -12,6 +12,7 @@ use object::{Object, ObjectSymbol, Symbol, SymbolKind, SymbolScope, SymbolSectio
12
12
use serde_json:: Value ;
13
13
14
14
const CHECK_LIBRARIES : & [ & str ] = & [ "compiler_builtins" , "builtins_test_intrinsics" ] ;
15
+ const CHECK_EXTENSIONS : & [ Option < & str > ] = & [ Some ( "rlib" ) , Some ( "a" ) , Some ( "exe" ) , None ] ;
15
16
16
17
const USAGE : & str = "Usage:
17
18
@@ -55,7 +56,7 @@ fn exec_cargo_with_args(args: &[&str]) -> Vec<PathBuf> {
55
56
56
57
let stdout = cmd. stdout . take ( ) . unwrap ( ) ;
57
58
let reader = BufReader :: new ( stdout) ;
58
- let mut rlibs = Vec :: new ( ) ;
59
+ let mut check_files = Vec :: new ( ) ;
59
60
60
61
for line in reader. lines ( ) {
61
62
let line = line. expect ( "failed to read line" ) ;
@@ -72,22 +73,22 @@ fn exec_cargo_with_args(args: &[&str]) -> Vec<PathBuf> {
72
73
let path = fpath. as_str ( ) . expect ( "file name not a string" ) ;
73
74
let path = PathBuf :: from ( path) ;
74
75
75
- if path. extension ( ) . is_some_and ( |ex| ex == "rlib" ) {
76
+ if CHECK_EXTENSIONS . contains ( & path. extension ( ) . map ( |ex| ex. to_str ( ) . unwrap ( ) ) ) {
76
77
let fname = path. file_name ( ) . unwrap ( ) . to_str ( ) . unwrap ( ) ;
77
78
78
79
if CHECK_LIBRARIES . iter ( ) . any ( |lib| fname. contains ( lib) ) {
79
- rlibs . push ( path) ;
80
+ check_files . push ( path) ;
80
81
}
81
82
}
82
83
}
83
84
}
84
85
85
86
cmd. wait ( ) . expect ( "failed to wait on Cargo" ) ;
86
87
87
- assert ! ( !rlibs . is_empty( ) , "no compiler_builtins rlibs found" ) ;
88
- println ! ( "Collected the following rlibs to check: {rlibs :#?}" ) ;
88
+ assert ! ( !check_files . is_empty( ) , "no compiler_builtins rlibs found" ) ;
89
+ println ! ( "Collected the following rlibs to check: {check_files :#?}" ) ;
89
90
90
- rlibs
91
+ check_files
91
92
}
92
93
93
94
#[ expect( unused) ] // only for printing
0 commit comments