rust/tests/run-pass/returns.rs
2019-01-08 21:46:39 +01:00

22 lines
300 B
Rust

#[deny(warnings)]
fn cfg_return() -> i32 {
#[cfg(unix)]
return 1;
#[cfg(not(unix))]
return 2;
}
#[deny(warnings)]
fn cfg_let_and_return() -> i32 {
#[cfg(unix)]
let x = 1;
#[cfg(not(unix))]
let x = 2;
x
}
fn main() {
cfg_return();
cfg_let_and_return();
}