about summary refs log tree commit diff
path: root/book/src/development/adding_lints.md
diff options
context:
space:
mode:
authorPhilipp Krones <hello@philkrones.com>2025-01-28 18:28:57 +0100
committerPhilipp Krones <hello@philkrones.com>2025-01-28 19:14:45 +0100
commit145d5adf04fecbc48bdf2ab2a356ca4c8df0c149 (patch)
tree1783d720a01e7ef83d143293961fd83200728556 /book/src/development/adding_lints.md
parentc5196736b27a32b688b957f2937dd4affadbe14f (diff)
parent25509e71359ea0b218309d4b7e94bf40e1ef716e (diff)
downloadrust-145d5adf04fecbc48bdf2ab2a356ca4c8df0c149.tar.gz
rust-145d5adf04fecbc48bdf2ab2a356ca4c8df0c149.zip
Merge remote-tracking branch 'upstream/master' into rustup
Diffstat (limited to 'book/src/development/adding_lints.md')
-rw-r--r--book/src/development/adding_lints.md13
1 files changed, 7 insertions, 6 deletions
diff --git a/book/src/development/adding_lints.md b/book/src/development/adding_lints.md
index c07568697d0..c26ad319f4f 100644
--- a/book/src/development/adding_lints.md
+++ b/book/src/development/adding_lints.md
@@ -299,10 +299,11 @@ This is good, because it makes writing this particular lint less complicated.
 We have to make this decision with every new Clippy lint. It boils down to using
 either [`EarlyLintPass`][early_lint_pass] or [`LateLintPass`][late_lint_pass].
 
-In short, the `EarlyLintPass` runs before type checking and
-[HIR](https://rustc-dev-guide.rust-lang.org/hir.html) lowering and the `LateLintPass`
-has access to type information. Consider using the `LateLintPass` unless you need
-something specific from the `EarlyLintPass`.
+`EarlyLintPass` runs before type checking and
+[HIR](https://rustc-dev-guide.rust-lang.org/hir.html) lowering, while `LateLintPass`
+runs after these stages, providing access to type information. The `cargo dev new_lint` command
+defaults to the recommended `LateLintPass`, but you can specify `--pass=early` if your lint
+only needs AST level analysis.
 
 Since we don't need type information for checking the function name, we used
 `--pass=early` when running the new lint automation and all the imports were
@@ -537,7 +538,7 @@ via `Tools -> Clippy` and you should see the generated code in the output below.
 If the command was executed successfully, you can copy the code over to where
 you are implementing your lint.
 
-[author_example]: https://play.rust-lang.org/?version=nightly&mode=debug&edition=2018&gist=9a12cb60e5c6ad4e3003ac6d5e63cf55
+[author_example]: https://play.rust-lang.org/?version=nightly&mode=debug&edition=2024&gist=9a12cb60e5c6ad4e3003ac6d5e63cf55
 
 ## Print HIR lint
 
@@ -552,7 +553,7 @@ attribute to expressions you often need to enable
 _Clippy_.
 
 [_High-Level Intermediate Representation (HIR)_]: https://rustc-dev-guide.rust-lang.org/hir.html
-[print_hir_example]: https://play.rust-lang.org/?version=nightly&mode=debug&edition=2021&gist=daf14db3a7f39ca467cd1b86c34b9afb
+[print_hir_example]: https://play.rust-lang.org/?version=nightly&mode=debug&edition=2024&gist=daf14db3a7f39ca467cd1b86c34b9afb
 
 ## Documentation