Skip to content

Commit 00cff91

Browse files
authored
Merge pull request #2155 from kinnison/improve-preinstalled-rust-message
Improve preinstalled rust message
2 parents 47ddb31 + b9e36fb commit 00cff91

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
lines changed

src/cli/self_update.rs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -385,8 +385,10 @@ fn check_existence_of_rustc_or_cargo_in_path(no_prompt: bool) -> Result<()> {
385385
if let Err(path) = rustc_or_cargo_exists_in_path() {
386386
err!("it looks like you have an existing installation of Rust at:");
387387
err!("{}", path);
388-
err!("rustup cannot be installed alongside Rust. Please uninstall first");
389-
err!("if this is what you want, restart the installation with `-y'");
388+
err!("rustup should not be installed alongside Rust. Please uninstall your existing Rust first.");
389+
err!("Otherwise you may have confusion unless you are careful with your PATH");
390+
err!("If you are sure that you want both rustup and your already installed Rust");
391+
err!("then please restart the installation and pass `-y' to bypass this check.");
390392
Err("cannot install while Rust is installed".into())
391393
} else {
392394
Ok(())

tests/cli-misc.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -619,7 +619,7 @@ fn install_stops_if_rustc_exists() {
619619
.contains("it looks like you have an existing installation of Rust at:"));
620620
assert!(out
621621
.stderr
622-
.contains("if this is what you want, restart the installation with `-y'"));
622+
.contains("restart the installation and pass `-y'"));
623623
});
624624
}
625625

@@ -651,7 +651,7 @@ fn install_stops_if_cargo_exists() {
651651
.contains("it looks like you have an existing installation of Rust at:"));
652652
assert!(out
653653
.stderr
654-
.contains("if this is what you want, restart the installation with `-y'"));
654+
.contains("restart the installation and pass `-y'"));
655655
});
656656
}
657657

0 commit comments

Comments
 (0)