about summary refs log tree commit diff
path: root/compiler/rustc_codegen_llvm/src
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2020-09-14 05:54:44 +0000
committerbors <bors@rust-lang.org>2020-09-14 05:54:44 +0000
commitb5f55b7e1562286798358730e06b0ba13b4c0ea6 (patch)
treeaca7faa45e22dc660d1483b9f6fd3f3744b9f476 /compiler/rustc_codegen_llvm/src
parent56d8a933b3a344aa8980a17e2dbf338c177178fc (diff)
parent49a61f59dfe14166742771025acee8b375717e09 (diff)
downloadrust-b5f55b7e1562286798358730e06b0ba13b4c0ea6.tar.gz
rust-b5f55b7e1562286798358730e06b0ba13b4c0ea6.zip
Auto merge of #76549 - ehuss:lints-comments, r=wesleywiser
Auto-generate lint documentation.

This adds a tool which will generate the lint documentation in the rustc book automatically. This is motivated by keeping the documentation up-to-date, and consistently formatted. It also ensures the examples are correct and that they actually generate the expected lint. The lint groups table is also auto-generated. See https://github.com/rust-lang/compiler-team/issues/349 for the original proposal.

An outline of how this works:
- The `declare_lint!` macro now accepts a doc comment where the documentation is written. This is inspired by how clippy works.
- A new tool `src/tools/lint-docs` scrapes the documentation and adds it to the rustc book during the build.
    - It runs each example and verifies its output and embeds the output in the book.
    - It does a few formatting checks.
    - It verifies that every lint is documented.
- Groups are collected from `rustc -W help`.

I updated the documentation for all the missing lints. I have also added an "Explanation" section to each lint providing a reason for the lint and suggestions on how to resolve it.

This can lead towards a future enhancement of possibly showing these docs via the `--explain` flag to make them easily accessible and discoverable.
Diffstat (limited to 'compiler/rustc_codegen_llvm/src')
0 files changed, 0 insertions, 0 deletions