Message ID | 20250110184620.408302-3-pbonzini@redhat.com (mailing list archive) |
---|---|
State | New |
Headers | show |
Series | [PULL,01/38] rust: fix --enable-debug-mutex | expand |
Am 10.01.2025 um 19:45 hat Paolo Bonzini geschrieben: > 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> error: invalid `--check-cfg` argument: `test` | = note: expected `cfg(name, values("value1", "value2", ... "valueN"))` = note: visit <https://doc.rust-lang.org/nightly/rustc/check-cfg.html> for more details > 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") Should this be print("cfg(test)")? > for cfg in sorted(cargo_toml.check_cfg): > print("--check-cfg") > print(cfg) Kevin
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)
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(+)