There are already a number of pre-install sanity checks (in do_pre_install_sanity_checks) that there's no existing install. They don't catch every type of rust installation though.
Add another pre install check that iterates over the path looking for cargo and rustc, printing an error if it finds them, but only if they are not in the destination .cargo/bin, and only if the -y (no_prompt) flag is not set. The error should indicate that -y will override the error, like the anti_sudo check.
There are already a number of pre-install sanity checks (in
do_pre_install_sanity_checks) that there's no existing install. They don't catch every type of rust installation though.Add another pre install check that iterates over the path looking for cargo and rustc, printing an error if it finds them, but only if they are not in the destination .cargo/bin, and only if the
-y(no_prompt) flag is not set. The error should indicate that-ywill override the error, like the anti_sudo check.