3 ms·
A few days ago I wrote: https://news.ycombinator.com/item?id=31143372 https://news.ycombinator.com/item?id=31143372 > Everywhere that a clippy lint is there to
by tialaramex 5y ago
A few days ago I wrote: https://news.ycombinator.com/item?id=31143372 https://news.ycombinator.com/item?id=31143372
> Everywhere that a clippy lint is there to catch bugs, I wish it wasn't a clippy lint because it won't always get run and those bugs will get missed.
This article in part tells the same story. Ideally - as well as preventing false positives - this "lint" would instead be in Rust's compiler so you cannot do this wrong. Do you want to hold the mutex guard while asleep? No, you do not want to do that.
Doing that's a bunch of work, but part of the reason Rust has been successful up to this point and I believe has more success ahead of it is people being willing to do the work, and not just shrug and say it's too hard.
- steveklabnik 5y agoPart of the reasons lints are in clippy vs rustc, historically, is that clippy lints are more controversial or have too many false positives to live in rustc just yet. So it’s a trade off. If all clippy lints lived in rustc, people would trust the lints less overall.
- estebank 5y agoAnd as lints show their value in clippy, they do get uplifted to rustc when it makes sense.
- steveklabnik 5y agoYes, I should have mentioned, this, thank you!
- tialaramex 5y agoSure, while this (or any successor) has unavoidable false positives it needs to live in clippy and probably be default off. But I'd argue that correctness is so worthwhile that even if this (or an alternative) can be narrowed to merely avoidable false positives that's enough to justify an on-by-default correctness error.