rust/src
Guillaume Gomez 16481a2857
Rollup merge of #82169 - not-an-aardvark:assert-lazy-format-expressions, r=sfackler
Document that `assert!` format arguments are evaluated lazily

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.
2021-02-17 20:38:00 +01:00
..
bootstrap Rollup merge of #82163 - matthiaskrgr:slice, r=jyn514 2021-02-16 19:21:20 +01:00
build_helper
ci Auto merge of #81666 - hyd-dev:miri-windows-test-fail, r=Mark-Simulacrum 2021-02-13 13:47:02 +00:00
doc Update link for extern prelude. 2021-02-14 19:38:40 -08:00
etc Rollup merge of #81891 - CraftSpider:fn-header, r=jyn514 2021-02-14 16:54:45 +01:00
librustdoc Auto merge of #81611 - cjgillot:meowner, r=estebank 2021-02-16 22:14:32 +00:00
llvm-project@70d09f218d
rustdoc-json-types Rollup merge of #81891 - CraftSpider:fn-header, r=jyn514 2021-02-14 16:54:45 +01:00
test Rollup merge of #82169 - not-an-aardvark:assert-lazy-format-expressions, r=sfackler 2021-02-17 20:38:00 +01:00
tools Auto merge of #81611 - cjgillot:meowner, r=estebank 2021-02-16 22:14:32 +00:00
README.md update message 2021-02-14 10:08:37 +05:30
stage0.txt
version

This directory contains the source code of the rust project, including:

  • The test suite
  • The bootstrapping build system
  • Various submodules for tools, like rustdoc, rls, etc.

For more information on how various parts of the compiler work, see the rustc dev guide.