-
Notifications
You must be signed in to change notification settings - Fork 110
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
Explicit edition and resolver in Cargo.toml #836
Comments
Hi, thanks for opening the issue. I saw the warning and just opened a quick PR (#833), but it's a good idea to dive deeper into what's going on. I read up on it and it looks like workspaces don't have an Here's the source code from cargo that keeps workspace toml: There's a OTOH the parsed toml for packages has an I think that scylla-rust-driver/scylla/Cargo.toml Line 4 in 36ade9e
That's probably why cargo --fix edition didn't do anything, all the packages are already using 2021 .
Because of that I'm against adding an |
One interesting thing I found is "workspace inheritance": https://blog.duyet.net/2022/09/cargo-workspace-inheritance It's possible to specify It's a cool feature, but I don't think we really need it. It adds significant complexity for little benefit. |
The cargo source is of course the right place to look! Thanks for the source links and highlighting that Big picture totally agree that any form of explicit edition here is of little benefit for the added complexity. Thanks and closing! |
I'm new to the repo.
When running tests, cargo outputs the following warning and notes about crate editions and specifying an explicit resolver for the workspace.
Adding
resolver = "2"
tocargo.toml
addressed the warning and notes. The same tests pass after explicitly specifying the resolver as did before explicitly specifying the resolver.Was going to open a PR but #833 addresses this.
After taking a closer look at resolvers, I followed the rust edition migration instructions suggested here https://doc.rust-lang.org/edition-guide/rust-2021/default-cargo-resolver.html and ran
cargo fix --edition
and did the following prompted steps:cargo fix --edition
withedition = "2018"
made no modifications to any files in the repo. My guess is thatcargo clippy
caught any edition migration issues in linting.The build and tests pass after explicitly specifying
edition = "2021"
inCargo.toml
as did prior to explicitly specifying edition.Seems like explicitly adding
edition = "2021"
toCargo.toml
might also make sense in addition to #833Small change, but figured I'd open an issue, describe the work, and open a PR. Could just as easily be added to #833
The text was updated successfully, but these errors were encountered: