mini-RFC: add an option to fail fast within a single test target?

⚓ Rust    📅 2025-06-20    👤 surdeus    👁️ 7      

surdeus

Warning

This post was published 54 days ago. The information described in this article may have changed.

Rust does not appear to "fail fast" for individual tests explains that --fail-fast applies only at the level of cargo test running multiple targets. Each test target, containing potentially many functions, runs to completion, at least if using the normal harness code.

I don't want to change the default but I do think it would be useful to have an option to stop after the first failure within a single test target. For example, cargo mutants really just wants to know if any tests fail.

Do you think there would be any objection in principle to a PR adding an option for this?

2 posts - 2 participants

Read full topic

🏷️ rust_feed