Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

update readme for specifying msrv #6379

Merged
merged 3 commits into from
Nov 25, 2020
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 24 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -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.
flip1995 marked this conversation as resolved.
Show resolved Hide resolved

```toml
msrv = "1.30.0"
```

The msrv can also be specified as an inner attribute, like below.
flip1995 marked this conversation as resolved.
Show resolved Hide resolved

```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: