mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-24 07:44:10 +00:00
20 lines
296 B
Rust
20 lines
296 B
Rust
//@ run-pass
|
|
//@ compile-flags: -Zub-checks=no
|
|
|
|
#![feature(cfg_ub_checks)]
|
|
|
|
fn main() {
|
|
assert!(!cfg!(ub_checks));
|
|
assert!(compiles_differently());
|
|
}
|
|
|
|
#[cfg(ub_checks)]
|
|
fn compiles_differently() -> bool {
|
|
false
|
|
}
|
|
|
|
#[cfg(not(ub_checks))]
|
|
fn compiles_differently() -> bool {
|
|
true
|
|
}
|