declare_interior_mutable_const should probably be downgraded #5863
Labels
A-documentation
Area: Adding or improving documentation
C-bug
Category: Clippy is not doing the correct thing
good-first-issue
These issues are a good way to get started with Clippy
Hi. I ran into #3962 (interior mutability complaint even if non-interior-mutable enum variants are used). Searching for the name of the lint found me #5050, and also #5812 (which relates to types which have "buried" interior mutability and which therefore don't present the semantic hazard that this lint is aimed at).
In #5812 clippy suggests using
lazy_static
which is right if the user actually wanted the interior mutability, but is not a good approach if all that's needed is to suppress this lint.This lint is deny by default. I think it is not sufficiently reliable for that. The issue conversations show people who are concerned that they would be missing a serious problem and are mistakenly reluctant to suppress this lint.
I suggest that the lint should be downgraded to warn-by-default.
Also I think these issues should be discussed in https://rust-lang.github.io/rust-clippy/master/index.html#declare_interior_mutable_const under "Known problems".
I'm not very familiar with clippy but this doesn't sound like it would be a difficult change. So if this seems like a good idea to the clippy team please let me know and I will prepare an MR.
Thanks,
Ian.
The text was updated successfully, but these errors were encountered: