Skip to content

Commit c7869b8

Browse files
committed
Update references in doc directory
1 parent 33ee598 commit c7869b8

File tree

2 files changed

+9
-8
lines changed

2 files changed

+9
-8
lines changed

doc/adding_lints.md

+4-4
Original file line numberDiff line numberDiff line change
@@ -292,7 +292,7 @@ the next section. Let's worry about the details later and emit our lint for
292292

293293
Depending on how complex we want our lint message to be, we can choose from a
294294
variety of lint emission functions. They can all be found in
295-
[`clippy_lints/src/utils/diagnostics.rs`][diagnostics].
295+
[`clippy_utils/src/diagnostics.rs`][diagnostics].
296296

297297
`span_lint_and_help` seems most appropriate in this case. It allows us to
298298
provide an extra help message and we can't really suggest a better name
@@ -321,7 +321,7 @@ When code or an identifier must appear in a message or label, it should be
321321
surrounded with single grave accents \`.
322322

323323
[check_fn]: https://doc.rust-lang.org/nightly/nightly-rustc/rustc_lint/trait.EarlyLintPass.html#method.check_fn
324-
[diagnostics]: https://github.com/rust-lang/rust-clippy/blob/master/clippy_lints/src/utils/diagnostics.rs
324+
[diagnostics]: https://github.com/rust-lang/rust-clippy/blob/master/clippy_utils/src/diagnostics.rs
325325
[the rustc-dev-guide]: https://rustc-dev-guide.rust-lang.org/diagnostics.html
326326

327327
## Adding the lint logic
@@ -537,7 +537,7 @@ directory. Adding a configuration to a lint can be useful for thresholds or to c
537537
behavior that can be seen as a false positive for some users. Adding a configuration is done
538538
in the following steps:
539539

540-
1. Adding a new configuration entry to [clippy_lints::utils::conf](/clippy_lints/src/utils/conf.rs)
540+
1. Adding a new configuration entry to [clippy_utils::conf](/clippy_utils/src/conf.rs)
541541
like this:
542542
```rust
543543
/// Lint: LINT_NAME. <The configuration field doc comment>
@@ -636,7 +636,7 @@ documentation currently. This is unfortunate, but in most cases you can probably
636636
get away with copying things from existing similar lints. If you are stuck,
637637
don't hesitate to ask on [Zulip] or in the issue/PR.
638638

639-
[utils]: https://github.com/rust-lang/rust-clippy/blob/master/clippy_lints/src/utils/mod.rs
639+
[utils]: https://github.com/rust-lang/rust-clippy/blob/master/clippy_utils/src/lib.rs
640640
[if_chain]: https://docs.rs/if_chain/*/if_chain/
641641
[from_expansion]: https://doc.rust-lang.org/nightly/nightly-rustc/rustc_span/struct.Span.html#method.from_expansion
642642
[in_external_macro]: https://doc.rust-lang.org/nightly/nightly-rustc/rustc_middle/lint/fn.in_external_macro.html

doc/common_tools_writing_lints.md

+5-4
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ impl LateLintPass<'_> for MyStructLint {
7878
There are two ways to do this, depending if the target trait is part of lang items.
7979

8080
```rust
81-
use crate::utils::{implements_trait, match_trait_method, paths};
81+
use clippy_utils::{implements_trait, match_trait_method, paths};
8282

8383
impl LateLintPass<'_> for MyStructLint {
8484
fn check_expr(&mut self, cx: &LateContext<'_>, expr: &Expr<'_>) {
@@ -112,7 +112,7 @@ We access lang items through the type context `tcx`. `tcx` is of type [`TyCtxt`]
112112
To check if our type defines a method called `some_method`:
113113

114114
```rust
115-
use crate::utils::{is_type_diagnostic_item, return_ty};
115+
use clippy_utils::{is_type_diagnostic_item, return_ty};
116116

117117
impl<'tcx> LateLintPass<'tcx> for MyTypeImpl {
118118
fn check_impl_item(&mut self, cx: &LateContext<'tcx>, impl_item: &'tcx ImplItem<'_>) {
@@ -135,7 +135,7 @@ impl<'tcx> LateLintPass<'tcx> for MyTypeImpl {
135135

136136
# Dealing with macros
137137

138-
There are several helpers in Clippy's utils to deal with macros:
138+
There are several helpers in [`clippy_utils`][utils] to deal with macros:
139139

140140
- `in_macro()`: detect if the given span is expanded by a macro
141141

@@ -199,4 +199,5 @@ assert_eq!(differing_macro_contexts(x_is_some_span, x_unwrap_span), true);
199199
[LateContext]: https://doc.rust-lang.org/nightly/nightly-rustc/rustc_lint/struct.LateContext.html
200200
[TyCtxt]: https://doc.rust-lang.org/nightly/nightly-rustc/rustc_middle/ty/context/struct.TyCtxt.html
201201
[pat_ty]: https://doc.rust-lang.org/nightly/nightly-rustc/rustc_middle/ty/context/struct.TypeckResults.html#method.pat_ty
202-
[paths]: ../clippy_lints/src/utils/paths.rs
202+
[paths]: ../clippy_utils/src/paths.rs
203+
[utils]: https://github.com/rust-lang/rust-clippy/blob/master/clippy_utils/src/lib.rs

0 commit comments

Comments
 (0)