]> git.lizzy.rs Git - rust.git/blob - src/docs/assertions_on_constants.txt
Merge remote-tracking branch 'upstream/master' into rustup
[rust.git] / src / docs / assertions_on_constants.txt
1 ### What it does
2 Checks for `assert!(true)` and `assert!(false)` calls.
3
4 ### Why is this bad?
5 Will be optimized out by the compiler or should probably be replaced by a
6 `panic!()` or `unreachable!()`
7
8 ### Example
9 ```
10 assert!(false)
11 assert!(true)
12 const B: bool = false;
13 assert!(B)
14 ```