File tree Expand file tree Collapse file tree 1 file changed +4
-3
lines changed Expand file tree Collapse file tree 1 file changed +4
-3
lines changed Original file line number Diff line number Diff line change @@ -55,10 +55,11 @@ pub(crate) fn gen_function<'a, B: ToTokens + 'a>(
55
55
// Install a fake return statement as the first thing in the function
56
56
// body, so that we eagerly infer that the return type is what we
57
57
// 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.
60
61
let fake_return_edge = quote_spanned ! { return_type. span( ) =>
61
- #[ allow( unreachable_code) ]
62
+ #[ allow( unreachable_code, clippy :: diverging_sub_expression ) ]
62
63
if false {
63
64
let __tracing_attr_fake_return: #return_type =
64
65
unreachable!( "this is just for type inference, and is unreachable code" ) ;
You can’t perform that action at this time.
0 commit comments