-
Notifications
You must be signed in to change notification settings - Fork 2.6k
Open
Labels
A-crate-dependenciesArea: [dependencies] of any kindArea: [dependencies] of any kindA-diagnosticsArea: Error and warning messages generated by Cargo itself.Area: Error and warning messages generated by Cargo itself.A-manifestArea: Cargo.toml issuesArea: Cargo.toml issuesA-workspace-inheritanceArea: workspace inheritance RFC 2906Area: workspace inheritance RFC 2906C-enhancementCategory: enhancementCategory: enhancementS-acceptedStatus: Issue or feature is accepted, and has a team member available to help mentor or reviewStatus: Issue or feature is accepted, and has a team member available to help mentor or review
Description
Error complains about a boolean but only mentions version strings or tables with version = "x.y.z" when you accidentally write:
[dependencies]
crc32fast = true
Cargo reports:
invalid type: boolean `true`, expected a version string like "0.9.8"
or a detailed dependency like { version = "0.9.8" }
in `dependencies.crc32fast`
It would be more helpful if the error message also suggested the workspace shorthand. Both of these are valid ways to pull from your workspace
crc32fast = { workspace = true }
crc32fast.workspace = true
Proposed behavior:
When a boolean is found, append a note pointing out the two valid workspace forms
invalid type: boolean `true`, expected a version string like "0.9.8"
or a detailed dependency like { version = "0.9.8" }
in `dependencies.crc32fast`.
if you meant to use a workspace member, you can write
crc32fast = { workspace = true }
or
crc32fast.workspace = true
Metadata
Metadata
Assignees
Labels
A-crate-dependenciesArea: [dependencies] of any kindArea: [dependencies] of any kindA-diagnosticsArea: Error and warning messages generated by Cargo itself.Area: Error and warning messages generated by Cargo itself.A-manifestArea: Cargo.toml issuesArea: Cargo.toml issuesA-workspace-inheritanceArea: workspace inheritance RFC 2906Area: workspace inheritance RFC 2906C-enhancementCategory: enhancementCategory: enhancementS-acceptedStatus: Issue or feature is accepted, and has a team member available to help mentor or reviewStatus: Issue or feature is accepted, and has a team member available to help mentor or review