rust/clippy_utils/src
bors 3bfe98d372 Auto merge of #7813 - xFrednet:6492-lint-version, r=flip1995
Add Clippy version to Clippy's lint list

Hey, hey, the semester is finally over, and I wanted to get back into hacking on Clippy. It has also been some time since our metadata collection monster has been feed. So, this PR adds a new attribute `clippy::version` to document which version a lint was stabilized. I considered using `git blame` but that would be very hacky and probably not accurate.

I'm also thinking that this attribute can be used to have a `clippy::nightly` lint group which is allow-by-default that delays setting the actual lint group until the defined version is reached. Just something to consider regarding #6623 🙃

This PR only adds the version to 4 lints to keep it reviewable. I'll do a followup PR to add the version to other lints if the implementation is accepted 🙃

![image](https://user-images.githubusercontent.com/17087237/137118859-0aafdfdf-7595-4289-8ba4-33d58eb6991d.png)

Also, mobile approved xD

![image](https://user-images.githubusercontent.com/17087237/137118944-833cf7fb-a4a1-45d6-9af8-32c951822360.png)

---

r? `@flip1995`

cc: #7172

closes: #6492

changelog: [Clippy's lint list](https://rust-lang.github.io/rust-clippy/master/index.html) now displays the version a lint was added. 🎉

---

Example lint declaration after this update:

```rs
declare_clippy_lint! {
    /// [...]
    ///
    /// ### Example
    /// ```rust
    /// // Bad
    /// let x = 3.14;
    /// // Good
    /// let x = std::f32::consts::PI;
    /// ```
    #[clippy::version = "pre 1.29.0"]
    pub APPROX_CONSTANT,
    correctness,
    "the approximate of a known float constant (in `std::fXX::consts`)"
}
```
2021-11-11 12:38:04 +00:00
..
ast_utils
ast_utils.rs Merge commit 'cb7915b00c235e9b5861564f3be78dba330980ee' into clippyup 2021-09-28 18:03:12 +01:00
attrs.rs Added clippy::version attribute as lint metadata 2021-11-10 19:48:29 +01:00
comparisons.rs
consts.rs Simplify FullInt Ord impl 2021-10-30 06:22:19 +02:00
diagnostics.rs Update diagnostics.rs 2021-11-04 11:57:14 +08:00
eager_or_lazy.rs Make diangostic item names consistent 2021-10-02 19:38:19 -05:00
higher.rs Auto merge of #7906 - smoelius:master, r=camsteffen 2021-11-02 14:06:36 +00:00
hir_utils.rs Merge commit 'cb7915b00c235e9b5861564f3be78dba330980ee' into clippyup 2021-09-28 18:03:12 +01:00
lib.rs Check for no_std and no_core attribute in swap lint 2021-11-11 12:30:07 +08:00
msrvs.rs Add MSRV to deprecated_cfg_attr 2021-11-08 17:53:50 -05:00
numeric_literal.rs Merge commit 'b7f3f7f6082679da2da9a0b3faf1b5adef3afd3b' into clippyup 2021-10-07 11:21:30 +02:00
paths.rs Merge remote-tracking branch 'upstream/master' into rustup 2021-10-21 12:18:12 +02:00
ptr.rs Factor in some expr_visitor usages 2021-11-05 14:39:39 -05:00
qualify_min_const_fn.rs Rollup merge of #88963 - fee1-dead:const-iterator, r=oli-obk 2021-10-01 14:46:48 -07:00
source.rs Improve clippy_utils function docs 2021-11-04 12:42:29 +01:00
str_utils.rs Refactored some string handling to prevent ICEs and FNs 2021-10-24 22:47:39 +02:00
sugg.rs Some "parenthesis" and "parentheses" fixes 2021-10-17 12:04:01 +02:00
sym_helper.rs
ty.rs Improve clippy_utils function docs 2021-11-04 12:42:29 +01:00
usage.rs Factor in some expr_visitor usages 2021-11-05 14:39:39 -05:00
visitors.rs Factor in some expr_visitor usages 2021-11-05 14:39:39 -05:00