Stacks

Upgrade a dependency and fix the breakage in Rust with Atlas (2026)

Updated 9 min read

To upgrade a Rust dependency with Atlas, run the cargo bump through Atlas's bash tool, pull the crate's release notes with webfetch so the actual breaking changes are in context, then let cargo build enumerate the damage instead of predicting it. Atlas reads the real compiler output, and rustc is unusually good at this: E0308 mismatched types, E0061 wrong number of arguments, and E0432 unresolved import name the exact spans that must change. Atlas fixes each one with edit, using the lsp tool's goToDefinition operation to inspect the new signatures in the upgraded crate, then re-runs cargo build and cargo test until clean and shows you the whole diff before you commit.

How do you upgrade a Rust crate to a new major version with Atlas?

Atlas runs the cargo upgrade through its bash tool and captures the full output, which is step 1 of the 5 documented migration steps. If that output exceeds the limits it is saved to a file you can read. Atlas then edits Cargo.toml, refreshes Cargo.lock, and lets `cargo build` report the breakage rather than assuming it.

A major-version crate bump in Rust starts in Cargo.toml, where the semver requirement changes from something like 0.11 to 1.0, and continues into Cargo.lock, which cargo rewrites. Atlas drives cargo through bash, which means the commands are the ones you would type: the real package manager, not a wrapper. Crucially, Atlas does not try to predict what a major bump broke. Rust's compiler already knows. The five Atlas tools this workflow uses are bash, webfetch, edit, lsp, and read, and the sequence they enforce is bump, fetch the notes, compile, fix, re-run. Atlas is a terminal-native TUI, so the cargo output you would normally scroll past is instead read and acted on.

Why fetch the crate's release notes before editing any Rust code?

Atlas uses webfetch to pull the crate's release notes so the breaking changes are in context before you edit any Rust code, which is step 2 of the documented migration workflow. A CHANGELOG entry saying a method now returns Result instead of Option is worth more than any amount of guessing at a rustc error.

Rust's compiler tells you what broke. The release notes tell you why, and therefore what the correct fix is. Those are different pieces of information and you need both. A rustc error saying E0308 mismatched types, expected Result<Config, Error>, found Option<Config> tells you the shape changed. The crate's CHANGELOG tells you the maintainers moved from Option to Result because the operation can now fail on IO, which means the right fix at each callsite is a ? operator inside a function that returns Result, not a .unwrap(). Atlas pulls the notes with webfetch so the fixes match the actual breaking changes instead of a guess, and Atlas connects to Model Context Protocol servers and exposes their tools to the agent if the notes live somewhere webfetch cannot reach.

How do you let cargo build enumerate the breakage instead of guessing?

Run cargo build through Atlas's bash tool and let rustc enumerate every break. Rust's compiler produces a complete, exhaustive error list with spans, error codes like E0308 and E0432, and suggestion notes, which makes it a better breakage inventory than any search across your src directory could be.

The temptation after a crate bump is to grep for the old API and start editing. In Rust that is strictly worse than compiling, because rustc is a type checker with full knowledge of the crate graph. cargo build finds callsites that grep never would: a trait method resolved through a blanket impl, a type alias in src/lib.rs that hides the changed type, an inference site where a closure's return type shifted. Atlas runs cargo build through bash and captures the full output, and if that output exceeds the limits it is saved to a file you can read, which matters because a major bump on a large crate can produce hundreds of errors. Atlas then works the list, and cargo check gives a faster loop than a full cargo build while the errors are still numerous.

How does Atlas fix each rustc error at the callsite?

Atlas fixes each rustc error with its edit tool, using the lsp tool's goToDefinition operation to inspect the new signatures in the upgraded crate, which is step 4 of the documented migration workflow. rust-analyzer resolves straight into the vendored source under the cargo registry, so Atlas reads the actual new signature rather than recalling an old one.

Fixing a Rust callsite correctly requires knowing exactly what the new API takes and returns, including lifetimes, generic bounds, and whether the function is now async. The lsp tool's goToDefinition operation jumps into the upgraded crate's real source, so Atlas can see that a builder method now takes impl Into<String> instead of &str, or that a function gained a where clause. Atlas then applies the change with edit and computes a unified diff for every file edit, surfacing it for approval before writing. Rust's borrow checker is the other half of this: a bump that changes an owned value into a borrow cascades through your src/ tree, and Atlas pairs with Rust to work through the borrow checker, cargo, and clippy lints rather than papering over them with .clone().

How do you confirm the Rust upgrade is actually clean?

Re-run cargo build and cargo test with Atlas's bash tool until both are clean, then review the whole diff before committing. A crate upgrade that compiles but changes runtime semantics is the classic trap, and cargo test is what catches it in 2026.

Compiling is necessary and not sufficient. A major bump can preserve every type signature while changing default behavior, a serializer that now skips None fields, a client that now retries. cargo test is the only thing that catches that class of change, so Atlas re-runs the suite after the compile is green and reads the failures. Run rustfmt so the edited callsites match your rustfmt.toml, and let cargo clippy flag idioms the new API made obsolete. Then review the whole diff. Atlas reads git branches, status, and diffs, and can stage and create commits on your behalf, and Atlas snapshots file changes as git patches so a bad upgrade can be diffed and rolled back rather than untangled by hand.

How does Atlas keep a cargo upgrade from running unsupervised?

Atlas gates every tool call against 3 rule types, allow, ask, and deny, before it runs, so `cargo publish` can sit on deny while `cargo build` and `cargo test` sit on allow. Atlas also drafts a plan in a read-only plan agent and asks before switching to a build agent.

A dependency upgrade touches Cargo.toml, Cargo.lock, and potentially dozens of files in src/, which is a lot of blast radius for an automated session. Atlas constrains it at three points. First, permissions: every bash command, including every cargo invocation, is checked against allow, ask, and deny rules before it runs. Second, planning: Atlas drafts the upgrade plan in a read-only plan agent, reading Cargo.toml and the release notes, and asks before switching to a build agent that can write. Third, diffs: Atlas computes a unified diff for every file edit and surfaces it for approval before writing, and snapshots the changes as git patches. For a Rust bump specifically, that means you see every .unwrap() that became a ? before it lands.

Step by step

  1. 01Run atlas in a crate with a Cargo.toml so Atlas can read your modules, traits, and cargo workspace.
  2. 02Bump the dependency in Cargo.toml and run the cargo upgrade through Atlas's bash tool, capturing the full output; if it exceeds the limits it is saved to a file you can read.
  3. 03Fetch the crate's release notes and CHANGELOG with webfetch so the breaking changes are in context before you start editing.
  4. 04Run cargo build through bash and let rustc enumerate the breakage with real error codes like E0308 and E0432, rather than predicting it.
  5. 05Fix each error with edit, using the lsp tool's goToDefinition operation to inspect the new signatures in the upgraded crate.
  6. 06Re-run cargo build with bash until it compiles clean, using cargo check for a faster loop while the errors are still numerous.
  7. 07Run cargo test with bash to catch behavior changes that still compile, and read the failures.
  8. 08Run rustfmt so the edited callsites match your rustfmt.toml, then review the whole diff before committing.

Frequently asked questions

how to upgrade a rust crate to a new major version without breaking everything
Bump the requirement in Cargo.toml, run cargo build through Atlas's bash tool, and let rustc enumerate every break with its real error codes. Atlas fetches the crate's release notes with webfetch first so the fixes match the documented breaking changes, then fixes each callsite with edit and re-runs cargo test.
can an ai agent read cargo build errors and fix them
Yes. Atlas runs cargo build through its bash tool and reads the real compiler output rather than assuming what broke. If the output exceeds the limits it is saved to a file Atlas can read, which matters because a major crate bump can emit hundreds of rustc errors at once.
how do I see the new signature of an upgraded crate function
Use the lsp tool's goToDefinition operation through Atlas. rust-analyzer resolves into the upgraded crate's real source, so Atlas sees the actual new signature, including lifetimes, generic bounds, and whether the function now returns Result, before it edits any callsite.
does cargo test catch breaking changes that still compile
That is exactly what cargo test is for in an upgrade. A major bump can keep every type signature identical while changing default runtime behavior. Atlas re-runs cargo test with bash after the compile is green, reads the failures, and does not treat a clean cargo build as a finished upgrade.
how do I roll back a bad dependency upgrade in rust
Atlas snapshots file changes as git patches, so the edits to Cargo.toml, Cargo.lock, and your src/ callsites can be diffed and rolled back rather than untangled by hand. Atlas also reads git branches, status, and diffs, so you can see the full scope of the upgrade before deciding.
will atlas run cargo commands without asking
Only within your rules. Every Atlas tool call is permission-gated against allow, ask, and deny rules before it runs, so cargo build and cargo test can sit on allow while cargo publish sits on deny.
can atlas plan a dependency upgrade before touching Cargo.toml
Yes. Atlas drafts a plan in a read-only plan agent and asks before switching to a build agent, so it can read Cargo.toml, your cargo workspace, and the fetched release notes and propose the upgrade without writing anything.
what does atlas need to work on a rust project
Run atlas in a crate with a Cargo.toml. Atlas reads your modules, traits, and cargo workspace, and can fix borrow-checker errors or clippy warnings, showing you the diff to review before cargo build.

Try Atlas in your terminal

The terminal-native AI coding agent. Free core, single binary.

Install Atlas

Related guides

Upgrade a Dependency and Fix the Breakage with Atlas (2026 Workflow)

How to upgrade a dependency and fix the breakage with Atlas in 2026: bash drives the package manager, webfetch pulls the release notes, edit fixes each compiler error.

Atlas for Rust in 2026

Adopt Atlas, the terminal-native AI coding agent, for Rust development in 2026. Tackle borrow checker errors and clippy lints with Atlas's secure, approval-gated assistance.

Self-review your working diff before committing in Rust with Atlas (2026)

How Atlas self-reviews your working Rust diff before committing in 2026: read the whole diff, grep for leftovers, revert from snapshots, then run cargo test and rustfmt.

Document a module with a README in Rust with Atlas (2026)

Write a Rust module README that matches the code as it stands in 2026. Atlas enumerates the pub surface with lsp, reads the impls, and verifies every sample with cargo test.

Extract a Shared Helper from Duplicated Rust Code with Atlas (2026)

Extract a shared helper from duplicated Rust code with Atlas in 2026. Find near-duplicates with codebase_search, add a module, swap each copy with apply_patch, run cargo test.

Diagnose a Hanging or Long-Running Command in Rust with Atlas (2026)

Is your cargo build slow or silently blocked on stdin? Atlas races every command against a timeout in 2026 and tells you which one it is, plus how to get unstuck.

Locate Where a Behavior Is Implemented in Rust with Atlas in 2026

Find the exact Rust file, trait, and impl behind a behavior in 2026. Atlas pairs codebase_search with grep through ripgrep and the lsp tool's findReferences.

Write Unit Tests for Untested Code in Rust with Atlas (2026)

How Atlas writes cargo test coverage for an untested Rust module in 2026: lsp documentSymbol lists every pub item, grep copies your conventions, and the tests actually run.

Browse this resource hub