Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Don't use "did you mean" in errors #15138

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

epage
Copy link
Contributor

@epage epage commented Feb 3, 2025

What does this PR try to resolve?

This is an attempt at moving Cargo closer to rustc's diagnostic guide (clap already did this)

Suggestions should not be a question. In particular, language like "did you mean" should be avoided. Sometimes, it's unclear why a particular suggestion is being made. In these cases, it's better to be upfront about what the suggestion is.

Compare "did you mean: Foo" vs. "there is a struct with a similar name: Foo".

How should we test and review this PR?

Additional information

I did leave behind three "did you mean"s as I was a little less sure in how to handle them

@rustbot
Copy link
Collaborator

rustbot commented Feb 3, 2025

r? @weihanglo

rustbot has assigned @weihanglo.
They will have a look at your PR within the next two weeks and either review your PR or reassign to another reviewer.

Use r? to explicitly pick a reviewer

@rustbot rustbot added A-cargo-targets Area: selection and definition of targets (lib, bins, examples, tests, benches) A-cli Area: Command-line interface, option parsing, etc. A-manifest Area: Cargo.toml issues A-profiles Area: profiles Command-clean Command-run S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Feb 3, 2025
@@ -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
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we take this chance to remove tabs here and other places?
help: ... looks a bit odd with a leading tab.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-cargo-targets Area: selection and definition of targets (lib, bins, examples, tests, benches) A-cli Area: Command-line interface, option parsing, etc. A-manifest Area: Cargo.toml issues A-profiles Area: profiles Command-clean Command-run S-waiting-on-review Status: Awaiting review from the assignee but also interested parties.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants