]> git.lizzy.rs Git - rust.git/blob - tests/ui/crashes/returns.rs
Merge remote-tracking branch 'upstream/master' into rustup
[rust.git] / tests / ui / crashes / returns.rs
1 /// Test for https://github.com/rust-lang/rust-clippy/issues/1346
2
3 #[deny(warnings)]
4 fn cfg_return() -> i32 {
5     #[cfg(unix)]
6     return 1;
7     #[cfg(not(unix))]
8     return 2;
9 }
10
11 #[deny(warnings)]
12 fn cfg_let_and_return() -> i32 {
13     #[cfg(unix)]
14     let x = 1;
15     #[cfg(not(unix))]
16     let x = 2;
17     x
18 }
19
20 fn main() {
21     cfg_return();
22     cfg_let_and_return();
23 }