Skip to content

Commit 6bd3d40

Browse files
Abhicodes-cryptohawkw
authored andcommitted
attributes: allow clippy::unreachable warning (#2356)
## Motivation PR #2270 added an unreachable branch with an explicit return value to `#[instrument]` in `async fn`s in order to fix type inference issues. That PR added the appropriate `#[allow]` attribute for the Rust compiler's unreachable code linting, but not Clippy's, so a Clippy warning is still emitted. See: #2270 (comment) ## Solution Adding the clippy lint warning as discussed here: #2270 (comment)
1 parent 5ff8a41 commit 6bd3d40

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

tracing-attributes/src/expand.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ pub(crate) fn gen_function<'a, B: ToTokens + 'a>(
6464
// unreachable, but does affect inference, so it needs to be written
6565
// exactly that way for it to do its magic.
6666
let fake_return_edge = quote_spanned! {return_span=>
67-
#[allow(unreachable_code, clippy::diverging_sub_expression, clippy::let_unit_value)]
67+
#[allow(unreachable_code, clippy::diverging_sub_expression, clippy::let_unit_value, clippy::unreachable)]
6868
if false {
6969
let __tracing_attr_fake_return: #return_type =
7070
unreachable!("this is just for type inference, and is unreachable code");

0 commit comments

Comments
 (0)