Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 10 additions & 5 deletions src/errors.rs
Original file line number Diff line number Diff line change
Expand Up @@ -351,11 +351,16 @@ error_chain! {
}
UnknownComponent(t: String, c: String, s: Option<String>) {
description("toolchain does not contain component")
display("toolchain '{}' does not contain component {}{}", t, c, if let Some(suggestion) = s {
format!("; did you mean '{}'?", suggestion)
} else {
"".to_string()
})
display("toolchain '{}' does not contain component {}{}{}", t, c, if let Some(suggestion) = s {
format!("; did you mean '{}'?", suggestion)
} else {
"".to_string()
}, if c.contains("rust-std") {
format!("\nnote: not all platforms have the standard library pre-compiled: https://doc.rust-lang.org/nightly/rustc/platform-support.html{}",
if t.contains("nightly") { "\nhelp: consider using `cargo build -Z build-std` instead" } else { "" }
)
} else { "".to_string() }
)
}
UnknownProfile(p: String) {
description("unknown profile name")
Expand Down
4 changes: 3 additions & 1 deletion tests/cli-v2.rs
Original file line number Diff line number Diff line change
Expand Up @@ -784,7 +784,9 @@ fn add_target_bogus() {
expect_err(
config,
&["rustup", "target", "add", "bogus"],
"does not contain component 'rust-std' for target 'bogus'",
"does not contain component 'rust-std' for target 'bogus'\n\
note: not all platforms have the standard library pre-compiled: https://doc.rust-lang.org/nightly/rustc/platform-support.html\n\
help: consider using `cargo build -Z build-std` instead",
);
});
}
Expand Down