diff --git a/src/bin/cargo/main.rs b/src/bin/cargo/main.rs index d36e8243f..062ab30f4 100644 --- a/src/bin/cargo/main.rs +++ b/src/bin/cargo/main.rs @@ -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); diff --git a/tests/testsuite/cargo_command.rs b/tests/testsuite/cargo_command.rs index 8ff7dcfda..79c958972 100644 --- a/tests/testsuite/cargo_command.rs +++ b/tests/testsuite/cargo_command.rs @@ -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();