aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaolo Bonzini <pbonzini@redhat.com>2024-12-20 18:46:33 +0100
committerJussi Pakkanen <jpakkane@gmail.com>2025-01-08 12:07:31 +0200
commitf2b22f87a1cc18693e043c7cd1021af613d9dfef (patch)
tree32feea08f8d167d8d64c89f30c3ec19acbda76cc
parent2450342535274d13adbad6c0ac93aca82649c5c6 (diff)
downloadmeson-f2b22f87a1cc18693e043c7cd1021af613d9dfef.zip
meson-f2b22f87a1cc18693e043c7cd1021af613d9dfef.tar.gz
meson-f2b22f87a1cc18693e043c7cd1021af613d9dfef.tar.bz2
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 <pbonzini@redhat.com>
-rw-r--r--docs/markdown/Builtin-options.md2
-rw-r--r--mesonbuild/compilers/rust.py2
2 files changed, 3 insertions, 1 deletions
diff --git a/docs/markdown/Builtin-options.md b/docs/markdown/Builtin-options.md
index f16a46f..3a91280 100644
--- a/docs/markdown/Builtin-options.md
+++ b/docs/markdown/Builtin-options.md
@@ -98,6 +98,8 @@ machine](#specifying-options-per-machine) section for details.
| force_fallback_for | [] | Force fallback for those dependencies | no | no |
| vsenv | false | Activate Visual Studio environment | no | no |
+(For the Rust language only, `warning_level=0` disables all warnings).
+
#### Details for `backend`
Several build file formats are supported as command runners to build the
diff --git a/mesonbuild/compilers/rust.py b/mesonbuild/compilers/rust.py
index 717d563..bc3f4cb 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'],