Skip to content

Commit 36bc1f9

Browse files
committed
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. Signed-off-by: Daniel Silverstone <[email protected]>
1 parent b3ba955 commit 36bc1f9

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

src/cli/self_update.rs

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -758,6 +758,20 @@ fn maybe_install_rust(
758758
// install, so we leave their setup alone.
759759
if toolchain == Some("none") {
760760
info!("skipping toolchain installation");
761+
if !components.is_empty() {
762+
warn!(
763+
"ignoring requested component{}: {}",
764+
if components.len() == 1 { "" } else { "s" },
765+
components.join(", ")
766+
);
767+
}
768+
if !targets.is_empty() {
769+
warn!(
770+
"ignoring requested target{}: {}",
771+
if targets.len() == 1 { "" } else { "s" },
772+
targets.join(", ")
773+
);
774+
}
761775
println!();
762776
} else if user_specified_something || cfg.find_default()?.is_none() {
763777
let toolchain_str = toolchain.unwrap_or("stable");

0 commit comments

Comments
 (0)