Skip to content

Commit 309c26f

Browse files
authored
1 parent 30b9f6d commit 309c26f

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

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

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,9 +32,7 @@ The rationale for this is that giving a "complete" answer requires (among other
3232
Monomorphization is expensive: instead of having to check each function only once, each function now has to be checked once for all choices of generic parameters that the crate needs.
3333
Given this performance cost and the fact that errors during monomorphization are fairly rare, `cargo check` favors speed over completeness.
3434

35-
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.
36-
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.
37-
This aspect of the policy favors consistency and predictability over performance.
35+
Examples where the optimization level can affect if a program passes `cargo check` and/or `cargo build` are considered bugs unless there is a documented policy exception, approved by T-lang. One example of such an exception is [RFC #3016](https://rust-lang.github.io/rfcs/3016-const-ub.html), which indicated that undefined behavior in const functions cannot always be detected statically (and in particular, optimizations may cause the UB to be undetectable).
3836

3937
# Unresolved questions
4038
[unresolved-questions]: #unresolved-questions

0 commit comments

Comments
 (0)