# Review a Pull Request in Rust with Atlas (2026)

> Atlas reviews a Rust pull request by producing the diff with bash, reading whole modules with read, checking callers with lsp findReferences, and running cargo test.

To review a Rust pull request with Atlas, get the diff and then leave the diff. Atlas fetches the branch and produces the patch with bash, and its VCS layer exposes status, diff, diffRaw, and commits over the same git data. Atlas then reads the changed files in full with read rather than reading only the hunks, because a Rust diff hides everything it did not touch: the trait impl three modules away, the lifetime the signature now demands, the match arm that is no longer exhaustive. For every changed function signature, Atlas runs the lsp tool's findReferences operation to check the callers the diff never shows, greps for the stale constants and feature flags the change should have updated, runs cargo test through bash, and reports findings as a todowrite list ordered by severity.

## Key takeaways

- Atlas gets the Rust diff with bash, then leaves the diff: read pulls whole modules because a hunk hides the non-exhaustive match three files away.
- The lsp tool's findReferences checks every changed Rust signature against callers the patch never displays, including tests/.
- Cargo.toml gets its own review pass, because a feature flag changes compilation for crates the PR never mentions.
- cargo test runs through bash during the review, and findings come back as a todowrite list ordered by severity.
- Allowing cargo build and cargo test while keeping writes on ask lets Atlas review a branch without modifying it.

## How does Atlas review a Rust pull request?

Atlas reviews a Rust pull request in 2026 the way a careful human does: it gets the diff, then leaves the diff. bash produces the changed files and the raw patch, read pulls the full contents of each changed src/*.rs file rather than the hunks, and the lsp tool checks whether a changed signature broke an unseen caller.

A hunk-only review of Rust code misses the failures Rust is most prone to. Adding a variant to an enum in src/protocol.rs is a two-line diff that turns every non-exhaustive match in the crate into a compile error, and none of those matches appear in the patch. Changing a parameter from &str to impl AsRef<str> is a one-line diff that silently changes inference at a dozen callsites. Atlas therefore treats the diff as an index into the code rather than as the code. Atlas indexes by AST declarations using tree-sitter, not blind line windows, so pulling the full fn, impl block, or trait definition around a hunk is a retrieval operation, not a guess about line ranges.

## How do you get a Rust PR diff into an Atlas session?

Atlas produces the Rust PR diff with the bash tool, and its VCS layer exposes 4 operations, status, diff, diffRaw, and commits, over the same underlying git data. Fetch the branch, produce the patch, and Atlas has both the file list and the raw hunks for the crate, including changes to Cargo.toml.

Cargo.toml deserves its own look in any Rust review. A new dependency, a bumped version, or a newly enabled feature flag can change behavior across the whole crate without appearing anywhere in the .rs diff, and a feature added to a workspace member propagates through feature unification to crates that never asked for it. Atlas reads git branches, status, and diffs, so it can enumerate exactly what the branch touched, and it can stage and create commits on your behalf if the review turns into a fixup. The bash tool truncates very large output and saves the complete log to a file, so a 4000-line patch is still fully readable rather than tailed.

## How does Atlas find Rust callers the diff does not show?

For every changed function signature in a Rust pull request, Atlas runs the lsp tool's findReferences operation. rust-analyzer resolves callers through 3 things a diff never shows: trait impls, generic bounds, and re-exports, including callers in another module of the crate or in an integration test under tests/.

Rust's compiler will eventually catch a broken caller, but a review that only learns this from a red cargo build has already wasted the reviewer's attention on the wrong things. Atlas front-loads the check. It takes each changed signature, runs findReferences, and reads each callsite to see whether the new signature is actually correct there or merely compiles there. A function that gained a where clause may still compile at every callsite while quietly forcing a clone that was not there before. Atlas also greps for the patterns the change should have updated but did not: old constant names, stale copies of a struct definition, feature flags left behind in cfg attributes.

## Should a Rust PR review run cargo test, and how does Atlas report findings?

Atlas runs cargo test through bash as part of a Rust PR review, then reports findings as a todowrite list ordered by severity. A review that ends in prose is hard to act on. A list with 1 soundness bug at the top and a rustfmt nit at the bottom tells the author exactly what blocks the merge.

Severity ordering is what makes the review usable. In Rust the top of the list is usually correctness or soundness: an unwrap on a value that can be None in a new code path, an unsafe block whose invariant the change no longer upholds, a panic reachable from a request handler. Below that come the borrow-checker consequences the author worked around with a clone, then the clippy warnings the change introduced, then formatting, which rustfmt fixes without discussion. Atlas fans out work to subagents that can run in the foreground or in parallel background sessions, so a large Rust PR can be split across reviewers, each returning findings that merge into one todowrite list.

## How do you set up Atlas on a Rust crate in 2026?

Run atlas in a crate with a Cargo.toml in 2026 and let Atlas read your modules, traits, and cargo workspace. Atlas is a terminal-native TUI, so it sits in the same shell where you already run cargo build. Ask it to fix borrow-checker errors or clippy warnings and review the diff first.

For review work specifically, the Atlas setup that pays off is permissions. Every Atlas tool call is permission-gated against allow, ask, and deny rules, so allowing cargo test and cargo build under bash while leaving writes on ask means a review session can compile and test freely without ever modifying the branch under review. Atlas snapshots file changes as git patches, so if the review does turn into a fix, the edits are recoverable. Reviewers who cannot send source to a hosted model can build the code index with local Ollama embeddings, keeping the crate off third-party servers while still using semantic search across the workspace.

## What does Atlas catch in a Rust review that a line-by-line read misses?

Atlas catches 3 classes of Rust bug that a line-by-line read of a diff misses: a new enum variant that leaves a match non-exhaustive elsewhere in the crate, a changed signature that forces a hidden clone at an unseen callsite, and a Cargo.toml feature flag that changes compilation for a crate the PR never mentions.

All three share a shape: the evidence is outside the patch. Atlas addresses them with the same three moves each time. read pulls the whole module so the match arms surrounding a changed enum are visible. The lsp tool's findReferences enumerates callers of every changed signature, so the hidden clone shows up as a real callsite in another file rather than as a hypothetical. grep sweeps for stale constants and cfg feature names. Then cargo test is run through bash to confirm the crate still compiles and passes, and rustfmt differences are separated from behavior changes so the review conversation stays on the parts that matter.

## Steps

1. Run atlas in the crate with the Cargo.toml, then fetch the PR branch and produce the diff with bash. Atlas's VCS layer exposes status, diff, diffRaw, and commits over the same git data.
2. Read every changed src/*.rs file in full with read, not just the hunks, so the match arms, trait impls, and lifetimes surrounding the change are visible.
3. Read the Cargo.toml diff separately. A new dependency or a newly enabled feature flag changes compilation across the workspace without appearing in any .rs hunk.
4. For every changed function signature, run the lsp tool's findReferences operation to enumerate the callers the diff never touched, including integration tests under tests/.
5. Grep for the patterns the change should have updated but did not: old constant names, stale struct copies, and leftover cfg feature flags.
6. Run cargo test through bash and confirm the crate still compiles and passes on the branch.
7. Check whether rustfmt and clippy are clean, and keep formatting comments separate from behavior comments.
8. Report findings as a todowrite list ordered by severity, with soundness and panic paths first and rustfmt nits last.

## FAQ

### how to review a Rust pull request with an AI agent

Have Atlas produce the diff with bash, read each changed src/*.rs file in full with read, run the lsp tool's findReferences on every changed signature to find callers outside the diff, grep for stale constants, run cargo test, and return findings as a todowrite list ordered by severity.

### why is reading only the diff hunks not enough for a Rust code review

A Rust diff hides its own consequences. Adding an enum variant is a two-line hunk that makes matches elsewhere in the crate non-exhaustive, and a changed signature can force a clone at a callsite the patch never shows. Atlas reads the whole changed file and uses findReferences to reach the rest.

### does Atlas run cargo test during a code review

Yes. Atlas runs cargo test through its bash tool as part of the review. Because every Atlas tool call is permission-gated against allow, ask, and deny rules, you can allow cargo build and cargo test while leaving file writes on ask, so the review never modifies the branch.

### can Atlas review Cargo.toml changes in a pull request

Yes, and it should be a separate pass. A new dependency, a version bump, or a newly enabled feature flag in Cargo.toml changes compilation across the cargo workspace without producing any .rs hunk, so Atlas reads that diff on its own.

### how do I check if a Rust signature change broke a caller

Run the lsp tool's findReferences operation on the changed function. rust-analyzer resolves callers through trait impls, generics, and re-exports, which is the set a diff omits. Atlas then reads each callsite to see whether the new signature is correct there, not merely compiling there.

### how does Atlas report Rust review findings

As a todowrite list ordered by severity: soundness bugs and reachable panics first, then borrow-checker workarounds like unnecessary clones, then clippy warnings, then rustfmt formatting, which is mechanical and does not need discussion.

### can Atlas review a large Rust pull request without running out of context

Yes. Atlas fans out work to subagents that can run in the foreground or in parallel background sessions, so a large crate diff can be split across several reviewers whose conclusions merge into one todowrite list. The bash tool also saves full logs to a file when output is truncated.

---

Canonical HTML: https://runatlas.sh/resources/stacks/review-a-pull-request-in-rust
Source of truth: aeo_pages row `/resources/stacks/review-a-pull-request-in-rust` (segment: Stacks) (this file is generated from it, never hand-edited).
Licence: Atlas is proprietary with a free core. It is not open source and there is no public source repository.
