mirror of
https://git.proxmox.com/git/rustc
synced 2025-05-02 17:25:45 +00:00
20 lines
322 B
Rust
20 lines
322 B
Rust
// 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
|
|
}
|