aboutsummaryrefslogtreecommitdiff
path: root/rust
diff options
context:
space:
mode:
authorPaolo Bonzini <pbonzini@redhat.com>2024-11-07 10:02:15 +0100
committerPaolo Bonzini <pbonzini@redhat.com>2024-12-10 18:44:06 +0100
commit97ed1e9c8e2b0744508ef61cac8a23bb1e107820 (patch)
treec1276a27f44e3e92d343fb016a420a48782d486f /rust
parent1de82059aa097340d0ffde9140d338cddef478e5 (diff)
downloadqemu-97ed1e9c8e2b0744508ef61cac8a23bb1e107820.zip
qemu-97ed1e9c8e2b0744508ef61cac8a23bb1e107820.tar.gz
qemu-97ed1e9c8e2b0744508ef61cac8a23bb1e107820.tar.bz2
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>
Diffstat (limited to 'rust')
-rw-r--r--rust/qemu-api/meson.build4
1 files changed, 2 insertions, 2 deletions
diff --git a/rust/qemu-api/meson.build b/rust/qemu-api/meson.build
index 2ff6d2c..1ed7967 100644
--- a/rust/qemu-api/meson.build
+++ b/rust/qemu-api/meson.build
@@ -1,6 +1,6 @@
_qemu_api_cfg = run_command(rustc_args,
- '--config-headers', config_host_h, files('Cargo.toml'),
- capture: true, check: true).stdout().strip().split()
+ '--config-headers', config_host_h, '--features', '--lints', files('Cargo.toml'),
+ capture: true, check: true).stdout().strip().splitlines()
# _qemu_api_cfg += ['--cfg', 'feature="allocator"']
if rustc.version().version_compare('>=1.77.0')