Repository navigation
Add let_underscore_drop_guard lint. - #164414
theemathas wants to merge 1 commit into
Conversation
This lint is similar to the existing `let_underscore_lock` lint, but applies to `DropGuard` instead of `MutexGuard` and similar types.
|
rustbot has assigned @petrochenkov. Use Why was this reviewer chosen?The reviewer was selected based on:
|
|
Lang-nominating to ask for approval for adding a new lint. Also, does it make sense to beta-backport this so that we have the lint at the same time as |
|
As discussed in the Zulip thread, perhaps we want a more general mechanism here? |
|
I agree it makes sense to have a lint to catch this kind of problem with drop guards for the same reason as mutex guards. @rfcbot fcp merge lang I see the note that a more general mechanism might be nice, and I don't disagree, but we can always remove any behaviour from this lint in future should the general mechanism be created, so I don't see a need to reject this one. If we end up with another dead name in the removed-lints list eventually, so be it. |
|
@scottmcm has proposed to merge this. The next step is review by the rest of the tagged team members: No concerns currently listed. Once a majority of reviewers approve (and at most 2 approvals are outstanding), this will enter its final comment period. If you spot a major issue that hasn't been raised at any point in this process, please speak up! cc @rust-lang/lang-advisors: FCP proposed for lang, please feel free to register concerns. |
I think this should be backported. Do you have a link to where some of T-libs disagrees? (I happen to be on T-libs but not on the FCP list.) |
I agree with this, |
This lint is similar to the existing
let_underscore_locklint, but applies toDropGuardinstead ofMutexGuardand similar types. It is deny-by-default, likelet_underscore_lock. (Note that the relatedlet_underscore_droplint is allow-by-default.)Relevant discussion: #t-libs > Linting `let _ = DropGuard::new(....);`
Note that
DropGuardis a newly stabilized type, currently in 1.100 beta, and will be on the 1.100 stable release on November 12.Tracking issue for
DropGuard: #144426