rust: configure clippy to only report issues relevant to our MSRV

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/38807>
This commit is contained in:
Eric Engestrom 2025-10-04 14:48:11 +02:00
parent 71f0c0d6a6
commit 9a681f20ef
4 changed files with 9 additions and 3 deletions

View file

@ -15,7 +15,8 @@ section_start rust "Building Rust toolchain"
# This version number should match what we require in meson.build so we catch
# build issues from patches relying on new features in newer Rust versions.
# Keep this is sync with the `rustc.version()` check in meson.build, and with
# the `rustup default` line in .gitlab-ci/meson/build.sh
# the `rustup default` line in .gitlab-ci/meson/build.sh and the `msrv` in
# clippy.toml
MINIMUM_SUPPORTED_RUST_VERSION=1.82.0
# This version number can be bumped freely, to benefit from the latest

View file

@ -44,7 +44,8 @@ fi
# Android manages the rust toolchain differently, ignore that case
if [ "$CI_JOB_STAGE" = "build-for-tests" ] && [[ "$CI_JOB_NAME" != *android* ]]; then
# Keep this in sync with the `rustc.version()` check in meson.build, and
# MINIMUM_SUPPORTED_RUST_VERSION in .gitlab-ci/container/build-rust.sh
# MINIMUM_SUPPORTED_RUST_VERSION in .gitlab-ci/container/build-rust.sh and the
# `msrv` in clippy.toml
rustup default 1.82.0
fi

4
clippy.toml Normal file
View file

@ -0,0 +1,4 @@
# Keep this in sync with the `rustc.version()` check in meson.build, the
# MINIMUM_SUPPORTED_RUST_VERSION in .gitlab-ci/container/build-rust.sh, the
# `rustup default` line in .gitlab-ci/meson/build.sh
msrv = "1.82.0"

View file

@ -790,7 +790,7 @@ if with_gallium_rusticl or with_nouveau_vk or with_tools.contains('etnaviv') or
# Keep this in sync with the MINIMUM_SUPPORTED_RUST_VERSION in
# .gitlab-ci/container/build-rust.sh and the `rustup default` line in
# .gitlab-ci/meson/build.sh
# .gitlab-ci/meson/build.sh and the `msrv` in clippy.toml
if rustc.version().version_compare('< 1.82')
error('Mesa requires Rust 1.82.0 or newer')
endif