about summary refs log tree commit diff
path: root/src/tools/clippy/book
diff options
context:
space:
mode:
authorflip1995 <hello@philkrones.com>2022-10-23 15:18:45 +0200
committerflip1995 <hello@philkrones.com>2022-10-23 15:18:45 +0200
commitda9755b6ba108b04eb9dfc771d0a6dd2f86f911b (patch)
tree047004632ca9dee93a27bc5e0d5fa63b4c990966 /src/tools/clippy/book
parente64f1110c062f61746f222059439529a43ccf6dc (diff)
parent4f142aa1058f14f153f8bfd2d82f04ddb9982388 (diff)
downloadrust-da9755b6ba108b04eb9dfc771d0a6dd2f86f911b.tar.gz
rust-da9755b6ba108b04eb9dfc771d0a6dd2f86f911b.zip
Merge commit '4f142aa1058f14f153f8bfd2d82f04ddb9982388' into clippyup
Diffstat (limited to 'src/tools/clippy/book')
-rw-r--r--src/tools/clippy/book/src/development/adding_lints.md23
-rw-r--r--src/tools/clippy/book/src/development/basics.md7
2 files changed, 25 insertions, 5 deletions
diff --git a/src/tools/clippy/book/src/development/adding_lints.md b/src/tools/clippy/book/src/development/adding_lints.md
index b1e843bc7f4..3c3f368a529 100644
--- a/src/tools/clippy/book/src/development/adding_lints.md
+++ b/src/tools/clippy/book/src/development/adding_lints.md
@@ -478,8 +478,27 @@ impl<'tcx> LateLintPass<'tcx> for ManualStrip {
 ```
 
 Once the `msrv` is added to the lint, a relevant test case should be added to
-`tests/ui/min_rust_version_attr.rs` which verifies that the lint isn't emitted
-if the project's MSRV is lower.
+the lint's test file, `tests/ui/manual_strip.rs` in this example. It should
+have a case for the version below the MSRV and one with the same contents but
+for the MSRV version itself.
+
+```rust
+#![feature(custom_inner_attributes)]
+
+...
+
+fn msrv_1_44() {
+    #![clippy::msrv = "1.44"]
+
+    /* something that would trigger the lint */
+}
+
+fn msrv_1_45() {
+    #![clippy::msrv = "1.45"]
+
+    /* something that would trigger the lint */
+}
+```
 
 As a last step, the lint should be added to the lint documentation. This is done
 in `clippy_lints/src/utils/conf.rs`:
diff --git a/src/tools/clippy/book/src/development/basics.md b/src/tools/clippy/book/src/development/basics.md
index 44ba6e32755..6fb53236e6f 100644
--- a/src/tools/clippy/book/src/development/basics.md
+++ b/src/tools/clippy/book/src/development/basics.md
@@ -69,7 +69,7 @@ the reference file with:
 cargo dev bless
 ```
 
-For example, this is necessary, if you fix a typo in an error message of a lint
+For example, this is necessary if you fix a typo in an error message of a lint,
 or if you modify a test file to add a test case.
 
 > _Note:_ This command may update more files than you intended. In that case
@@ -101,8 +101,9 @@ cargo dev setup intellij
 cargo dev dogfood
 ```
 
-More about intellij command usage and reasons
-[here](https://github.com/rust-lang/rust-clippy/blob/master/CONTRIBUTING.md#intellij-rust)
+More about [intellij] command usage and reasons.
+
+[intellij]: https://github.com/rust-lang/rust-clippy/blob/master/CONTRIBUTING.md#intellij-rust
 
 ## lintcheck