Skip to content

Commit

Permalink
macros: suppress clippy::needless_return and add docs
Browse files Browse the repository at this point in the history
It triggers the warning for nightly clippy (since about 2024-09-26), but
is actually intentional.
  • Loading branch information
oxalica committed Sep 27, 2024
1 parent e2e1e8e commit eecfb1e
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion tokio-macros/src/entry.rs
Original file line number Diff line number Diff line change
Expand Up @@ -438,8 +438,9 @@ fn parse_knobs(mut input: ItemFn, is_test: bool, config: FinalConfig) -> TokenSt
};

let body_ident = quote! { body };
// This explicit `return` is intentional. See tokio-rs/tokio#4636
let last_block = quote_spanned! {last_stmt_end_span=>
#[allow(clippy::expect_used, clippy::diverging_sub_expression)]
#[allow(clippy::expect_used, clippy::diverging_sub_expression, clippy::needless_return)]
{
return #rt
.enable_all()
Expand Down

0 comments on commit eecfb1e

Please sign in to comment.