rust-lang / rust-lang/rust-clippy

Lint pub interfaces that contain non-std and/or non-core types

Open
#2,104 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

S-needs-discussion
Dominant language
Rust
Stars
13.5k
Forks
2.2k
Avg merge
2d 10h
Merged PRs (30d)
32

Description

I propose kind of an information leak lint. Sometimes it is entirely unnecessary to e.g. return a value of a type that is only required within a crate. E.g., instead of returning a regex::Matches type a pub fn could return a newly defined type expressing the right amount of information e.g. in combination with impl Trait. The advantage would be that your crate is coupled less tightly to its dependencies, with all various advantageous implications of that.

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

The issue proposes a Clippy lint for public functions whose interfaces expose non-standard or non-core types, using regex::Matches and impl Trait as examples. No files, tests, or entry points are identified; first determine the intended lint scope and decide what cases count as an information leak, then add coverage showing that the intended public interfaces are reported.

Written by the indexing model from the issue text.

Assessment

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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.