rust-lang / rust-lang/rust-clippy

A 'close' annotation to restrict the bindings accessible by a block

Open
#2,914 9 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

A-lint C-an-interesting-project E-medium S-needs-discussion
Dominant language
Rust
Stars
13.5k
Forks
2.2k
Avg merge
2d 10h
Merged PRs (30d)
32

Description

cc https://github.com/rust-lang/rfcs/issues/2496 (@bpsuntrup @oli-obk @burdges)

It would be nice to have a way to just restrict the bindings accessible by a block of code, kinda like one of the early planned features of JAI. @oli-obk suggested this could be done as a clippy lint, which sounds neat.

I'm opening this issue so we can bikeshed the syntax, discuss limitations, and possibly implement it (or to give people a chance to object to it being implemented in clippy).

Scattered thoughts/discussion starters in the next comment.

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 reading the linked RFC issue 2496 and the discussion in this issue, including the JAI example. Clarify the proposed syntax, limitations, and whether a Clippy lint is viable; done would require a settled design and an agreed implementation direction.

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
20/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.