4 #![warn(clippy::implicit_return)]
5 #![allow(clippy::needless_return, clippy::needless_bool, unused, clippy::never_loop)]
7 fn test_end_of_fn() -> bool {
16 fn test_if_block() -> bool {
17 if true { return true } else { return false }
21 fn test_match(x: bool) -> bool {
24 false => { return true },
28 fn test_match_with_unreachable(x: bool) -> bool {
31 false => unreachable!(),
35 fn test_loop() -> bool {
41 fn test_loop_with_block() -> bool {
49 fn test_loop_with_nests() -> bool {
59 #[allow(clippy::redundant_pattern_matching)]
60 fn test_loop_with_if_let() -> bool {
62 if let Some(x) = Some(true) {
70 let _ = || { return true };
71 let _ = || return true;
74 fn test_panic() -> bool {
78 fn test_return_macro() -> String {
79 return format!("test {}", "test")
82 fn macro_branch_test() -> bool {
84 ($t:expr, $f:expr) => {
85 if true { $t } else { $f }
88 return m!(true, false)
91 fn loop_test() -> bool {
108 fn loop_macro_test() -> bool {
119 fn divergent_test() -> bool {
127 async fn foo() -> bool {