Skip to content

Commit

Permalink
Generate less dead code for async block return type hint
Browse files Browse the repository at this point in the history
  • Loading branch information
kornelski committed Sep 4, 2023
1 parent bf05c61 commit bf5dc74
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions tracing-attributes/src/expand.rs
Original file line number Diff line number Diff line change
Expand Up @@ -66,11 +66,11 @@ pub(crate) fn gen_function<'a, B: ToTokens + 'a>(
let fake_return_edge = quote_spanned! {return_span=>
#[allow(
unknown_lints, unreachable_code, clippy::diverging_sub_expression,
clippy::let_unit_value, clippy::unreachable, clippy::let_with_type_underscore
clippy::let_unit_value, clippy::unreachable, clippy::let_with_type_underscore,
clippy::empty_loop
)]
if false {
let __tracing_attr_fake_return: #return_type =
unreachable!("this is just for type inference, and is unreachable code");
let __tracing_attr_fake_return: #return_type = loop {};
return __tracing_attr_fake_return;
}
};
Expand Down

0 comments on commit bf5dc74

Please sign in to comment.