2024-02-16 14:02:50 -06:00
|
|
|
//@ run-pass
|
|
|
|
//@ compile-flags: -C overflow_checks=true
|
2023-05-02 08:53:11 -05:00
|
|
|
|
|
|
|
#![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
|
|
|
|
}
|