Skip to content

Commit

Permalink
update per T-lang triage 2023-08-29
Browse files Browse the repository at this point in the history
  • Loading branch information
Lokathor authored Aug 29, 2023
1 parent 30b9f6d commit 309c26f
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions text/0000-cargo-check-lang-policy.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,7 @@ The rationale for this is that giving a "complete" answer requires (among other
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.
Given this performance cost and the fact that errors during monomorphization are fairly rare, `cargo check` favors speed over completeness.

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.
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.
This aspect of the policy favors consistency and predictability over performance.
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).

# Unresolved questions
[unresolved-questions]: #unresolved-questions
Expand Down

0 comments on commit 309c26f

Please sign in to comment.