summaryrefslogtreecommitdiffstats
path: root/tests/ui/numbers-arithmetic/overflow-attribute-works-2.rs
blob: 0367d980a64c5ea33a8bdba6cd86ad0e11f17f92 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
// run-pass
// compile-flags: -C overflow_checks=false

#![feature(cfg_overflow_checks)]

fn main() {
    assert!(!cfg!(overflow_checks));
    assert!(!compiles_differently());
}

#[cfg(overflow_checks)]
fn compiles_differently()->bool {
    true
}

#[cfg(not(overflow_checks))]
fn compiles_differently()->bool {
    false
}