about summary refs log tree commit diff
path: root/tests/ui/consts/control-flow/short-circuit.rs
blob: 4437106edf3f86eb01f6727fad68be2431a796ac (plain)
1
2
3
4
5
6
7
8
9
10
11
12
//@ 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);
}