@@ -6,10 +6,6 @@ use std::io::{BufRead, BufReader, BufWriter, Write};
66use std:: path:: { Path , PathBuf } ;
77use std:: { env, io} ;
88
9- fn src_hotfix_dir ( ) -> PathBuf {
10- Path :: new ( & env:: var_os ( "OUT_DIR" ) . unwrap ( ) ) . join ( "src-hotfix" )
11- }
12-
139fn do_cc ( ) {
1410 let target = env:: var ( "TARGET" ) . unwrap ( ) ;
1511 if cfg ! ( unix) || target. contains ( "cygwin" ) {
@@ -73,15 +69,6 @@ fn do_ctest() {
7369 }
7470}
7571
76- #[ expect( unused) ]
77- fn ctest_old_cfg ( ) -> ctest_old:: TestGenerator {
78- let mut cfg = ctest_old:: TestGenerator :: new ( ) ;
79- let libc_cfgs = [ "libc_thread_local" ] ;
80- for f in & libc_cfgs {
81- cfg. cfg ( f, None ) ;
82- }
83- cfg
84- }
8572fn ctest_cfg ( ) -> ctest:: TestGenerator {
8673 let mut cfg = ctest:: TestGenerator :: new ( ) ;
8774 cfg. skip_private ( true ) ;
@@ -170,39 +157,11 @@ fn main() {
170157 // Avoid unnecessary re-building.
171158 println ! ( "cargo:rerun-if-changed=build.rs" ) ;
172159
173- let hotfix_dir = src_hotfix_dir ( ) ;
174- if std:: fs:: exists ( & hotfix_dir) . unwrap ( ) {
175- std:: fs:: remove_dir_all ( & hotfix_dir) . unwrap ( ) ;
176- }
177-
178- // FIXME(ctest): ctest2 cannot parse `crate::` in paths, so replace them with `::`
179- let re = regex:: bytes:: Regex :: new ( r"(?-u:\b)crate::" ) . unwrap ( ) ;
180- copy_dir_hotfix ( Path :: new ( "../src" ) , & hotfix_dir, & re, b"::" ) ;
181-
182160 do_cc ( ) ;
183161 do_ctest ( ) ;
184162 do_semver ( ) ;
185163}
186164
187- // FIXME(clippy): removing `replace` somehow fails the `Test tier1 (x86_64-pc-windows-msvc, windows-2022)` CI job
188- #[ allow( clippy:: only_used_in_recursion) ]
189- fn copy_dir_hotfix ( src : & Path , dst : & Path , regex : & regex:: bytes:: Regex , replace : & [ u8 ] ) {
190- std:: fs:: create_dir ( dst) . unwrap ( ) ;
191- for entry in src. read_dir ( ) . unwrap ( ) {
192- let entry = entry. unwrap ( ) ;
193- let src_path = entry. path ( ) ;
194- let dst_path = dst. join ( entry. file_name ( ) ) ;
195- if entry. file_type ( ) . unwrap ( ) . is_dir ( ) {
196- copy_dir_hotfix ( & src_path, & dst_path, regex, replace) ;
197- } else {
198- // Replace "crate::" with "::"
199- let src_data = std:: fs:: read ( & src_path) . unwrap ( ) ;
200- let dst_data = regex. replace_all ( & src_data, b"::" ) ;
201- std:: fs:: write ( & dst_path, & dst_data) . unwrap ( ) ;
202- }
203- }
204- }
205-
206165macro_rules! headers {
207166 ( $cfg: ident: [ $m: expr] : $header: literal) => {
208167 if $m {
0 commit comments