How to fail a build with 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