From: Paolo Bonzini Date: Tue, 7 Jan 2025 15:52:25 +0000 (+0100) Subject: rust: add --check-cfg test to rustc arguments X-Git-Url: http://git.maquefel.me/?a=commitdiff_plain;h=1d03e9771e05685e11bbd3cc8cdd072c02cf580d;p=qemu.git 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 --- diff --git a/scripts/rust/rustc_args.py b/scripts/rust/rustc_args.py index 5525b3886f..2633157df2 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)