From 85a17b53343b27ea1470243e4c01844a2997e860 Mon Sep 17 00:00:00 2001 From: Suyash458 Date: Wed, 25 Nov 2020 21:16:44 +0530 Subject: [PATCH 1/3] update README.md for specifying msrv --- README.md | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/README.md b/README.md index 1da626b505df..080e88744271 100644 --- a/README.md +++ b/README.md @@ -147,6 +147,30 @@ lints can be configured and the meaning of the variables. To deactivate the “for further information visit *lint-link*” message you can define the `CLIPPY_DISABLE_DOCS_LINKS` environment variable. +### Specifying the minimum supported Rust version + +Projects that intend to support old versions of Rust can disable lints pertaining to newer features by +specifying the minimum supported Rust version (msrv) in the clippy configuration file. + +```toml +msrv = "1.30.0" +``` + +The msrv can also be specified as an inner attribute, like below. + +```rust +#![feature(custom_inner_attributes)] +#![clippy::msrv = "1.30.0"] + +fn main() { + ... +} +``` + +Tilde/Caret version requirements(like `^1.0` or `~1.2`) can be specified as well. + +Note: `custom_inner_attributes` is an unstable feature so it has to be enabled explicitly. + ### Allowing/denying lints You can add options to your code to `allow`/`warn`/`deny` Clippy lints: From 94a6832f0bc6ec2d1de0f71e39332eca408551da Mon Sep 17 00:00:00 2001 From: Suyash458 Date: Wed, 25 Nov 2020 22:09:50 +0530 Subject: [PATCH 2/3] update README.md --- README.md | 50 ++++++++++++++++++++++++++------------------------ 1 file changed, 26 insertions(+), 24 deletions(-) diff --git a/README.md b/README.md index 080e88744271..e5cff0cc621e 100644 --- a/README.md +++ b/README.md @@ -147,30 +147,6 @@ lints can be configured and the meaning of the variables. To deactivate the “for further information visit *lint-link*” message you can define the `CLIPPY_DISABLE_DOCS_LINKS` environment variable. -### Specifying the minimum supported Rust version - -Projects that intend to support old versions of Rust can disable lints pertaining to newer features by -specifying the minimum supported Rust version (msrv) in the clippy configuration file. - -```toml -msrv = "1.30.0" -``` - -The msrv can also be specified as an inner attribute, like below. - -```rust -#![feature(custom_inner_attributes)] -#![clippy::msrv = "1.30.0"] - -fn main() { - ... -} -``` - -Tilde/Caret version requirements(like `^1.0` or `~1.2`) can be specified as well. - -Note: `custom_inner_attributes` is an unstable feature so it has to be enabled explicitly. - ### Allowing/denying lints You can add options to your code to `allow`/`warn`/`deny` Clippy lints: @@ -218,6 +194,32 @@ cargo clippy -- -A clippy::all -W clippy::useless_format -W clippy::... ``` Note that if you've run clippy before, this may only take effect after you've modified a file or ran `cargo clean`. +### Specifying the minimum supported Rust version + +Projects that intend to support old versions of Rust can disable lints pertaining to newer features by +specifying the minimum supported Rust version (MSRV) in the clippy configuration file. + +```toml +msrv = "1.30.0" +``` + +The MSRV can also be specified as an inner attribute, like below. + +```rust +#![feature(custom_inner_attributes)] +#![clippy::msrv = "1.30.0"] + +fn main() { + ... +} +``` + +Tilde/Caret version requirements(like `^1.0` or `~1.2`) can be specified as well. + +Note: `custom_inner_attributes` is an unstable feature so it has to be enabled explicitly. + +Lints that recognize this configuration option can be found [here](https://rust-lang.github.io/rust-clippy/master/index.html#msrv) + ## Contributing If you want to contribute to Clippy, you can find more information in [CONTRIBUTING.md](https://github.com/rust-lang/rust-clippy/blob/master/CONTRIBUTING.md). From b2eb55b03ecd54595260320f4f08263033f813d1 Mon Sep 17 00:00:00 2001 From: Philipp Krones Date: Wed, 25 Nov 2020 20:37:32 +0100 Subject: [PATCH 3/3] Fix formatting in README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index e5cff0cc621e..35683e871339 100644 --- a/README.md +++ b/README.md @@ -214,7 +214,7 @@ fn main() { } ``` -Tilde/Caret version requirements(like `^1.0` or `~1.2`) can be specified as well. +Tilde/Caret version requirements (like `^1.0` or `~1.2`) can be specified as well. Note: `custom_inner_attributes` is an unstable feature so it has to be enabled explicitly.