rust-lang / rust-lang/rust

Documentation example of lint warnings broken for rustc lints

Open
#119,010 4 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

A-docs C-enhancement P-low T-compiler
Dominant language
Rust
Stars
119k
Forks
16.2k
PR merge metrics
PR metrics pending

Description

Rustc lints have placeholder {{produces}} in examples that should generate actual warnings for documentation, but it currently not working, as can be seen on https://doc.rust-lang.org/nightly/nightly-rustc/rustc_lint/let_underscore/static.LET_UNDERSCORE_DROP.html, for example; it should contain actual warning text instead of {{produces}}.

As of version presented on site:

1.76.0-nightly (a96d57bdb 2023-12-15)

Some description of how it should work: https://github.com/rust-lang/rust/blob/1c6a06183a1452c2772db370b572e38bac9c5d86/compiler/rustc_lint_defs/src/lib.rs#L769-L788

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 compiler/rustc_lint_defs/src/lib.rs around lines 769-788 and compare its behavior with the generated rustc_lint documentation page for LET_UNDERSCORE_DROP. Trace how the lint example reaches the documentation output, then verify that the published example contains the actual warning text instead of {{produces}}.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
compilers, documentation
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.