diff options
| author | bors <bors@rust-lang.org> | 2022-07-13 11:10:51 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2022-07-13 11:10:51 +0000 |
| commit | ca4e39400ef33198e2715973d1c67a1d3cee15e7 (patch) | |
| tree | ef1ab0f047db44028413e3bdeb9ed024a8e4e491 /src/tools | |
| parent | a639f89d0414a34b7a72702849f3e9f95b46de5c (diff) | |
| parent | f290811aaf4a434d7bf25dda1ff16fa6bd930c8f (diff) | |
| download | rust-ca4e39400ef33198e2715973d1c67a1d3cee15e7.tar.gz rust-ca4e39400ef33198e2715973d1c67a1d3cee15e7.zip | |
Auto merge of #99203 - GuillaumeGomez:rollup-b2re0dv, r=GuillaumeGomez
Rollup of 10 pull requests Successful merges: - #98789 (rustdoc-json-types: Clean up derives.) - #98848 (Build the Clippy book as part of x.py doc) - #99020 (check non_exhaustive attr and private fields for transparent types) - #99132 (Add some autolabels for A-bootstrap and T-infra) - #99148 (Clarify that [iu]size bounds were only defined for the target arch) - #99152 (Use CSS variables to handle theming (part 2)) - #99168 (Add regression test for #74713) - #99176 (:arrow_up: rust-analyzer) - #99183 (Mention rust-analyzer maintainers when `proc_macro` bridge is changed) - #99185 (llvm-wrapper: adapt for LLVM API change) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
Diffstat (limited to 'src/tools')
| -rw-r--r-- | src/tools/clippy/book/src/README.md | 2 | ||||
| -rw-r--r-- | src/tools/clippy/book/src/development/adding_lints.md | 33 | ||||
| -rw-r--r-- | src/tools/clippy/book/src/development/basics.md | 2 | ||||
| -rw-r--r-- | src/tools/clippy/book/src/development/common_tools_writing_lints.md | 2 | ||||
| -rw-r--r-- | src/tools/clippy/book/src/usage.md | 2 | ||||
| m--------- | src/tools/rust-analyzer | 14 |
6 files changed, 29 insertions, 26 deletions
diff --git a/src/tools/clippy/book/src/README.md b/src/tools/clippy/book/src/README.md index d941f8b65e8..6248d588a89 100644 --- a/src/tools/clippy/book/src/README.md +++ b/src/tools/clippy/book/src/README.md @@ -1,7 +1,7 @@ # Clippy [](https://github.com/rust-lang/rust-clippy/actions?query=workflow%3A%22Clippy+Test%22+event%3Apush+branch%3Aauto) -[](#license) +[](https://github.com/rust-lang/rust-clippy#license) A collection of lints to catch common mistakes and improve your [Rust](https://github.com/rust-lang/rust) code. diff --git a/src/tools/clippy/book/src/development/adding_lints.md b/src/tools/clippy/book/src/development/adding_lints.md index 3da07fcb968..d06297f2e07 100644 --- a/src/tools/clippy/book/src/development/adding_lints.md +++ b/src/tools/clippy/book/src/development/adding_lints.md @@ -13,7 +13,6 @@ because that's clearly a non-descriptive name. - [Testing](#testing) - [Cargo lints](#cargo-lints) - [Rustfix tests](#rustfix-tests) - - [Edition 2018 tests](#edition-2018-tests) - [Testing manually](#testing-manually) - [Lint declaration](#lint-declaration) - [Lint registration](#lint-registration) @@ -402,9 +401,8 @@ need to ensure that the MSRV configured for the project is >= the MSRV of the required Rust feature. If multiple features are required, just use the one with a lower MSRV. -First, add an MSRV alias for the required feature in -[`clippy_utils::msrvs`](/clippy_utils/src/msrvs.rs). This can be accessed later -as `msrvs::STR_STRIP_PREFIX`, for example. +First, add an MSRV alias for the required feature in [`clippy_utils::msrvs`]. +This can be accessed later as `msrvs::STR_STRIP_PREFIX`, for example. ```rust msrv_aliases! { @@ -468,6 +466,8 @@ define_Conf! { } ``` +[`clippy_utils::msrvs`]: https://doc.rust-lang.org/nightly/nightly-rustc/clippy_utils/msrvs/index.html + ## Author lint If you have trouble implementing your lint, there is also the internal `author` @@ -583,8 +583,7 @@ the workspace directory. Adding a configuration to a lint can be useful for thresholds or to constrain some behavior that can be seen as a false positive for some users. Adding a configuration is done in the following steps: -1. Adding a new configuration entry to - [clippy_lints::utils::conf](/clippy_lints/src/utils/conf.rs) like this: +1. Adding a new configuration entry to [`clippy_lints::utils::conf`] like this: ```rust /// Lint: LINT_NAME. @@ -635,9 +634,9 @@ for some users. Adding a configuration is done in the following steps: ``` 3. Passing the configuration value to the lint impl struct: - First find the struct construction in the [clippy_lints lib - file](/clippy_lints/src/lib.rs). The configuration value is now cloned or - copied into a local value that is then passed to the impl struct like this: + First find the struct construction in the [`clippy_lints` lib file]. The + configuration value is now cloned or copied into a local value that is then + passed to the impl struct like this: ```rust // Default generated registration: @@ -653,12 +652,16 @@ for some users. Adding a configuration is done in the following steps: 4. Adding tests: 1. The default configured value can be tested like any normal lint in - [`tests/ui`](/tests/ui). - 2. The configuration itself will be tested separately in - [`tests/ui-toml`](/tests/ui-toml). Simply add a new subfolder with a - fitting name. This folder contains a `clippy.toml` file with the - configuration value and a rust file that should be linted by Clippy. The - test can otherwise be written as usual. + [`tests/ui`]. + 2. The configuration itself will be tested separately in [`tests/ui-toml`]. + Simply add a new subfolder with a fitting name. This folder contains a + `clippy.toml` file with the configuration value and a rust file that + should be linted by Clippy. The test can otherwise be written as usual. + +[`clippy_lints::utils::conf`]: https://github.com/rust-lang/rust-clippy/blob/master/clippy_lints/src/utils/conf.rs +[`clippy_lints` lib file]: https://github.com/rust-lang/rust-clippy/blob/master/clippy_lints/src/lib.rs +[`tests/ui`]: https://github.com/rust-lang/rust-clippy/blob/master/tests/ui +[`tests/ui-toml`]: https://github.com/rust-lang/rust-clippy/blob/master/tests/ui-toml ## Cheat Sheet diff --git a/src/tools/clippy/book/src/development/basics.md b/src/tools/clippy/book/src/development/basics.md index 78c429ea013..605897ff49c 100644 --- a/src/tools/clippy/book/src/development/basics.md +++ b/src/tools/clippy/book/src/development/basics.md @@ -98,7 +98,7 @@ cargo dev setup intellij ``` More about intellij command usage and reasons -[here](../CONTRIBUTING.md#intellij-rust) +[here](https://github.com/rust-lang/rust-clippy/blob/master/CONTRIBUTING.md#intellij-rust) ## lintcheck diff --git a/src/tools/clippy/book/src/development/common_tools_writing_lints.md b/src/tools/clippy/book/src/development/common_tools_writing_lints.md index e1ed89262f6..15e00c7d7ce 100644 --- a/src/tools/clippy/book/src/development/common_tools_writing_lints.md +++ b/src/tools/clippy/book/src/development/common_tools_writing_lints.md @@ -276,4 +276,4 @@ functions to deal with macros: [LateContext]: https://doc.rust-lang.org/nightly/nightly-rustc/rustc_lint/struct.LateContext.html [TyCtxt]: https://doc.rust-lang.org/nightly/nightly-rustc/rustc_middle/ty/context/struct.TyCtxt.html [pat_ty]: https://doc.rust-lang.org/nightly/nightly-rustc/rustc_middle/ty/context/struct.TypeckResults.html#method.pat_ty -[paths]: ../clippy_utils/src/paths.rs +[paths]: https://doc.rust-lang.org/nightly/nightly-rustc/clippy_utils/paths/index.html diff --git a/src/tools/clippy/book/src/usage.md b/src/tools/clippy/book/src/usage.md index 337680aa313..5d858e0da46 100644 --- a/src/tools/clippy/book/src/usage.md +++ b/src/tools/clippy/book/src/usage.md @@ -148,4 +148,4 @@ clippy-driver --edition 2018 -Cpanic=abort foo.rs > that are not optimized as expected, for example. [Installation]: installation.md -[CI]: continuous_integration +[CI]: continuous_integration/index.md diff --git a/src/tools/rust-analyzer b/src/tools/rust-analyzer -Subproject 75b22326dad1914c22484ab6672de5cae94f745 +Subproject 5342f47f4276641ddb5f0a5e08fb307742d6cdc |
