rust: build: generate lint flags from Cargo.toml
authorPaolo Bonzini <pbonzini@redhat.com>
Thu, 7 Nov 2024 09:02:15 +0000 (10:02 +0100)
committerPaolo Bonzini <pbonzini@redhat.com>
Tue, 10 Dec 2024 17:44:06 +0000 (18:44 +0100)
commit97ed1e9c8e2b0744508ef61cac8a23bb1e107820
treec1276a27f44e3e92d343fb016a420a48782d486f
parent1de82059aa097340d0ffde9140d338cddef478e5
rust: build: generate lint flags from Cargo.toml

Cargo.toml makes it possible to describe the desired lint level settings
in a nice format.  We can extend this to Meson-built crates, by teaching
rustc_args.py to fetch lint and --check-cfg arguments from Cargo.toml.
--check-cfg arguments come from the unexpected_cfgs lint as well as crate
features

Start with qemu-api, since it already has a [lints.rust] table and
an invocation of rustc_args.py.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
meson.build
rust/qemu-api/meson.build
scripts/rust/rustc_args.py