aboutsummaryrefslogtreecommitdiff
path: root/scripts/rust
diff options
context:
space:
mode:
authorPaolo Bonzini <pbonzini@redhat.com>2025-01-07 16:52:25 +0100
committerPaolo Bonzini <pbonzini@redhat.com>2025-01-10 23:34:41 +0100
commit1d03e9771e05685e11bbd3cc8cdd072c02cf580d (patch)
treefd0059f9bc517dde6ecc9248870ff6b730ed5455 /scripts/rust
parent122748c83d2a331b43ea17efd78c4117a362f3f2 (diff)
downloadqemu-1d03e9771e05685e11bbd3cc8cdd072c02cf580d.zip
qemu-1d03e9771e05685e11bbd3cc8cdd072c02cf580d.tar.gz
qemu-1d03e9771e05685e11bbd3cc8cdd072c02cf580d.tar.bz2
rust: add --check-cfg test to rustc arguments
rustc will check that every reachable #[cfg] matches a list of the expected config names and values. Recent versions of rustc are also complaining about #[cfg(test)], even if it is basically a standard part of the language. So, always allow it. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Diffstat (limited to 'scripts/rust')
-rw-r--r--scripts/rust/rustc_args.py2
1 files changed, 2 insertions, 0 deletions
diff --git a/scripts/rust/rustc_args.py b/scripts/rust/rustc_args.py
index 5525b38..2633157 100644
--- a/scripts/rust/rustc_args.py
+++ b/scripts/rust/rustc_args.py
@@ -215,6 +215,8 @@ def main() -> None:
if rustc_version >= (1, 80):
if args.lints:
+ print("--check-cfg")
+ print("cfg(test)")
for cfg in sorted(cargo_toml.check_cfg):
print("--check-cfg")
print(cfg)