[PULL 02/38] rust: add --check-cfg test to rustc arguments

Paolo Bonzini posted 38 patches 2 weeks, 5 days ago
Only 1 patches received!
[PULL 02/38] rust: add --check-cfg test to rustc arguments
Posted by Paolo Bonzini 2 weeks, 5 days ago
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 | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/scripts/rust/rustc_args.py b/scripts/rust/rustc_args.py
index 5525b3886fa..2633157df2a 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)
-- 
2.47.1
  • [PULL 02/38] rust: add --check-cfg test to rustc arguments