Workspace.resolver error

Friends

I have returned to a package I last workd on a year ago and I am getting the error:

warning: some crates are on edition 2021 which defaults to `resolver = "2"`, but virtual workspaces default to `resolver = "1"`
note: to keep the current resolver, specify `workspace.resolver = "1"` in the workspace root's manifest
note: to use the edition 2021 resolver, specify `workspace.resolver = "2"` in the workspace root's manifest
warning: /home/patch/120Proof/novation_lpx/Cargo.toml: unused manifest key: workspace.workspace
    Finished dev [unoptimized + debuginfo] target(s) in 0.08s

I have set workspace.resolver = "2" in te Cargo.toml at the root of the workspace, but it makes no difference.

What am I supposed to do?

What are those instructions saying that I do not understand?

1 Like

How did you tell the workspace to use resolver = "2"?

It should look like this:

[workspace]
resolver = "2"

Judging by this warning:

warning: /home/patch/120Proof/novation_lpx/Cargo.toml: unused manifest key: workspace.workspace

the problem is that you have

[workspace]
workspace.resolver = "2"

which will not work — it specifies a path of workspace.workspace.resolver. You must write either

[workspace]
resolver = "2"

or write workspace.resolver = "2" at the top of the file above all [] headings. Those two are equivalent in TOML — the first is more conventional for Cargo.

3 Likes

This topic was automatically closed 90 days after the last reply. We invite you to open a new topic if you have further questions or comments.