rust: configure MSRV in Clippy
This setting makes Clippy never apply lints that are meant for
later versions. In case the target precise toolchain is the one
running, it does not make a difference, but this gives us a
machine-parseable specification that is pretty standard.
The README and `hg help rust` are updated to state that `clippy.toml`
is the single source of truth about that, also lifting a minor ambiguity:
it is fine if the MSRV is lagging behind the version in Debian testing.
--- a/mercurial/helptext/rust.txt Tue Apr 04 11:47:32 2023 +0200
+++ b/mercurial/helptext/rust.txt Tue Apr 04 11:58:35 2023 +0200
@@ -76,8 +76,9 @@
MSRV
====
-The minimum supported Rust version is currently 1.61.0. The project's policy is
-to follow the version from Debian testing, to make the distributions' job easier.
+The minimum supported Rust version is defined in `rust/clippy.toml`.
+The project's policy is to keep it at or below the version from Debian testing,
+to make the distributions' job easier.
rhg
===
--- a/rust/README.rst Tue Apr 04 11:47:32 2023 +0200
+++ b/rust/README.rst Tue Apr 04 11:58:35 2023 +0200
@@ -79,9 +79,25 @@
Developing Rust
===============
-The current version of Rust in use is ``1.61.0``, because it's what Debian
-testing has. You can use ``rustup override set 1.61.0`` at the root of the repo
-to make it easier on you.
+Minimum Supported Rust Version
+------------------------------
+
+The minimum supported rust version (MSRV) is specified in the `Clippy`_
+configuration file at ``rust/clippy.toml``. It is set to be ``1.61.0`` as of
+this writing, but keep in mind that the authoritative value is the one
+from the configuration file.
+
+We bump it from time to time, with the general rule being that our
+MSRV should not be greater that the version of the Rust toolchain
+shipping with Debian testing, so that the Rust enhanced Mercurial can
+be eventually packaged in Debian.
+
+To ensure that you are not depending on features introduced in later
+versions, you can issue ``rustup override set x.y.z`` at the root of
+the repository.
+
+Build and development
+---------------------
Go to the ``hg-cpython`` folder::
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/rust/clippy.toml Tue Apr 04 11:58:35 2023 +0200
@@ -0,0 +1,1 @@
+msrv = "1.61.0"