mirror of
https://github.com/rust-lang/rust.git
synced 2024-10-30 22:12:15 +00:00
13 lines
256 B
Rust
13 lines
256 B
Rust
// run-pass
|
|
|
|
// Test that both `&&` and `||` actually short-circuit.
|
|
// Formerly, both sides were evaluated unconditionally
|
|
|
|
const TRUE: bool = true || panic!();
|
|
const FALSE: bool = false && panic!();
|
|
|
|
fn main() {
|
|
assert!(TRUE);
|
|
assert!(!FALSE);
|
|
}
|