# How to fail a build with warnings?

**URL:** <https://users.rust-lang.org/t/how-to-fail-a-build-with-warnings/2687>\
**Category:** help\
**Created:** [August 31, 2015, 6:38pm UTC](https://users.rust-lang.org/t/how-to-fail-a-build-with-warnings/2687 "2015-08-31T18:38:00Z")\
**Posts on this page:** 1\
**Showing post:** 3

<div class="post-metadata">

**Author:** ![skade](https://sea1.discourse-cdn.com/flex019/user_avatar/users.rust-lang.org/skade/32/1127_2.png) [@skade](https://users.rust-lang.org/u/skade)\
**Post date:** [August 31, 2015, 9:53pm UTC](https://users.rust-lang.org/t/how-to-fail-a-build-with-warnings/2687/3 "2015-08-31T21:53:07Z")

</div>

> [@droundy](#):
>
> ```
> #![deny(warnings)]
> 
> ```

I'd recommend against. I used to do it and found out the hard way that it breaks forward compatibility. Future versions of Rust might choose to warn on things that weren't a warning before (first and foremost deprecations).

This might lead to the case where code that is compatible with Rust 1.1 suddenly not compatible with 1.2 anymore just because of an introduced warning.

cargo won't have this problem, as it caps lint level for release code: [https://github.com/rust-lang/rfcs/pull/1193](https://github.com/rust-lang/rfcs/pull/1193)

---

_[View the full topic](https://users.rust-lang.org/t/how-to-fail-a-build-with-warnings/2687)._
