5 #![deny(let_and_return)]
8 let _y = 0; // no warning
9 let x = 5; //~NOTE this expression can be directly returned
10 x //~ERROR returning the result of a let binding
13 fn test_inner() -> i32 {
15 let x = 5; //~NOTE this expression can be directly returned
16 x //~ERROR returning the result of a let binding
22 fn test_nowarn_1() -> i32 {
28 fn test_nowarn_2() -> i32 {
33 fn test_nowarn_3() -> (i32, i32) {
34 // this should technically warn, but we do not compare complex patterns