fix(cli): Don't use 'did you mean' for +toolchain errors

This commit is contained in:
Ed Page 2025-02-03 10:37:53 -06:00
parent 3f48c221b9
commit 759178e42b
2 changed files with 2 additions and 4 deletions

View File

@ -289,8 +289,7 @@ fn execute_external_subcommand(gctx: &GlobalContext, cmd: &str, args: &[&OsStr])
let err = if cmd.starts_with('+') {
anyhow::format_err!(
"no such command: `{cmd}`\n\n\t\
Cargo does not handle `+toolchain` directives.\n\t\
Did you mean to invoke `cargo` through `rustup` instead?{script_suggestion}",
help: invoke `cargo` through `rustup` to handle `+toolchain` directives{script_suggestion}",
)
} else {
let suggestions = list_commands(gctx);

View File

@ -549,8 +549,7 @@ fn subcommand_leading_plus_output_contains() {
.with_stderr_data(str![[r#"
[ERROR] no such command: `+nightly`
Cargo does not handle `+toolchain` directives.
Did you mean to invoke `cargo` through `rustup` instead?
[HELP] invoke `cargo` through `rustup` to handle `+toolchain` directives
"#]])
.run();