Skip to content

redundant_closure_call: suggestion does not work if inner expression is async block #11357

Closed
@KisaragiEffective

Description

@KisaragiEffective

Summary

Suggestion does not work if the inner expression is async block.

Reproducer

I tried this code:

let x = (|| async {})().await;

I expected to see this happen:

let x = async {}.await;

Instead, this happened:

let x = async async {}.await;

Version

rustc 1.73.0-nightly (31395ec38 2023-07-24)
binary: rustc
commit-hash: 31395ec38250b60b380fd3c27e94756aba3557de
commit-date: 2023-07-24
host: x86_64-unknown-linux-gnu
release: 1.73.0-nightly
LLVM version: 16.0.5

Additional Labels

@rustbot label +I-suggestion-causes-error

Metadata

Metadata

Labels

C-bugCategory: Clippy is not doing the correct thingI-suggestion-causes-errorIssue: The suggestions provided by this Lint cause an ICE/error when applied

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions