aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--docs/markdown/snippets/rustc-improvements.md4
-rw-r--r--mesonbuild/compilers/rust.py5
2 files changed, 9 insertions, 0 deletions
diff --git a/docs/markdown/snippets/rustc-improvements.md b/docs/markdown/snippets/rustc-improvements.md
new file mode 100644
index 0000000..2db0a11
--- /dev/null
+++ b/docs/markdown/snippets/rustc-improvements.md
@@ -0,0 +1,4 @@
+## Improvements for the Rustc compiler
+
+- Werror now works, this set's `-D warnings`, which will cause rustc to error
+ for every warning not explicitly disabled
diff --git a/mesonbuild/compilers/rust.py b/mesonbuild/compilers/rust.py
index 2b566c8..10f54ef 100644
--- a/mesonbuild/compilers/rust.py
+++ b/mesonbuild/compilers/rust.py
@@ -168,3 +168,8 @@ class RustCompiler(Compiler):
for a in super().get_linker_always_args():
args.extend(['-C', f'link-arg={a}'])
return args
+
+ def get_werror_args(self) -> T.List[str]:
+ # Use -D warnings, which makes every warning not explicitly allowed an
+ # error
+ return ['-D', 'warnings']