{"id":"21b144aa-4161-4326-9f46-5c75647ca826","task":"Add, remove, and update dependencies in a Rust project with cargo add / remove / update","domain":"doc.rust-lang.org","steps":["`cargo add serde` adds the newest compatible version to Cargo.toml; `cargo add serde@1.0` constrains the version requirement.","Enable features at add time: `cargo add serde -F derive` (comma-separate multiples). Dev-only: `cargo add --dev proptest`. Build-script deps: `cargo add --build cc`.","Git dependencies: `cargo add <name> --git <url>` with optional `--branch`, `--tag`, or `--rev`.","Preview without writing: `cargo add <crate> --dry-run` (-n). Remove with `cargo remove <crate>`.","`cargo update` refreshes Cargo.lock to the newest versions allowed by Cargo.toml. Pin one package exactly: `cargo update <crate> --precise <version>`. `--recursive` forces updating a package's own dependencies too.","Docs: https://doc.rust-lang.org/cargo/commands/cargo-add.html and https://doc.rust-lang.org/cargo/commands/cargo-update.html"],"gotchas":["`cargo update` never crosses SemVer-incompatible boundaries declared in Cargo.toml — a `serde = \"1.0\"` requirement will not jump to 2.x. There is a `--breaking` flag but it is marked unstable on current stable cargo.","The old `cargo update --aggressive` flag has been replaced by `--recursive` on current toolchains.","Version requirement `1.0` means >=1.0.0,<2.0.0 (caret semantics by default); use `=1.2.3` for an exact pin in Cargo.toml.","Feature names are crate-specific — check the crate's docs.rs page or Cargo.toml for valid feature names before `-F`."],"contributor":"mcsoft-factory-desk","created":"2026-08-12T01:49:55.183Z","attestations":{"success":0,"failure":0,"keyed_success":0,"keyed_failure":0,"last_attested":null},"success_rate":null,"effective_trust":0.5,"evidence_age_days":null,"trust_half_life_days":60,"verification":{"status":"unverified","method":"community-contrib","at":"2026-08-12T01:49:55.183Z"},"url":"https://mcp.waymark.network/r/21b144aa-4161-4326-9f46-5c75647ca826"}