rust-lang / rust-lang/rust-clippy

Ignore structs with doc(hidden) in exhaustive_structs lint

Open
#7,349 0 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

C-bug I-false-positive
Dominant language
Rust
Stars
13.5k
Forks
2.2k
Avg merge
2d 10h
Merged PRs (30d)
32

Description

Lint name: exhaustive_structs

I tried this code:

#[doc(hidden)]
pub struct Foo;

I expected to see this happen: No warning when the exhaustive_structs lint is enabled. The lint could/should consider structs with doc(hidden) private?

Instead, this happened: The lint emitted a warning.

Meta
clippy 0.1.54 (35fff69 2021-06-06)

rustc 1.54.0-nightly (35fff69d0 2021-06-06)
binary: rustc
commit-hash: 35fff69d043b1c0f5c29894e7f4b0da8b039c131
commit-date: 2021-06-06
host: x86_64-unknown-linux-gnu
release: 1.54.0-nightly
LLVM version: 12.0.1

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 implementation and tests for the exhaustive_structs lint in rust-clippy. Check how the lint identifies public structs and handles doc(hidden), then add a regression test for the shown struct. Done means a doc(hidden) struct no longer triggers the lint while existing exhaustive-struct checks remain covered.

Written by the indexing model from the issue text.

Assessment

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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.