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
..
rustc just max_level_info 2020-09-11 09:37:51 -07:00
rustc_apfloat mv compiler to compiler/ 2020-08-30 18:45:07 +03:00
rustc_arena mv compiler to compiler/ 2020-08-30 18:45:07 +03:00
rustc_ast Fully integrate token collection for additional AST structs 2020-09-10 17:58:14 -04:00
rustc_ast_lowering Attach `TokenStream` to `ast::Visibility` 2020-09-10 17:33:06 -04:00
rustc_ast_passes update the version of itertools and parking_lot 2020-09-12 08:26:53 +02:00
rustc_ast_pretty Fully integrate token collection for additional AST structs 2020-09-10 17:58:14 -04:00
rustc_attr mv compiler to compiler/ 2020-08-30 18:45:07 +03:00
rustc_builtin_macros Attach tokens to `ast::Stmt` 2020-09-10 17:33:06 -04:00
rustc_codegen_llvm Rollup merge of #74787 - petrochenkov:rustllvm, r=cuviper 2020-09-09 21:02:24 -07:00
rustc_codegen_ssa use push(char) instead of push_str(&str) to add single chars to strings 2020-09-10 13:58:41 +02:00
rustc_data_structures update the version of itertools and parking_lot 2020-09-12 08:26:53 +02:00
rustc_driver just max_level_info 2020-09-11 09:37:51 -07:00
rustc_error_codes Rollup merge of #75984 - kornelski:typeormodule, r=matthewjasper 2020-09-09 15:05:45 -07:00
rustc_errors replacing sub's that can wrap by saturating_sub's 2020-09-11 11:11:11 +02:00
rustc_expand Attach tokens to `ast::Stmt` 2020-09-10 17:33:06 -04:00
rustc_feature fix tidy, small cleanup 2020-09-10 09:48:02 +02:00
rustc_fs_util mv compiler to compiler/ 2020-08-30 18:45:07 +03:00
rustc_graphviz Also fixed monospace font for d3-graphviz engine 2020-09-09 14:49:32 -07:00
rustc_hir review, improve note span 2020-09-13 22:53:51 +02:00
rustc_hir_pretty mv compiler to compiler/ 2020-08-30 18:45:07 +03:00
rustc_incremental mv compiler to compiler/ 2020-08-30 18:45:07 +03:00
rustc_index Improve `BitSet` APIs 2020-08-30 11:13:18 -07:00
rustc_infer Auto merge of #76244 - vandenheuvel:remove__paramenv__def_id, r=nikomatsakis 2020-09-13 16:28:22 +00:00
rustc_interface Attach tokens to `ast::Stmt` 2020-09-10 17:33:06 -04:00
rustc_lexer lexer: Tiny improvement to shebang detection 2020-09-02 00:40:19 +03:00
rustc_lint Auto merge of #76549 - ehuss:lints-comments, r=wesleywiser 2020-09-14 05:54:44 +00:00
rustc_llvm Move `rustllvm` into `rustc_llvm` 2020-09-09 23:05:43 +03:00
rustc_macros Fix non-determinism in generated format string. 2020-09-09 21:23:25 +10:00
rustc_metadata Auto merge of #76656 - jonas-schievink:fewer-unstable-metadata-queries, r=lcnr 2020-09-14 00:26:43 +00:00
rustc_middle Auto merge of #76244 - vandenheuvel:remove__paramenv__def_id, r=nikomatsakis 2020-09-13 16:28:22 +00:00
rustc_mir Auto merge of #76123 - tmiasko:inline-args-storage, r=wesleywiser 2020-09-14 02:13:02 +00:00
rustc_mir_build Auto merge of #75573 - Aaron1011:feature/const-mutation-lint, r=oli-obk 2020-09-10 05:54:26 +00:00
rustc_parse Auto merge of #76598 - ad-anssi:diagnostic_errors_fix, r=estebank 2020-09-13 11:08:41 +00:00
rustc_parse_format mv compiler to compiler/ 2020-08-30 18:45:07 +03:00
rustc_passes allow concrete self types in consts 2020-09-13 22:53:51 +02:00
rustc_plugin_impl mv compiler to compiler/ 2020-08-30 18:45:07 +03:00
rustc_privacy Change ty.kind to a method 2020-09-04 17:47:51 +02:00
rustc_query_system update the version of itertools and parking_lot 2020-09-12 08:26:53 +02:00
rustc_resolve review, improve note span 2020-09-13 22:53:51 +02:00
rustc_save_analysis use push(char) instead of push_str(&str) to add single chars to strings 2020-09-10 13:58:41 +02:00
rustc_serialize mv compiler to compiler/ 2020-08-30 18:45:07 +03:00
rustc_session Make const_evaluatable_unchecked lint example not depend on the architecture pointer size. 2020-09-13 11:13:59 -07:00
rustc_span Add visualization of rustc span in doc 2020-09-13 20:48:15 +08:00
rustc_symbol_mangling Change ty.kind to a method 2020-09-04 17:47:51 +02:00
rustc_target remove redundant clones 2020-09-09 16:32:55 +02:00
rustc_trait_selection Auto merge of #76244 - vandenheuvel:remove__paramenv__def_id, r=nikomatsakis 2020-09-13 16:28:22 +00:00
rustc_traits Remove def_id field from ParamEnv 2020-09-09 10:14:31 +02:00
rustc_ty Remove def_id field from ParamEnv 2020-09-09 10:14:31 +02:00
rustc_typeck review, improve note span 2020-09-13 22:53:51 +02:00