rust-lang / rust-lang/rust-clippy
lint `SyncSender::send`
Nobody has claimed this yet.
- Dominant language
- Rust
- Stars
- 13.5k
- Forks
- 2.2k
- Avg merge
- 2d 10h
- Merged PRs (30d)
- 32
Description
I'm not sure many people are using the stdlib MPSC with select! destabilized, but I propose a lint that suggests SyncSender::send always be replaced with SyncSender::try_send.
The reason is that many users of SyncSender do not expect their senders to ever block, and are only using SyncSender to prevent bugs on the receiver end from translating into memory-DoS bugs. However, when using send this means that such bugs can translate into DoS anyway by deadlocking.
This should be allow by default.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by examining the lint entry point for SyncSender::send and compare it with SyncSender::try_send. Determine how the suggestion should replace the call and confirm that the new lint is allowed by default; the work is done when the lint emits that suggestion for the intended usage.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust
- Domain
- tooling
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100