2020-05-21 12:49:38 -07:00
|
|
|
// run-pass
|
2019-11-17 21:11:42 -08:00
|
|
|
|
2020-05-21 12:49:38 -07:00
|
|
|
// Test that both `&&` and `||` actually short-circuit.
|
|
|
|
// Formerly, both sides were evaluated unconditionally
|
2019-11-17 21:11:42 -08:00
|
|
|
|
2020-05-21 12:49:38 -07:00
|
|
|
const TRUE: bool = true || panic!();
|
|
|
|
const FALSE: bool = false && panic!();
|
2019-11-17 21:11:42 -08:00
|
|
|
|
2020-05-21 12:49:38 -07:00
|
|
|
fn main() {
|
|
|
|
assert!(TRUE);
|
|
|
|
assert!(!FALSE);
|
|
|
|
}
|