rust-lang / rust-lang/rust-clippy
Documentation mistakenly using `///` instead of `//!`
Nobody has claimed this yet.
- Dominant language
- Rust
- Stars
- 13.5k
- Forks
- 2.2k
- Avg merge
- 2d 10h
- Merged PRs (30d)
- 32
Description
What it does
In the Linux kernel we had some documentation added with /// instead of //!, which meant the docs applied to a use line and thus silently discarded.
Advantage
Documentation is not discarded silently.
Drawbacks
False positives when someone does want to document an item that follows. However, if it is something like a private use, it is likely it was a mistake. Thus the lint should limit itself to such cases.
Example
Both
//! Title.
/// Long...
///
/// ...description.
use ...;
and
//! Title.
/// Long...
///
/// ...description.
use ...;
should probably have been written as
//! Title.
//!
//! Long...
//!
//! ...description.
use ...;
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by comparing the two Rust examples in the issue, focusing on outer documentation attached to a use line and the intended inner-documentation form. Define how the lint distinguishes likely mistakes from intentional item documentation, including the private-use limitation. Done means the discarded-documentation case is detected without the described false positives.
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
- Mostly clear
- Newbie friendliness
- 38/100