Provide a better error message when mixing dep: with /#11172
Provide a better error message when mixing dep: with /#11172bors merged 1 commit intorust-lang:masterfrom
Conversation
|
r? @weihanglo (rust-highfive has picked a reviewer for you, use r? to override) |
weihanglo
left a comment
There was a problem hiding this comment.
This patch looks fine to me. Thank you!
One question. Should Cargo errors out earlier in FeatureValue::new if there is a syntax error? It might lose some contexts to provide a good error message, but I found that FeatureValue::new is used in multiple places. Does it deserve a consistent validation logic throughout?
|
Semi-related to this issue. Some other cases emit confusing error messages are:
Should we handle this in the follow-up? |
|
It might be better to have As for the other invalid forms, it probably wouldn't hurt to have better error messages for those. I don't expect users to enter an invalid form like those, so I don't think it is important. But if someone wants to add more checks, I think that would be fine. |
|
Make sense. Thank you! @bors r+ |
|
☀️ Test successful - checks-actions |
8 commits in f5fed93ba24607980647962c59863bbabb03ce14..0b84a35c2c7d70df4875a03eb19084b0e7a543ef 2022-09-27 12:03:57 +0000 to 2022-10-03 19:13:21 +0000 - Provide a better error message when mixing dep: with / (rust-lang/cargo#11172) - Remove lingering unstable flag `-Zfeatures` (rust-lang/cargo#11168) - Tweak wording (rust-lang/cargo#11164) - Expose libgit2-sys/vendored feature as vendored-libgit2 (rust-lang/cargo#11162) - refactor(cli): Upgrade to clap v4 (rust-lang/cargo#11159) - Expose guide to adding a new edition as rustdoc (rust-lang/cargo#11157) - Remove `multitarget` from -Zhelp (rust-lang/cargo#11158) - Remove outdated comments (rust-lang/cargo#11155)
Update cargo 8 commits in f5fed93ba24607980647962c59863bbabb03ce14..0b84a35c2c7d70df4875a03eb19084b0e7a543ef 2022-09-27 12:03:57 +0000 to 2022-10-03 19:13:21 +0000 - Provide a better error message when mixing dep: with / (rust-lang/cargo#11172) - Remove lingering unstable flag `-Zfeatures` (rust-lang/cargo#11168) - Tweak wording (rust-lang/cargo#11164) - Expose libgit2-sys/vendored feature as vendored-libgit2 (rust-lang/cargo#11162) - refactor(cli): Upgrade to clap v4 (rust-lang/cargo#11159) - Expose guide to adding a new edition as rustdoc (rust-lang/cargo#11157) - Remove `multitarget` from -Zhelp (rust-lang/cargo#11158) - Remove outdated comments (rust-lang/cargo#11155)
Features of the form
dep:foo/featurearen't accepted as valid syntax. This generated a somewhat confusing error message of:This PR adds a more targeted error message that provides some suggestions on how to fix it.
There is more context in #9574 as to why the syntax is the way it is.