3 #![warn(clippy::implicit_return)]
4 #![allow(clippy::needless_return, clippy::needless_bool, unused, clippy::never_loop)]
6 fn test_end_of_fn() -> bool {
15 fn test_if_block() -> bool {
16 if true { return true } else { return false }
20 fn test_match(x: bool) -> bool {
23 false => { return true },
27 fn test_match_with_unreachable(x: bool) -> bool {
30 false => unreachable!(),
34 fn test_loop() -> bool {
40 fn test_loop_with_block() -> bool {
48 fn test_loop_with_nests() -> bool {
58 #[allow(clippy::redundant_pattern_matching)]
59 fn test_loop_with_if_let() -> bool {
61 if let Some(x) = Some(true) {
69 let _ = || { return true };
70 let _ = || return true;
73 fn test_panic() -> bool {
77 fn test_return_macro() -> String {
78 return format!("test {}", "test")
81 fn macro_branch_test() -> bool {
83 ($t:expr, $f:expr) => {
84 if true { $t } else { $f }
87 return m!(true, false)
90 fn loop_test() -> bool {
107 fn loop_macro_test() -> bool {
118 fn divergent_test() -> bool {
126 async fn foo() -> bool {