Deny all lints (not manually one by one)

Hello,

Is it possible to deny all native rust lints ?

I know that with clippy one can write:

#![deny(clippy::all)]

With rust's lints I am under the impression one has to choose them one by one manually in order to turn them into deny, warn or allow.

Thank you very much in advance for any help.

Note that clippy::all isn't actually all of clippy's lints, not the least of which is because some of the lints are contradictory.

As to rustc, there is no mechanism to deny all lints.

2 Likes

Thank you for your time and help.

Note that clippy::all isn't actually all of clippy's lints, not the least of which is because some of the lints are contradictory.

Do you have an example ?

Thank you for your help

You don't have to go one-by-one if there's a corresponding lint group. Maybe you want deny(warnings) (but there are some holes in that too and some consider it an anti-pattern).

3 Likes
3 Likes

Thank you again for your help.

(but there are some holes in that too and some consider it an anti-pattern).

How can it be considered an anti-pattern ? (To be honest I haven't read all the posts in the link related to this)

You don't have to go one-by-one if there's a corresponding lint group.

And thank you for the example. I don't know how the implicit_return can exist (?). The omitting of return is (from my humble opinion) part of rust.

Thank you again for your help

Primarily, if it builds in some version it should build in any later version too (modulo safety or security bugs), yet we should get new warnings too.

2 Likes

Thank you for your answer

Primarily, if it builds in some version it should build in any later version too (modulo safety or security bugs), yet we should get new warnings too.

I'm really sorry but can you please explain your statement ? I'm really not sure to understand what your are trying to explain.

See here and this comment for example.

2 Likes

If this is for continuous integration, there is this.

1 Like

Some lints are allowed by default and thus essentially opt-in for those that want to force a specific style. If you deny all warning you'll also opt into these kind of lints.

1 Like

Thank you all for your great help.

It really helped me to learn and understand.

This topic was automatically closed 90 days after the last reply. We invite you to open a new topic if you have further questions or comments.