Expand description
Emits an error, preventing the compilation from finishing, when a lint check has failed. This is useful for enforcing rules or preventing certain patterns:
deny can be overridden by allow, warn, and forbid:
#![deny(unused)]
#[allow(unused)] // We override the `deny` for this function.
fn foo() {
let x = 42; // No lint emitted even though `x` is unused.
}Multiple lints can also be set to deny at once:
The lint checks supported by rustc can be found via rustc -W help,
along with their default settings and are documented in the rustc book.
For more information, see the Reference on the deny attribute.