rust/tests/ui/crashes/returns.rs
Eduardo Broto 6b59675449 Remove run-pass annotations from crash tests
It does not seem to be necessary
2020-09-25 15:19:36 +02:00

23 lines
367 B
Rust

/// Test for https://github.com/rust-lang/rust-clippy/issues/1346
#[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();
}