cargo-manifest
Registry dependencies
A registry dependency names a published package and a version requirement. Cargo resolves a compatible release using its index. The lockfile records the selected release; the manifest states what releases are allowed. Review the package before adding it. Example format: toml. Illustrative only; do not execute against real accounts or unreviewed sources. Expected result (not executed): A hypothetical package requirement accepts compatible 1.x versions from 1.2 onward, excluding 2.0; resolution needs an actual package. Common mistake: Assuming 1.2 means exactly 1.2.0.
Formal Syntax & Structure
rust syntaxrust
[dependencies] name = "version requirement"Working Example
Example Snippetrust
[dependencies]example-library = "1.2"