-
Notifications
You must be signed in to change notification settings - Fork 1.6k
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
no_effect_underscore_binding
: FP on field inside derive macros
#12045
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
24 tasks
I try same code in same environment but nothing happen. |
The code example was not quite correct, as it included a
|
@rustbot claim |
bors
added a commit
that referenced
this issue
Jan 11, 2024
Fix error warning span for issue12045 fixes [Issue#12045](#12045) In issue#12045, unexpected warning span occurs on attribute `#[derive(typed_builder::TypedBuilder)]`, actually the warning should underline `_lifetime`. In the source code we can find that the original intend is to warning on `ident.span`, but in this case, `stmt.span` is unequal with `ident.span`. So, fix the nit here is fine. Besides, `ident.span` have an accurate range than `stmt.span`. changelog: [`no_effect_underscore_binding`]: correct warning span
bors
added a commit
that referenced
this issue
Jan 19, 2024
Fix error warning span for issue12045 fixes [Issue#12045](#12045) In issue#12045, unexpected warning span occurs on attribute `#[derive(typed_builder::TypedBuilder)]`, actually the warning should underline `_lifetime`. In the source code we can find that the original intend is to warning on `ident.span`, but in this case, `stmt.span` is unequal with `ident.span`. So, fix the nit here is fine. Besides, `ident.span` have an accurate range than `stmt.span`. changelog: [`no_effect_underscore_binding`]: correct warning span
# for free
to join this conversation on GitHub.
Already have an account?
# 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
clippy::no_effect_underscore_binding
can trigger on fields starting with an underscore inside proc-macros. I looked at the code and it seems like the lint only checksLint Name
no_effect_underscore_binding
Reproducer
I tried this code:
This example code, sadly, uses a dependency:
I saw this happen:
I expected to see this happen:
Nothing
Version
Additional Labels
See:
The text was updated successfully, but these errors were encountered: