mirror of
https://github.com/rust-lang/rust-clippy
synced 2024-12-25 12:33:30 +00:00
38d4ac7cea
Discussion previously happened in https://github.com/rust-lang/rust/pull/43498
21 lines
300 B
Rust
21 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();
|
|
}
|