Skip to content

Commit 33354fd

Browse files
Suppress clippy divergence warning
1 parent 9aea0e5 commit 33354fd

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

tracing-attributes/src/expand.rs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -55,10 +55,11 @@ pub(crate) fn gen_function<'a, B: ToTokens + 'a>(
5555
// Install a fake return statement as the first thing in the function
5656
// body, so that we eagerly infer that the return type is what we
5757
// declared in the async fn signature.
58-
// The `#[allow(unreachable_code)]` is given because the return
59-
// statement is unreachable, but does affect inference.
58+
// The `#[allow(..)]` is given because the return statement is
59+
// unreachable, but does affect inference, so it needs to be written
60+
// exactly that way for it to do its magic.
6061
let fake_return_edge = quote_spanned! {return_type.span()=>
61-
#[allow(unreachable_code)]
62+
#[allow(unreachable_code, clippy::diverging_sub_expression)]
6263
if false {
6364
let __tracing_attr_fake_return: #return_type =
6465
unreachable!("this is just for type inference, and is unreachable code");

0 commit comments

Comments
 (0)