-
Notifications
You must be signed in to change notification settings - Fork 2.6k
fix: Suggest similar looking feature names when feature is missing #15454
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
Conversation
r? @weihanglo rustbot has assigned @weihanglo. Use |
@@ -280,6 +280,7 @@ fn dependency_activates_typoed_feature() { | |||
versions that meet the requirements `*` are: 0.0.1 | |||
|
|||
package `foo` depends on `bar` with feature `bar` but `bar` does not have that feature. | |||
package `bar` does have feature `baz` |
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.
Is the leading space intentional?
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.
Other clauses have a context line like this with a single leading space.
Its weird. It seems like it should be one of 0, 2, or 4 spaces but I didn't feel like following up what the intent was.
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.
As you've tweaked the message already, do you also want to address that in the same PR?
We can also do it in a follow up. I am fine with either.
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.
Merging now to get the incremental improvement rather than blocking on figuring out what the intended indentation is.
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.
@Eh2406 when back from vacation, if you'd be willing to look at these errors and let us know what you think would work well, I'd appreciate it.
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.
My previous comment is just a nit. Feel free to merge this whenever you feel good :)
@@ -280,6 +280,7 @@ fn dependency_activates_typoed_feature() { | |||
versions that meet the requirements `*` are: 0.0.1 | |||
|
|||
package `foo` depends on `bar` with feature `bar` but `bar` does not have that feature. | |||
package `bar` does have feature `baz` |
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.
As you've tweaked the message already, do you also want to address that in the same PR?
We can also do it in a follow up. I am fine with either.
Update cargo 10 commits in d811228b14ae2707323f37346aee3f4147e247e6..7918c7eb59614c39f1c4e27e99d557720976bdd7 2025-04-15 15:18:42 +0000 to 2025-04-27 09:44:23 +0000 - overriding-dependencies.md: better readability (rust-lang/cargo#15459) - source-replacement.md: fix typo (rust-lang/cargo#15458) - Stabilize automatic garbage collection. (rust-lang/cargo#14287) - Update doctest xcompile flags (rust-lang/cargo#15455) - fix: Suggest similar looking feature names when feature is missing (rust-lang/cargo#15454) - fix(unit-graph): switch to Package ID Spec (rust-lang/cargo#15447) - chore(deps): update cargo-semver-checks to v0.41.0 (rust-lang/cargo#15446) - Implement RFC3695: Allow boolean literals as cfg predicates (rust-lang/cargo#14649) - chore: remove duplicate word in comment (rust-lang/cargo#15437) - Fix formatting of CliUnstable parsing (rust-lang/cargo#15434) r? ghost
What does this PR try to resolve?
I recently depended on a package with
preserve-order
rather thanpreserve_order
and the error message didn't help me with the problem so I figure I'd fix that. I also found other improvements along the wayMissingFeature
string only has one feature in it was important for doing aclosest
match on the feature).How should we test and review this PR?
Additional information