Files
rust/compiler
bors b5f55b7e15 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.
2020-09-14 05:54:44 +00:00
..
2020-09-11 09:37:51 -07:00
2020-08-30 18:45:07 +03:00
2020-08-30 18:45:07 +03:00
2020-08-30 18:45:07 +03:00
2020-09-11 09:37:51 -07:00
2020-09-10 17:33:06 -04:00
2020-09-10 09:48:02 +02:00
2020-08-30 18:45:07 +03:00
2020-09-13 22:53:51 +02:00
2020-08-30 18:45:07 +03:00
2020-08-30 11:13:18 -07:00
2020-09-09 23:05:43 +03:00
2020-09-04 17:47:51 +02:00
2020-09-13 22:53:51 +02:00
2020-08-30 18:45:07 +03:00
2020-09-09 16:32:55 +02:00
2020-09-13 22:53:51 +02:00