Skip to content

Commit 85a17b5

Browse files
committed
update README.md for specifying msrv
1 parent 32c51d2 commit 85a17b5

File tree

1 file changed

+24
-0
lines changed

1 file changed

+24
-0
lines changed

README.md

+24
Original file line numberDiff line numberDiff line change
@@ -147,6 +147,30 @@ lints can be configured and the meaning of the variables.
147147
To deactivate the “for further information visit *lint-link*” message you can
148148
define the `CLIPPY_DISABLE_DOCS_LINKS` environment variable.
149149

150+
### Specifying the minimum supported Rust version
151+
152+
Projects that intend to support old versions of Rust can disable lints pertaining to newer features by
153+
specifying the minimum supported Rust version (msrv) in the clippy configuration file.
154+
155+
```toml
156+
msrv = "1.30.0"
157+
```
158+
159+
The msrv can also be specified as an inner attribute, like below.
160+
161+
```rust
162+
#![feature(custom_inner_attributes)]
163+
#![clippy::msrv = "1.30.0"]
164+
165+
fn main() {
166+
...
167+
}
168+
```
169+
170+
Tilde/Caret version requirements(like `^1.0` or `~1.2`) can be specified as well.
171+
172+
Note: `custom_inner_attributes` is an unstable feature so it has to be enabled explicitly.
173+
150174
### Allowing/denying lints
151175

152176
You can add options to your code to `allow`/`warn`/`deny` Clippy lints:

0 commit comments

Comments
 (0)