-
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
Add report if cargo fix --edition
changes features.
#9268
Conversation
(rust-highfive has picked a reviewer for you, use r? to override) |
Overall I'm not too happy with this. The code seems a little awkward, though I can't say specifically why. I am a little concerned that it is unreliable. Another concern is that the new resolver depends on many factors (the target, the Also, this doesn't actually run the final verification step with the new resolver. That will require significant changes to I wanted to open this up for discussion to see if this is the direction we should go. |
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.
This looks good to me, personally. Given the context of this, migrating between editions, I'd expect the code to be lossy, a bit odd, and possibly very specific to some situations. Also I would not expect 100% correctness guarantees from this code (just no false positive warnings).
I view the cargo fix --edition
warnings as "best effort" where we do what we can for the 90% use case in theory, but there's likely to always be something that slips through the cracks or just isn't worth detecting and warning about.
The only thing I found surprising here was the check for --all-targets
, was that necessary to reduce the warnings emitted?
&opts.compile_opts.features, | ||
opts.compile_opts.all_features, | ||
!opts.compile_opts.no_default_features, | ||
), |
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.
Drive-by comment not related to your PR, but this seems like it's ripe for a opts.copmile_opts.requested_features()
method
My thinking was that if you run |
3093968
to
6c69e9d
Compare
Want to go ahead and land this? We can presumably in the near-ish future try testing out |
Yea, I think it's ok to go. It can always be tweaked or removed. Hopefully we'll get enough people to test it before 2021 is stable. I'll assume that was an approval. @bors r=alexcrichton |
📌 Commit 6c69e9d has been approved by |
☀️ Test successful - checks-actions |
Update cargo 8 commits in 32da9eaa5de5be241cf8096ca6b749a157194f77..90691f2bfe9a50291a98983b1ed2feab51d5ca55 2021-03-13 01:18:40 +0000 to 2021-03-16 21:36:55 +0000 - Add report if `cargo fix --edition` changes features. (rust-lang/cargo#9268) - Fix --feature pkg/feat for V1 resolver for non-member. (rust-lang/cargo#9275) - Fix doc duplicate removal of root units. (rust-lang/cargo#9276) - Add CLI help text for patch-in-config (rust-lang/cargo#9271) - Document `-Zpatch-in-config` (rust-lang/cargo#9270) - Support [patch] in .cargo/config files (rust-lang/cargo#9204) - Add `--future-incompat-report` support to `cargo test` (rust-lang/cargo#9264) - 🍱 Crop favicon (rust-lang/cargo#9262)
This adds a small report if using
cargo fix --edition
to transition from 2018 to 2021 to determine if the new resolver will result in different features.There is a gauntlet of checks that must pass before it even tries to show the differences:
Closes #9048