about summary refs log tree commit diff
diff options
context:
space:
mode:
authorSuyash458 <suyash.behera458@gmail.com>2020-11-25 21:16:44 +0530
committerSuyash458 <suyash.behera458@gmail.com>2020-11-25 21:30:34 +0530
commit85a17b53343b27ea1470243e4c01844a2997e860 (patch)
treebc9714550676cc2384812dc6ce434da13e43a7a8
parent32c51d2c58c36df312d61a49a3512beb29c19636 (diff)
downloadrust-85a17b53343b27ea1470243e4c01844a2997e860.tar.gz
rust-85a17b53343b27ea1470243e4c01844a2997e860.zip
update README.md for specifying msrv
-rw-r--r--README.md24
1 files changed, 24 insertions, 0 deletions
diff --git a/README.md b/README.md
index 1da626b505d..080e8874427 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: