Skip to content

Commit 56a9c9b

Browse files
LokathorRalfJung
andauthored
Update text/0000-cargo-check-lang-policy.md
Co-authored-by: Ralf Jung <post@ralfj.de>
1 parent 48f3c43 commit 56a9c9b

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

text/0000-cargo-check-lang-policy.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,8 @@ Specifically, if a given Rust program does not compile with `cargo build` then i
2929
`cargo check` **should** catch as many errors as possible, but the emphasis of `cargo check` is on giving a "fast" answer rather than giving a "complete" answer. If you need a complete answer with all possible errors accounted for then you **must** use `cargo build`.
3030

3131
Any example where the optimization level can affect if a program passes `cargo check` and/or `cargo build` is a bug. There are no situations where a change in optimization level is intended to affect if a `check` or `build` is successful.
32+
In particular, it is not okay to skip checks in dead code if (a) the optimization level can affect which code is considered dead and (b) the checks might lead to an error that causes the check/build not to pass.
33+
This policy favors consistency and predictability over performance.
3234

3335
# Unresolved questions
3436
[unresolved-questions]: #unresolved-questions

0 commit comments

Comments
 (0)