]> git.ipfire.org Git - thirdparty/qemu.git/commitdiff
rust: add --check-cfg test to rustc arguments
authorPaolo Bonzini <pbonzini@redhat.com>
Tue, 7 Jan 2025 15:52:25 +0000 (16:52 +0100)
committerPaolo Bonzini <pbonzini@redhat.com>
Fri, 10 Jan 2025 22:34:41 +0000 (23:34 +0100)
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>
scripts/rust/rustc_args.py

index 5525b3886fa1b7deb8024c11aa0f96d80f34e961..2633157df2aa0b0a166d51c3d8483fa43b250441 100644 (file)
@@ -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)