-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
Suggest similar feature names on CLI #15133
Conversation
Thanks for the pull request, and welcome! The Rust team is excited to review your changes, and you should hear from @weihanglo (or someone else) some time within the next two weeks. Please see the contribution instructions for more information. Namely, in order to ensure the minimum review times lag, PR authors and assigned reviewers should ensure that the review label (
|
@rustbot label A-diagnostics -A-dependency-resolution |
Thanks for adding this! |
Does rustbot know something I don't? If it insists on that label, I'm not going to fight it. |
It's because you're editing files within the resolver. Don't worry about it. |
Can you restructure your PR
|
7b9140f
to
3d30671
Compare
Could you clean up the commits for how you'd want them merged? |
FYI you'll need to rebase on top of #15138 (this PR inspired it but I didn't expect it to get in first) |
3948ad7
to
c5444d0
Compare
The left-aligned error message is there to workaround rustfmt refusing to format files which contain string literals which are too wide. I have not found a consistent way to fix this behaviour, but left-aligning does resolve it in this case. I believe that this should have an explanatory comment, but code review determined that to be "noise" and so I removed it.
32ea0cd
to
378f021
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks! This is a great improvement to our error reporting! Thank you for your patience through the code review process (and the semantic merge conflicts)
Update cargo 14 commits in 0e3d73849ab8cbbab3ec5c65cbd555586cb21339..2928e32734b04925ee51e1ae88bea9a83d2fd451 2025-02-01 20:14:40 +0000 to 2025-02-07 16:50:22 +0000 - Simplify backtrack (rust-lang/cargo#15150) - Don't use on Solaris libc::LOCK_* which were removed from libc in ver… (rust-lang/cargo#15143) - feat: emit error if package not found within workspace (rust-lang/cargo#15071) - Make cache tracking resilient to unexpected files (rust-lang/cargo#15147) - Small resolver cleanups (rust-lang/cargo#15040) - feat: add `cargo pkgid` support for cargo-script (rust-lang/cargo#14961) - Suggest similar feature names on CLI (rust-lang/cargo#15133) - fix: Don't use "did you mean" in errors (rust-lang/cargo#15138) - Fix changelog link (rust-lang/cargo#15142) - chore(deps): update rust crate rand to 0.9.0 (rust-lang/cargo#15129) - Remove the original changelog (rust-lang/cargo#15123) - chore(deps): update rust crate gix to 0.70.0 (rust-lang/cargo#15128) - allow windows reserved names in CI (rust-lang/cargo#15135) - removed a word that was repeated (rust-lang/cargo#15136)
What does this PR try to resolve?
When you typo a feature name on the CLI, the error message isn't very helpful. Concretely, I was testing a PR which adds a feature called
cosmic_text
to enable acosmic-text
dependency, and got a correct but unhelpful error message:I had to dig into the Cargo.lock file to find out how to fix this.
How should we test and review this PR?
Observe the new test cases