1
Fork 0
rust/tests/ui/numbers-arithmetic/overflow-attribute-works-1.rs

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

20 lines
322 B
Rust
Raw Normal View History

// run-pass
// compile-flags: -C overflow_checks=true
#![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
}