Skip to content

Commit 94a6832

Browse files
committed
update README.md
1 parent 85a17b5 commit 94a6832

File tree

1 file changed

+26
-24
lines changed

1 file changed

+26
-24
lines changed

README.md

+26-24
Original file line numberDiff line numberDiff line change
@@ -147,30 +147,6 @@ 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-
174150
### Allowing/denying lints
175151

176152
You can add options to your code to `allow`/`warn`/`deny` Clippy lints:
@@ -218,6 +194,32 @@ cargo clippy -- -A clippy::all -W clippy::useless_format -W clippy::...
218194
```
219195
Note that if you've run clippy before, this may only take effect after you've modified a file or ran `cargo clean`.
220196

197+
### Specifying the minimum supported Rust version
198+
199+
Projects that intend to support old versions of Rust can disable lints pertaining to newer features by
200+
specifying the minimum supported Rust version (MSRV) in the clippy configuration file.
201+
202+
```toml
203+
msrv = "1.30.0"
204+
```
205+
206+
The MSRV can also be specified as an inner attribute, like below.
207+
208+
```rust
209+
#![feature(custom_inner_attributes)]
210+
#![clippy::msrv = "1.30.0"]
211+
212+
fn main() {
213+
...
214+
}
215+
```
216+
217+
Tilde/Caret version requirements(like `^1.0` or `~1.2`) can be specified as well.
218+
219+
Note: `custom_inner_attributes` is an unstable feature so it has to be enabled explicitly.
220+
221+
Lints that recognize this configuration option can be found [here](https://rust-lang.github.io/rust-clippy/master/index.html#msrv)
222+
221223
## Contributing
222224

223225
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).

0 commit comments

Comments
 (0)