mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-24 07:44:10 +00:00
update README.md for specifying msrv
This commit is contained in:
parent
32c51d2c58
commit
85a17b5334
24
README.md
24
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:
|
||||
|
Loading…
Reference in New Issue
Block a user