Skip to content

Refactor: distinguish lockfile from normal =a.b.c dependencies  #9840

@Eh2406

Description

@Eh2406

Internally Cargo uses =a.b.c dependencies to tell the Dependency Resolver about things that are fixed by a lockfile. lock_to is used to make the synthetic dependencies, and is_exact to guess if it is synthetic. This works pretty well. We only rarely get a real dependency and a synthetic one confused, and it matters basically never. Except that #9827 now can show the dependency to the user. It would be nice if we could say "which satisfies dependency A > "1.0.0" (pinned to 1.2.3 by the lockfile)" instead of "which satisfies dependency A = "1.2.3"".

My proposed solution is to add a variant to OptVersionReq for the synthetic lockfile dependencies. Something like Locked(Version, VersionReq), So that its display can record the original requirement and the version it is pinned to.

Metadata

Metadata

Assignees

Labels

A-cargo-apiArea: cargo-the-library API and internal code issues

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions