File tree Expand file tree Collapse file tree 1 file changed +9
-1
lines changed
Expand file tree Collapse file tree 1 file changed +9
-1
lines changed Original file line number Diff line number Diff line change @@ -495,6 +495,14 @@ impl Toolchain {
495495
496496 fn remove ( & self , dl_params : & DownloadParams ) -> Result < ( ) , Error > {
497497 eprintln ! ( "uninstalling {}" , self ) ;
498+ self . do_remove ( dl_params)
499+ }
500+
501+ /// Removes the (previously installed) bisector rustc described by `dl_params`.
502+ ///
503+ /// The main reason to call this (instead of `fs::remove_dir_all` directly)
504+ /// is to guard against deleting state not managed by `cargo-bisect-rustc`.
505+ fn do_remove ( & self , dl_params : & DownloadParams ) -> Result < ( ) , Error > {
498506 let rustup_name = self . rustup_name ( ) ;
499507
500508 // Guard aginst destroying directories that this tool didn't create.
@@ -711,7 +719,7 @@ impl Toolchain {
711719 . map_err ( InstallError :: TempDir ) ?;
712720 let dest = dl_params. install_dir . join ( self . rustup_name ( ) ) ;
713721 if dl_params. force_install {
714- let _ = fs :: remove_dir_all ( & dest ) ;
722+ let _ = self . do_remove ( dl_params ) ;
715723 }
716724
717725 if dest. is_dir ( ) {
You can’t perform that action at this time.
0 commit comments