diff options
| author | bors <bors@rust-lang.org> | 2020-09-14 05:54:44 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2020-09-14 05:54:44 +0000 |
| commit | b5f55b7e1562286798358730e06b0ba13b4c0ea6 (patch) | |
| tree | aca7faa45e22dc660d1483b9f6fd3f3744b9f476 /compiler/rustc_codegen_llvm/src | |
| parent | 56d8a933b3a344aa8980a17e2dbf338c177178fc (diff) | |
| parent | 49a61f59dfe14166742771025acee8b375717e09 (diff) | |
| download | rust-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
