From: Paolo Bonzini <pbonzini@redhat.com>
To: qemu-devel@nongnu.org
Subject: [PATCH] rust: add --check-cfg test to rustc arguments
Date: Tue, 7 Jan 2025 16:54:05 +0100 [thread overview]
Message-ID: <20250107155406.53161-1-pbonzini@redhat.com> (raw)
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..d79dc6d81f1 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("test")
for cfg in sorted(cargo_toml.check_cfg):
print("--check-cfg")
print(cfg)
--
2.47.1
next reply other threads:[~2025-01-07 15:54 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-01-07 15:54 Paolo Bonzini [this message]
2025-01-07 18:43 ` [PATCH] rust: add --check-cfg test to rustc arguments Paolo Bonzini
2025-01-17 16:00 ` Alex Bennée
2025-01-17 16:04 ` Paolo Bonzini
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20250107155406.53161-1-pbonzini@redhat.com \
--to=pbonzini@redhat.com \
--cc=qemu-devel@nongnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.