Skip to content

Commit 1e0a497

Browse files
committed
Improved warning/error message for check_existence_of_rustc_or_cargo_in_path.
1 parent ac5105f commit 1e0a497

File tree

2 files changed

+9
-8
lines changed

2 files changed

+9
-8
lines changed

src/cli/self_update.rs

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -391,12 +391,13 @@ fn check_existence_of_rustc_or_cargo_in_path(no_prompt: bool) -> Result<()> {
391391
}
392392

393393
if let Err(path) = rustc_or_cargo_exists_in_path() {
394-
err!("it looks like you have an existing installation of Rust at:");
395-
err!("{}", path);
396-
err!("rustup should not be installed alongside Rust. Please uninstall your existing Rust first.");
397-
err!("Otherwise you may have confusion unless you are careful with your PATH");
398-
err!("If you are sure that you want both rustup and your already installed Rust");
399-
err!("then please restart the installation and pass `-y' to bypass this check.");
394+
warn!("it looks like you have an existing installation of Rust at:");
395+
warn!("{}", path);
396+
warn!("rustup should not be installed alongside Rust. Please uninstall your existing Rust first.");
397+
warn!("Otherwise you may have confusion unless you are careful with your PATH");
398+
warn!("If you are sure that you want both rustup and your already installed Rust");
399+
warn!("then please reply `y' or `yes' or set RUSTUP_INIT_SKIP_PATH_CHECK to yes");
400+
warn!("or pass `-y' to ignore all ignorable checks.");
400401
ignorable_error("cannot install while Rust is installed".into(), no_prompt)?;
401402
}
402403
Ok(())

tests/cli-misc.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -620,7 +620,7 @@ fn install_stops_if_rustc_exists() {
620620
.contains("it looks like you have an existing installation of Rust at:"));
621621
assert!(out
622622
.stderr
623-
.contains("restart the installation and pass `-y'"));
623+
.contains("If you are sure that you want both rustup and your already installed Rust"));
624624
});
625625
}
626626

@@ -652,7 +652,7 @@ fn install_stops_if_cargo_exists() {
652652
.contains("it looks like you have an existing installation of Rust at:"));
653653
assert!(out
654654
.stderr
655-
.contains("restart the installation and pass `-y'"));
655+
.contains("If you are sure that you want both rustup and your already installed Rust"));
656656
});
657657
}
658658

0 commit comments

Comments
 (0)