Lint groups

The Rust compiler lets us configure some of the aforementioned lints in groups. For example, the unused group will contain many of the unused_ kind of lints. The warnings group will contain all the lints that have been configured to warn, and so on.

Lint groups can be used the same way as lints, by specifying what you want to happen when the compiler catches that behavior:

#[deny(warnings)]

You can check out the rest of the built-in lints by running rustc -W help. It will show the ones we have talked about and the other lints that are warn or deny by default.

Get Rust High Performance now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.