Lints sometimes don't trigger, with no discernable pattern
This has cropped up in Diesel for a long time, either manifesting as having to change some unrelated code because a lint started triggering that wasn't before, or occasionally noticing "oh hey you need to implement Copy on this type, why didn't the lint trigger?"
I finally have a case that I can report though, which I noticed before it started failing, and very clearly should be triggering. https://github.com/diesel-rs/diesel/pull/1375 adds #[deny(missing_docs)] to the query_dsl module. However, query_dsl::boxed_dsl::BoxedDsl is a public item which has no documentation on it, and should be triggering the lint. I can even go in and add #[deny(missing_docs)] to that trait directly, and the lint still doesn't fire.
I'm not sure what other information I can add -- This is not specific to this one lint in this one case, we've had tons of cases of lints which should have always been failing randomly starting to fail due to changes in completely unrelated code.
This is potentially a more general report of #46164
Sage Griffin at 2017-12-12 20:28:48
Both
missing_docsandmissing_copy_implementationsare based on set of items "reachable from outside of the crate", so if this set changes somehow, new warnings may appear. However I don't see recent changes in that area (https://github.com/rust-lang/rust/commits/master/src/librustc_privacy/lib.rs).I should also add, the "reachable" set is very unreliable for crates defining macros 2.0, but it doesn't seem to be relevant for the linked Diesel crate.
Vadim Petrochenkov at 2017-12-12 21:18:33
This is an item which is 100% reachable from outside the crate. I've also observed this with lints unrelated to public items, such as random lints from clippy -- I can try to pull up some examples, I've only noticed those when they randomly start failing for no apparent reason
Sage Griffin at 2017-12-12 21:26:39
Here's another example: https://github.com/diesel-rs/diesel/pull/1350/files#diff-ed7f6c154205d63bf776e00598c41eb9
The only code that changed is some imports, as a trait got renamed. The method being referenced is fundamentally unchanged, and is also irrelevant to this lint that suddenly started triggering. This lint should have always been failing. Glancing through the source of that lint in clippy, I don't see any filtering there that would have changed as a result of this code change.
Sage Griffin at 2017-12-12 21:32:17
Hi @sgrif, is this still happening on latest stable/nightly?
许杰友 Jieyou Xu (Joe) at 2024-02-28 02:26:48