diff --git a/docs/markdown/snippets/rustc-improvements.md b/docs/markdown/snippets/rustc-improvements.md new file mode 100644 index 000000000..2db0a119d --- /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 2b566c8b9..10f54ef10 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']