From f2b22f87a1cc18693e043c7cd1021af613d9dfef Mon Sep 17 00:00:00 2001 From: Paolo Bonzini Date: Fri, 20 Dec 2024 18:46:33 +0100 Subject: rust: change warning_level=0 to "--cap-lints allow" This is a better and more backwards-compatible way to disable all warnings, compared to "-A warnings". The Rust RFC (https://rust-lang.github.io/rfcs/1193-cap-lints.html) explains the rationale: > We would very much like to be able to modify lints, however. For example > rust-lang/rust#26473 updated the missing_docs lint to also look for missing > documentation on const items. This ended up breaking some crates in the > ecosystem due to their usage of #![deny(missing_docs)]. While at it, document that Rust deviates from the other languages in its interpretation of warning_level=0. Signed-off-by: Paolo Bonzini --- mesonbuild/compilers/rust.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'mesonbuild/compilers/rust.py') diff --git a/mesonbuild/compilers/rust.py b/mesonbuild/compilers/rust.py index 717d5635f..bc3f4cb6c 100644 --- a/mesonbuild/compilers/rust.py +++ b/mesonbuild/compilers/rust.py @@ -69,7 +69,7 @@ class RustCompiler(Compiler): id = 'rustc' _WARNING_LEVELS: T.Dict[str, T.List[str]] = { - '0': ['-A', 'warnings'], + '0': ['--cap-lints', 'allow'], '1': [], '2': [], '3': ['-W', 'warnings'], -- cgit v1.2.3