update references of clippy_utils::msrvs
and clippy_lints::util::conf
This commit is contained in:
parent
789bc73d8a
commit
b9efa3ee2c
@ -436,7 +436,7 @@ 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
|
required Rust feature. If multiple features are required, just use the one with
|
||||||
a lower MSRV.
|
a lower MSRV.
|
||||||
|
|
||||||
First, add an MSRV alias for the required feature in [`clippy_utils::msrvs`].
|
First, add an MSRV alias for the required feature in [`clippy_config::msrvs`].
|
||||||
This can be accessed later as `msrvs::STR_STRIP_PREFIX`, for example.
|
This can be accessed later as `msrvs::STR_STRIP_PREFIX`, for example.
|
||||||
|
|
||||||
```rust
|
```rust
|
||||||
@ -506,7 +506,7 @@ fn msrv_1_45() {
|
|||||||
```
|
```
|
||||||
|
|
||||||
As a last step, the lint should be added to the lint documentation. This is done
|
As a last step, the lint should be added to the lint documentation. This is done
|
||||||
in `clippy_lints/src/utils/conf.rs`:
|
in `clippy_config/src/conf.rs`:
|
||||||
|
|
||||||
```rust
|
```rust
|
||||||
define_Conf! {
|
define_Conf! {
|
||||||
@ -516,7 +516,7 @@ define_Conf! {
|
|||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
[`clippy_utils::msrvs`]: https://doc.rust-lang.org/nightly/nightly-rustc/clippy_utils/msrvs/index.html
|
[`clippy_config::msrvs`]: https://doc.rust-lang.org/nightly/nightly-rustc/clippy_config/msrvs/index.html
|
||||||
|
|
||||||
## Author lint
|
## Author lint
|
||||||
|
|
||||||
@ -657,7 +657,7 @@ Adding a configuration to a lint can be useful for
|
|||||||
thresholds or to constrain some behavior that can be seen as a false positive
|
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:
|
for some users. Adding a configuration is done in the following steps:
|
||||||
|
|
||||||
1. Adding a new configuration entry to [`clippy_lints::utils::conf`] like this:
|
1. Adding a new configuration entry to [`clippy_config::conf`] like this:
|
||||||
|
|
||||||
```rust,ignore
|
```rust,ignore
|
||||||
/// Lint: LINT_NAME.
|
/// Lint: LINT_NAME.
|
||||||
@ -736,7 +736,7 @@ for some users. Adding a configuration is done in the following steps:
|
|||||||
|
|
||||||
Run `cargo collect-metadata` to generate documentation changes for the book.
|
Run `cargo collect-metadata` to generate documentation changes for the book.
|
||||||
|
|
||||||
[`clippy_lints::utils::conf`]: https://github.com/rust-lang/rust-clippy/blob/master/clippy_lints/src/utils/conf.rs
|
[`clippy_config::conf`]: https://github.com/rust-lang/rust-clippy/blob/master/clippy_config/src/conf.rs
|
||||||
[`clippy_lints` lib file]: https://github.com/rust-lang/rust-clippy/blob/master/clippy_lints/src/lib.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`]: 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
|
[`tests/ui-toml`]: https://github.com/rust-lang/rust-clippy/blob/master/tests/ui-toml
|
||||||
|
@ -320,8 +320,8 @@ impl {pass_type}{pass_lifetimes} for {name_camel} {{
|
|||||||
extract_msrv_attr!({context_import});
|
extract_msrv_attr!({context_import});
|
||||||
}}
|
}}
|
||||||
|
|
||||||
// TODO: Add MSRV level to `clippy_utils/src/msrvs.rs` if needed.
|
// TODO: Add MSRV level to `clippy_config/src/msrvs.rs` if needed.
|
||||||
// TODO: Update msrv config comment in `clippy_lints/src/utils/conf.rs`
|
// TODO: Update msrv config comment in `clippy_config/src/conf.rs`
|
||||||
"#
|
"#
|
||||||
)
|
)
|
||||||
} else {
|
} else {
|
||||||
|
@ -490,7 +490,7 @@ fn check_ty(&mut self, cx: &LateContext<'_>, hir_ty: &hir::Ty<'_>, mut context:
|
|||||||
// All lints that are being checked in this block are guarded by
|
// All lints that are being checked in this block are guarded by
|
||||||
// the `avoid_breaking_exported_api` configuration. When adding a
|
// the `avoid_breaking_exported_api` configuration. When adding a
|
||||||
// new lint, please also add the name to the configuration documentation
|
// new lint, please also add the name to the configuration documentation
|
||||||
// in `clippy_lints::utils::conf.rs`
|
// in `clippy_config::conf`
|
||||||
|
|
||||||
let mut triggered = false;
|
let mut triggered = false;
|
||||||
triggered |= box_collection::check(cx, hir_ty, qpath, def_id);
|
triggered |= box_collection::check(cx, hir_ty, qpath, def_id);
|
||||||
|
Loading…
Reference in New Issue
Block a user