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 {
495
495
496
496
fn remove ( & self , dl_params : & DownloadParams ) -> Result < ( ) , Error > {
497
497
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 > {
498
506
let rustup_name = self . rustup_name ( ) ;
499
507
500
508
// Guard aginst destroying directories that this tool didn't create.
@@ -711,7 +719,7 @@ impl Toolchain {
711
719
. map_err ( InstallError :: TempDir ) ?;
712
720
let dest = dl_params. install_dir . join ( self . rustup_name ( ) ) ;
713
721
if dl_params. force_install {
714
- let _ = fs :: remove_dir_all ( & dest ) ;
722
+ let _ = self . do_remove ( dl_params ) ;
715
723
}
716
724
717
725
if dest. is_dir ( ) {
You can’t perform that action at this time.
0 commit comments