Closed
Description
Summary
the implicit_return
set on deny adds a return (or multiple) in front the braces for the closure's code block. This doesn't clash well with the fact that rust-fmt automatically puts expressions such as async || return ...
into a block like async || { return ... }
.
Lint Name
implicit_return
Reproducer
I tried this code:
return crate::api::v1::basic_get::<Champs>(data, async |x| {
Champs::filter_by_category(
Category::try_from(path.into_inner()).unwrap_or(Category::NonSc),
x,
)
.await;
)
.await;
I saw this happen:
return crate::api::v1::basic_get::<Champs>(data, async |x| return return return return return {
Champs::filter_by_category(
Category::try_from(path.into_inner()).unwrap_or(Category::NonSc),
x,
)
.await;
})
.await;
I expected to see this happen:
return crate::api::v1::basic_get::<Champs>(data, async |x| {
return Champs::filter_by_category(
Category::try_from(path.into_inner()).unwrap_or(Category::NonSc),
x,
)
.await;
)
.await;
Version
rustc 1.85.0 (4d91de4e4 2025-02-17)
binary: rustc
commit-hash: 4d91de4e48198da2e33413efdcd9cd2cc0c46688
commit-date: 2025-02-17
host: x86_64-unknown-linux-gnu
release: 1.85.0
LLVM version: 19.1.7
Additional Labels
No response