rust-lang / rust-lang/rust-clippy

future_not_send unclear about what value is held across an await

Open
#14,271 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

C-enhancement E-needs-mcve
Dominant language
Rust
Stars
13.5k
Forks
2.2k
Avg merge
2d 10h
Merged PRs (30d)
32

Description

Description

Hi, I love rust-clippy, but one lint which bugs me is future_not_send, because it reads

"future is not Send as this value is used across an await"

and (to me) it's unclear to what "this value" refers, or how to fix the problem

Would it be possible to make the future_not_send lint more clear / explanatory about what exactly is the value being held across the await and, if possible, guide async noobs like me to fix the issue so we could make the future in question implement Send properly?

future_not_send

Sorry, I don't have a great repro I can share right now, let me know if that's necessary and I'll try to come up with one

Version
> rustc -Vv
rustc 1.87.0-nightly (f04bbc60f 2025-02-20)
binary: rustc
commit-hash: f04bbc60f8c353ee5ba0677bc583ac4a88b2c180
commit-date: 2025-02-20
host: x86_64-unknown-linux-gnu
release: 1.87.0-nightly
LLVM version: 20.1.0
Additional Labels

No response

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the future_not_send lint documentation linked in the issue and inspect how its current diagnostic is presented. Create a minimal async example that triggers the lint, then determine what information can explain the value held across the await and how to fix it. Done means the diagnostic is more specific and actionable, with suitable coverage for the revised wording.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
tooling
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.