-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
improve error reporting when feature not found in activated_features
#14647
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 (
|
af8b11f
to
4623a71
Compare
@@ -319,8 +319,32 @@ impl ResolvedFeatures { | |||
pkg_id: PackageId, | |||
features_for: FeaturesFor, | |||
) -> Vec<InternedString> { | |||
self.activated_features_int(pkg_id, features_for) |
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.
What about reusing and calling the unverified variant in this function. If none then panic?
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.
Good idea!
4623a71
to
1623c41
Compare
Thank you! @bors r+ |
☀️ Test successful - checks-actions |
Update cargo 8 commits in ad074abe3a18ce8444c06f962ceecfd056acfc73..15fbd2f607d4defc87053b8b76bf5038f2483cf4 2024-10-04 18:18:15 +0000 to 2024-10-08 21:08:11 +0000 - initial version of checksum based freshness (rust-lang/cargo#14137) - feat: Add custom completer for completing registry name (rust-lang/cargo#14656) - Document build-plan as being deprecated (rust-lang/cargo#14657) - fix(complete): Don't complete files for any value (rust-lang/cargo#14653) - Add more SAT resolver tests (rust-lang/cargo#14614) - fix: avoid inserting duplicate `dylib_path_envvar` when calling `cargo run` recursively (rust-lang/cargo#14464) - chore(deps): bump gix-path from 0.10.9 to 0.10.11 (rust-lang/cargo#14489) - improve error reporting when feature not found in `activated_features` (rust-lang/cargo#14647) --- This also adds three license exceptions to Cargo. * arrayref — BSD-2-Clause * blake3 — CC0-1.0 OR Apache-2.0 OR Apache-2.0 WITH LLVM-exception * constant_time_eq — CC0-1.0 OR MIT-0 OR Apache-2.0 These exceptions were added to rustc in rust-lang#126930, so should be fine for Cargo as well.
Pulls the error message refactor out of #14593 (originally #13207) to improve error reporting when we fail to get the list of activated features enabled for the given package. It now fully lists the activated_features hashmap keys too.
From the original author:
Old vs new error message:
r? weihanglo