-
Notifications
You must be signed in to change notification settings - Fork 1.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Incorrect clippy::needless_return on async tests in latest nightly #13458
Labels
C-bug
Category: Clippy is not doing the correct thing
I-false-positive
Issue: The lint was triggered on code it shouldn't have
Comments
Same issue with use anyhow::Result;
#[tokio::main]
async fn main() -> Result<()> {
Ok(())
}
|
1 task
This was referenced Sep 26, 2024
Berrysoft
added a commit
to Berrysoft/compio
that referenced
this issue
Sep 26, 2024
y21
added
the
I-false-positive
Issue: The lint was triggered on code it shouldn't have
label
Sep 26, 2024
Closed
This was referenced Sep 30, 2024
Clippy is drunk 🍺 |
avrabe
added a commit
to avrabe/fmu-rs
that referenced
this issue
Oct 5, 2024
The allowed one is related to rust-lang/rust-clippy#13458 as we start as tokio::main and never return.
avrabe
added a commit
to avrabe/fmu-rs
that referenced
this issue
Oct 5, 2024
The allowed one is related to rust-lang/rust-clippy#13458 as we start as tokio::main and never return.
AlexTMjugador
added a commit
to ComunidadAylas/PackSquash
that referenced
this issue
Oct 6, 2024
Our problem was already reported and is being tracked upstream at rust-lang/rust-clippy#13458.
appcypher
added a commit
to appcypher/monocore
that referenced
this issue
Oct 7, 2024
appcypher
added a commit
to appcypher/monocore
that referenced
this issue
Oct 7, 2024
* fix: downloaded layer integrity checks - checking that file has already been downloaded - check file integrity after download - change directory where layers are downloaded to no include registry like `docker` subdir * chore: disabling nightly checks because clippy nightly is buggy - see rust-lang/rust-clippy#13458
Celeo
added a commit
to Celeo/vzdv
that referenced
this issue
Oct 8, 2024
will-lynas
added a commit
to will-lynas/quaestor
that referenced
this issue
Oct 11, 2024
Bug workaround rust-lang/rust-clippy#13458
ia0
added a commit
to ia0/magika
that referenced
this issue
Oct 18, 2024
It was disabled by google#726 due to a false positive tracked and fixed by rust-lang/rust-clippy#13458.
flip1995
pushed a commit
to flip1995/rust-clippy
that referenced
this issue
Oct 18, 2024
Don't warn on proc macro generated code in `needless_return` Fixes rust-lang#13458 Fixes rust-lang#13457 Fixes rust-lang#13467 Fixes rust-lang#13479 Fixes rust-lang#13481 Fixes rust-lang#13526 Fixes rust-lang#13486 The fix is unfortunately a little more convoluted than just simply adding a `is_from_proc_macro`. That check *does* fix the issue, however it also introduces a bunch of false negatives in the tests, specifically when the returned expression is in a different syntax context, e.g. `return format!(..)`. The proc macro check builds up a start and end pattern based on the HIR nodes and compares it to a snippet of the span, however that would currently fail for `return format!(..)` because we would have the patterns `("return", <something inside of the format macro>)`, which doesn't compare equal. So we now return an empty string pattern for when it's in a different syntax context. "Hide whitespace" helps a bit for reviewing the proc macro detection change changelog: none
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
C-bug
Category: Clippy is not doing the correct thing
I-false-positive
Issue: The lint was triggered on code it shouldn't have
Summary
In the latest nightly, on tokio::test functions, the last assert is flagged with clippy::needless_return
Reproducer
I tried this code:
And ran this
I expected to see this happen:
I expected clippy to pass
Instead, this happened:
It write this error
Version
rustc 1.83.0-nightly (9e394f551 2024-09-25)
binary: rustc
commit-hash: 9e394f551c050ff03c6fc57f190e0761cf0be6e8
commit-date: 2024-09-25
host: x86_64-unknown-linux-gnu
release: 1.83.0-nightly
LLVM version: 19.1.0
Additional Labels
No response
The text was updated successfully, but these errors were encountered: