rustup-init: Warn user if -c or -t is ignored
If the user specifies the default toolchain of 'none' but also
has specified components or targets then they will be ignored.
As such, warn if this is the case so that people can diagnose
things if their expectations fail.
@@ -758,6 +758,20 @@ fn maybe_install_rust(
// install, so we leave their setup alone.
if toolchain == Some("none") {
info!("skipping toolchain installation");
+ if !components.is_empty() {
+ warn!(
+ "ignoring requested component{}: {}",
+ if components.len() == 1 { "" } else { "s" },
+ components.join(", ")
+ );
+ }
+ if !targets.is_empty() {
+ warn!(
+ "ignoring requested target{}: {}",
+ if targets.len() == 1 { "" } else { "s" },
+ targets.join(", ")
+ );
+ }
println!();
} else if user_specified_something || cfg.find_default()?.is_none() {
let toolchain_str = toolchain.unwrap_or("stable");
