@@ -571,9 +571,10 @@ actual:\n\
571571 }
572572 }
573573
574- _=> {
575- let rust_src_root = self . find_rust_src_root ( )
576- . expect ( "Could not find Rust source root" ) ;
574+ _ => {
575+ let rust_src_root = self . config . find_rust_src_root ( ) . expect (
576+ "Could not find Rust source root" ,
577+ ) ;
577578 let rust_pp_module_rel_path = Path :: new ( "./src/etc" ) ;
578579 let rust_pp_module_abs_path = rust_src_root. join ( rust_pp_module_rel_path)
579580 . to_str ( )
@@ -664,19 +665,6 @@ actual:\n\
664665 self . check_debugger_output ( & debugger_run_result, & check_lines) ;
665666 }
666667
667- fn find_rust_src_root ( & self ) -> Option < PathBuf > {
668- let mut path = self . config . src_base . clone ( ) ;
669- let path_postfix = Path :: new ( "src/etc/lldb_batchmode.py" ) ;
670-
671- while path. pop ( ) {
672- if path. join ( & path_postfix) . is_file ( ) {
673- return Some ( path) ;
674- }
675- }
676-
677- None
678- }
679-
680668 fn run_debuginfo_lldb_test ( & self ) {
681669 assert ! ( self . revision. is_none( ) , "revisions not relevant here" ) ;
682670
@@ -735,7 +723,9 @@ actual:\n\
735723 script_str. push_str ( "version\n " ) ;
736724
737725 // Switch LLDB into "Rust mode"
738- let rust_src_root = self . find_rust_src_root ( ) . expect ( "Could not find Rust source root" ) ;
726+ let rust_src_root = self . config . find_rust_src_root ( ) . expect (
727+ "Could not find Rust source root" ,
728+ ) ;
739729 let rust_pp_module_rel_path = Path :: new ( "./src/etc/lldb_rust_formatters.py" ) ;
740730 let rust_pp_module_abs_path = rust_src_root. join ( rust_pp_module_rel_path)
741731 . to_str ( )
@@ -1717,11 +1707,13 @@ actual:\n\
17171707 if self . props . check_test_line_numbers_match {
17181708 self . check_rustdoc_test_option ( proc_res) ;
17191709 } else {
1720- let root = self . find_rust_src_root ( ) . unwrap ( ) ;
1721- let res = self . cmd2procres ( Command :: new ( & self . config . docck_python )
1722- . arg ( root. join ( "src/etc/htmldocck.py" ) )
1723- . arg ( out_dir)
1724- . arg ( & self . testpaths . file ) ) ;
1710+ let root = self . config . find_rust_src_root ( ) . unwrap ( ) ;
1711+ let res = self . cmd2procres (
1712+ Command :: new ( & self . config . docck_python )
1713+ . arg ( root. join ( "src/etc/htmldocck.py" ) )
1714+ . arg ( out_dir)
1715+ . arg ( & self . testpaths . file ) ,
1716+ ) ;
17251717 if !res. status . success ( ) {
17261718 self . fatal_proc_rec ( "htmldocck failed!" , & res) ;
17271719 }
0 commit comments