rust-lang / rust-lang/rust-clippy

Fix lint attributes/emission location for `await_holding_*` lints

Open
#9,047 0 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

C-enhancement T-async-await
Dominant language
Rust
Stars
13.5k
Forks
2.2k
Avg merge
2d 10h
Merged PRs (30d)
32

Description

Description

The lints: await_holding_lock, await_holding_refcell and await_holding_invalid_type. Are currently emitted at the function they are in, while the diagnostic highlights an expression inside the function. This means that lint attributes only work on the function and not on the displayed expression. This also affects the #[expect] attribute, which will not be fulfilled, if added to the displayed expression.

Version
rustc 1.63.0-nightly (b31f9cc22 2022-06-15)
binary: rustc
commit-hash: b31f9cc22bcd720b37ddf927afe378108a5b9a54
commit-date: 2022-06-15
host: x86_64-unknown-linux-gnu
release: 1.63.0-nightly
LLVM version: 14.0.5
Additional Labels

This issue is part of https://github.com/rust-lang/rust/issues/97660

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 by locating the implementations and tests for the await_holding_lock, await_holding_refcell, and await_holding_invalid_type lints. Check how each lint emits its diagnostic and how lint attributes and #[expect] are tested. Done means the lint is emitted at the displayed expression and attributes on that expression are honored.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
devtools
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
42/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.