4 #![allow(unused_variables, unused_assignments, similar_names, blacklisted_name)]
5 #![deny(useless_let_if_seq)]
7 fn f() -> bool { true }
9 fn early_return() -> u8 {
10 // FIXME: we could extend the lint to include such cases:
26 //~^ ERROR `if _ { .. } else { .. }` is an expression
27 //~| HELP more idiomatic
28 //~| SUGGESTION let <mut> foo = if f() { 42 } else { 0 };
34 //~^ ERROR `if _ { .. } else { .. }` is an expression
35 //~| HELP more idiomatic
36 //~| SUGGESTION let <mut> bar = if f() { ..; 42 } else { ..; 0 };
46 //~^ ERROR `if _ { .. } else { .. }` is an expression
47 //~| HELP more idiomatic
48 //~| SUGGESTION let quz = if f() { 42 } else { 0 };
56 // `toto` is used several times
69 // baz needs to be mut
71 //~^ ERROR `if _ { .. } else { .. }` is an expression
72 //~| HELP more idiomatic
73 //~| SUGGESTION let <mut> baz = if f() { 42 } else { 0 };