Commit Graph

8 Commits

Author SHA1 Message Date
Eric Wu
8de011fdf7 don't lint field_reassign when field in closure
This commit makes the ContainsName struct visit all interior
expressions, which means that ContainsName will return true
even if `name` is used in a closure within `expr`.
2023-01-01 21:41:46 -05:00
ThibsG
7aaed02b8c Fix false positive when Drop and Copy involved 2021-10-09 14:56:33 +02:00
flip1995
0854f0caee
Don't trigger field_reassign_with_default in macros
Producing a good suggestion for this lint is already hard when no macros
are involved. With macros the lint message and the suggestion are just
confusing. Since both, producing a good suggestion and figuring out if
this pattern can be re-written inside a macro is nearly impossible, just
bail out.
2021-05-04 16:48:43 +02:00
ThibsG
3ddaabcbc9 Fix suggestion with generics for field_reassign_with_default lint 2021-03-21 09:58:04 +01:00
Philipp Hansch
92f2bbbe06
Fix macro issues with field_reassign_with_default 2021-01-05 20:31:13 +01:00
Matthias Krüger
5d48b91b40 field_reassign_with_default: don't expand macros in suggestion
fixes #6522

changelog: field_reassign_with_default: don't expand macros in lint suggestion (#6522)
2021-01-01 17:01:09 +01:00
Cameron Steffen
c6450c70dd Fix field_reassign_with_default for private fields 2020-12-22 11:09:46 -06:00
Henri Lunnikivi
7b203f3da6 Implement field_reassign_with_default
- Implement `field_reassign_with_default` as a `LateLintPass`
- Avoid triggering `default_trait_access` on a span already linted by
`field_reassigned_with_default`
- Merge `default_trait_access` and `field_reassign_with_default` into
`Default`
- Co-authored-by: Eduardo Broto <ebroto@tutanota.com>
- Fixes #568
2020-10-31 15:49:58 +02:00