-
-
Notifications
You must be signed in to change notification settings - Fork 2.9k
Add lint to explicitly set resolver in a virtual workspace #10112
Copy link
Copy link
Closed
Labels
A-features2Area: issues specifically related to the v2 feature resolverArea: issues specifically related to the v2 feature resolverA-workspacesArea: workspacesArea: workspacesC-feature-requestCategory: proposal for a feature. Before PR, ping rust-lang/cargo if this is not `Feature accepted`Category: proposal for a feature. Before PR, ping rust-lang/cargo if this is not `Feature accepted`
Metadata
Metadata
Assignees
Labels
A-features2Area: issues specifically related to the v2 feature resolverArea: issues specifically related to the v2 feature resolverA-workspacesArea: workspacesArea: workspacesC-feature-requestCategory: proposal for a feature. Before PR, ping rust-lang/cargo if this is not `Feature accepted`Category: proposal for a feature. Before PR, ping rust-lang/cargo if this is not `Feature accepted`
Type
Fields
Give feedbackNo fields configured for issues without a type.
Problem
Because the resolver is a global setting in workspaces, and workspaces don't have edition settings, I believe that it is very easy to accidentally use the old resolver in workspaces where you intended on using the new resolver. Because I didn't know about the resolver being global, I just assumed I was using the new one since my crate's edition said "2021" and it caused me to spend the last 4 days trying to fix my builds.
Proposed Solution
I think that having a lint in cargo that says "hey you should explicity set your resolver" would be merited. Because otherwise everyone is going to be using the old resolver all the time, perhaps even without realizing.
Notes
See also rust-lang/rust#90148 and #9996