Skip to content

Commit

Permalink
rust: give Clippy the minimum supported Rust version
Browse files Browse the repository at this point in the history
Clippy has lints that refer to features in the language and library that
may not exist in the minimum version a given project supports. Thus it
offers the `msrv` field to avoid that.

For instance, Clippy should not suggest using `let ... else` in a lint
if the MSRV did not implement that syntax.

Currently, there should be no effect setting it, since there is no lint
that we currently enable that is affected by `msrv` [1] lower than our
minimum supported Rust version (1.78.0).

Rust is also considering adding a similar feature in `rustc` too, which
we should probably enable if it becomes available [2].

Nevertheless, enable it.

Link: https://github.com/rust-lang/rust-clippy/blob/8dd459d4c750dbf200bbd48a10f129b1401e7bf3/clippy_config/src/msrvs.rs#L19 [1]
Link: rust-lang/compiler-team#772 [2]
Signed-off-by: Miguel Ojeda <ojeda@kernel.org>
  • Loading branch information
ojeda committed Sep 4, 2024
1 parent f971578 commit d74d5a7
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions .clippy.toml
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
# SPDX-License-Identifier: GPL-2.0

msrv = "1.78.0"

0 comments on commit d74d5a7

Please sign in to comment.