CARGO_FIX_MAX_RETRIES env var is missing from the docs
Nobody has claimed this yet.
Assessment
- Difficulty
- 1/5
- Estimated time
- Under an hour
- Newbie friendliness
- 82/100
- Issue type
- Documentation
- Clarity
- Mostly clear
- Activity status
- Quiet
- Tech stack
- rust
- Domain
- cli, documentation
Research direction
Start with environment-variables.md and the "Environment variables Cargo reads" section; use src/ops/cargo_fix/mod.rs around line 914 to confirm the variable's behavior and default. Done means the documentation explains CARGO_FIX_MAX_RETRIES, its retry limit, and the default of 4, with an optional cargo-fix documentation mention if that scope is accepted.
Written by the indexing model from the issue text.
Description
summary
cargo fix doesn't apply suggestions in a single pass — it re-runs the compiler and re-applies fixes in a loop, because fixing one warning can often expose another one underneath it. To keep this from running forever, it stops after 4 iterations by default.
That limit is actually configurable. There's an env var for it already sitting in the code:
let max_iterations = gctx
.get_env("CARGO_FIX_MAX_RETRIES")
.ok()
.and_then(|n| n.parse().ok())
.unwrap_or(4);
src/ops/cargo_fix/mod.rs, around line 914.
.But it's never been written down anywhere, not in environment-variables.md, If you didn't already know this variable exists, the only way to find out is to go read the source.
fix
add CARGO_FIX_MAX_RETRIES to the "Environment variables Cargo reads" section of environment-variables.md, describing what it does and that the default is 4. Might be worth a short mention in the cargo-fix docs as well, since that's probably where someone debugging this would look first.
- Dominant language
- Rust
- Stars
- 15.5k
- Forks
- 3k
- Avg merge
- 1d 8h
- Merged PRs (30d)
- 55
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from rust-lang/cargo
-
C-bug S-triage
Difficulty 2/5 1-3 hours Newbie friendliness 86/100
-
A-completions C-bug S-triage
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
-
C-bug S-triage
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
-
cargo remove prints "Removing X" for dependencies that never get removed when the command fails OpenC-bug Command-remove S-triage
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
-
A-cli A-unstable C-feature-request S-needs-design
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
Eynzof/Hermes-CN-Desktop#610 ·
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
gitbutlerapp/gitbutler#15998 · 1 comment ·
-
bug triage:deciding
Difficulty 1/5 Under an hour Newbie friendliness 88/100
open-telemetry/otel-arrow#4132 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 84/100