about summary refs log tree commit diff
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2020-11-25 19:41:42 +0000
committerbors <bors@rust-lang.org>2020-11-25 19:41:42 +0000
commit71f7dd813a4ffb0ae3d77b56e3f2e1e36c49e604 (patch)
tree0e67d5b1e70d64335199ac798f154f8df1fbbec4
parentae57785966e4bd1d80ade0bc239076d40e72ccee (diff)
parentb2eb55b03ecd54595260320f4f08263033f813d1 (diff)
downloadrust-71f7dd813a4ffb0ae3d77b56e3f2e1e36c49e604.tar.gz
rust-71f7dd813a4ffb0ae3d77b56e3f2e1e36c49e604.zip
Auto merge of #6379 - Suyash458:master, r=flip1995
update readme for specifying msrv

changelog: add some documentation for the `msrv` feature (#6097)
related PR: https://github.com/rust-lang/rust-clippy/pull/6201
-rw-r--r--README.md26
1 files changed, 26 insertions, 0 deletions
diff --git a/README.md b/README.md
index 1da626b505d..35683e87133 100644
--- a/README.md
+++ b/README.md
@@ -194,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).