| Age | Commit message (Collapse) | Author | Lines | |
|---|---|---|---|---|
| 2021-02-16 | Ensure debug_assert! tests get run | Teddy Katz | -0/+1 | |
| 2021-02-16 | Document that `assert!` format arguments are evaluated lazily | Teddy Katz | -0/+11 | |
| It can be useful to do some computation in `assert!` format arguments, in order to get better error messages. For example: ```rust assert!( some_condition, "The state is invalid. Details: {}", expensive_call_to_get_debugging_info(), ); ``` It seems like `assert!` only evaluates the format arguments if the assertion fails, which is useful but doesn't appear to be documented anywhere. This PR documents the behavior and adds some tests. | ||||
