Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Clippyup #97248

Merged
merged 127 commits into from
May 21, 2022
Merged

Clippyup #97248

merged 127 commits into from
May 21, 2022

Commits on Apr 26, 2022

  1. Configuration menu
    Copy the full SHA
    bdc8961 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    06cc1ab View commit details
    Browse the repository at this point in the history

Commits on Apr 27, 2022

  1. Configuration menu
    Copy the full SHA
    948af01 View commit details
    Browse the repository at this point in the history

Commits on Apr 29, 2022

  1. Configuration menu
    Copy the full SHA
    9173780 View commit details
    Browse the repository at this point in the history

Commits on Apr 30, 2022

  1. Support negative ints in manual_range_contains

    Fixes issue where ranges containing ints with different signs would be
    incorrect due to comparing as unsigned.
    arieluy committed Apr 30, 2022
    Configuration menu
    Copy the full SHA
    d102969 View commit details
    Browse the repository at this point in the history

Commits on May 2, 2022

  1. Fix cast_lossless to avoid warning on usize to f64 conversion.

    Previously, the `cast_lossless` lint would issue a warning on code that
    converted a `usize` value to `f64`, on 32-bit targets.
    
    `usize` to `f64` is a lossless cast on 32-bit targets, however there is
    no corresponding `f64::from` that takes a `usize`, so `cast_lossless`'s
    suggested replacement does not compile.
    
    This PR disables the lint in the case of casting from `usize` or `isize`.
    
    Fixes rust-lang#3689.
    
    changelog: [`cast_lossless`] no longer gives wrong suggestion on usize->f64
    sunfishcode committed May 2, 2022
    Configuration menu
    Copy the full SHA
    6ff77b9 View commit details
    Browse the repository at this point in the history

Commits on May 3, 2022

  1. Configuration menu
    Copy the full SHA
    2c70af3 View commit details
    Browse the repository at this point in the history

Commits on May 5, 2022

  1. Change input placeholder

    Serial-ATA committed May 5, 2022
    Configuration menu
    Copy the full SHA
    dd7bc86 View commit details
    Browse the repository at this point in the history
  2. Bless clippy error msg

    nbdd0121 committed May 5, 2022
    Configuration menu
    Copy the full SHA
    f0c2ac8 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    7cd86aa View commit details
    Browse the repository at this point in the history
  4. (Partially) Revert "HACK: Move buggy lints to nursery"

    This reverts commit bb01aca.
    
    Partial: Keep regression tests
    flip1995 committed May 5, 2022
    Configuration menu
    Copy the full SHA
    ed8458f View commit details
    Browse the repository at this point in the history
  5. Added missing ### What it does

    Adds the missing line to cast-slice-different-sizes lint documentation
    /closes 8781
    fedemartinezdev committed May 5, 2022
    Configuration menu
    Copy the full SHA
    6881a5a View commit details
    Browse the repository at this point in the history
  6. Auto merge of rust-lang#8789 - fedemartinezdev:master, r=flip1995

    Added missing `### What it does`
    
    Adds the missing line to ``[`cast-slice-different-sizes`]`` lint documentation
    fixes rust-lang#8781
    
    changelog: none
    bors committed May 5, 2022
    Configuration menu
    Copy the full SHA
    0509a96 View commit details
    Browse the repository at this point in the history
  7. Configuration menu
    Copy the full SHA
    17bea31 View commit details
    Browse the repository at this point in the history
  8. Auto merge of rust-lang#8790 - Jarcho:attribute_line, r=flip1995

    Lint `empty_lint_after_outer_attr` on argumentless macros
    
    Reverts the change from 034c81b as it's no longer needed. The test is left just in case. Original issue is rust-lang#2475.
    
    changelog: Lint `empty_lint_after_outer_attr` on argumentless macros again
    bors committed May 5, 2022
    Configuration menu
    Copy the full SHA
    bf7182c View commit details
    Browse the repository at this point in the history
  9. Configuration menu
    Copy the full SHA
    4ed52bf View commit details
    Browse the repository at this point in the history

Commits on May 6, 2022

  1. Auto merge of rust-lang#8778 - sunfishcode:main, r=giraffate

    Fix `cast_lossless` to avoid warning on `usize` to `f64` conversion.
    
    Previously, the `cast_lossless` lint would issue a warning on code that
    converted a `usize` value to `f64`, on 32-bit targets.
    
    `usize` to `f64` is a lossless cast on 32-bit targets, however there is
    no corresponding `f64::from` that takes a `usize`, so `cast_lossless`'s
    suggested replacement does not compile.
    
    This PR disables the lint in the case of casting from `usize` or `isize`.
    
    Fixes rust-lang#3689.
    
    changelog: [`cast_lossless`] no longer gives wrong suggestion on usize,isize->f64
    bors committed May 6, 2022
    Configuration menu
    Copy the full SHA
    5dad517 View commit details
    Browse the repository at this point in the history
  2. Suggest -Zunpretty=ast-tree instead of -Zast-json

    -Zast-json is being removed shortly: rust-lang#85993.
    ast-tree does essentially the same thing, and still works today even before that PR lands.
    jyn514 committed May 6, 2022
    Configuration menu
    Copy the full SHA
    677b38c View commit details
    Browse the repository at this point in the history
  3. Create RangeBounds struct

    For check_range_bounds return type.
    arieluy committed May 6, 2022
    Configuration menu
    Copy the full SHA
    2aa63c9 View commit details
    Browse the repository at this point in the history
  4. Auto merge of rust-lang#8792 - jyn514:remove-ast-json, r=flip1995

    Suggest -Zunpretty=ast-tree instead of -Zast-json
    
    -Zast-json is being removed shortly: rust-lang#85993.
    ast-tree does essentially the same thing, and still works today even before that PR lands.
    
    changelog: none
    bors committed May 6, 2022
    Configuration menu
    Copy the full SHA
    bbe6e94 View commit details
    Browse the repository at this point in the history
  5. Auto merge of rust-lang#8763 - arieluy:manual_range_contains, r=xFrednet

    Support negative ints in manual_range_contains
    
    fixes: rust-lang#8721
    changelog: Fixes issue where ranges containing ints with different signs would be
    incorrect due to comparing as unsigned.
    bors committed May 6, 2022
    Configuration menu
    Copy the full SHA
    1594e98 View commit details
    Browse the repository at this point in the history
  6. Configuration menu
    Copy the full SHA
    91a822c View commit details
    Browse the repository at this point in the history
  7. Configuration menu
    Copy the full SHA
    905a951 View commit details
    Browse the repository at this point in the history
  8. Resolved conflicts

    tamaroning committed May 6, 2022
    Configuration menu
    Copy the full SHA
    5d0ca74 View commit details
    Browse the repository at this point in the history
  9. Configuration menu
    Copy the full SHA
    c09778d View commit details
    Browse the repository at this point in the history
  10. Auto merge of rust-lang#8793 - Alexendoo:dev-lint-extra-args, r=xFrednet

    Pass through extra args in `cargo dev lint`
    
    changelog: Pass through extra args in `cargo dev lint`
    
    Lets you pass some useful flags through, like `-A/W/etc`, `--fix`, `--force-warn`
    bors committed May 6, 2022
    Configuration menu
    Copy the full SHA
    43756b6 View commit details
    Browse the repository at this point in the history
  11. Rollup merge of rust-lang#96557 - nbdd0121:const, r=oli-obk

    Allow inline consts to reference generic params
    
    Tracking issue: rust-lang#76001
    
    The RFC says that inline consts cannot reference to generic parameters (for now), same as array length expressions. And expresses that it's desirable for it to reference in-scope generics, when array length expressions gain that feature as well.
    
    However it is possible to implement this for inline consts before doing this for all anon consts, because inline consts are only used as values and they won't be used in the type system. So we can have:
    ```rust
    fn foo<T>() {
        let x = [4i32; std::mem::size_of::<T>()];   // NOT ALLOWED (for now)
        let x = const { std::mem::size_of::<T>() }; // ALLOWED with this PR!
        let x = [4i32; const { std::mem::size_of::<T>() }];   // NOT ALLOWED (for now)
    }
    ```
    
    This would make inline consts super useful for compile-time checks and assertions:
    ```rust
    fn assert_zst<T>() {
        const { assert!(std::mem::size_of::<T>() == 0) };
    }
    ```
    
    This would create an error during monomorphization when `assert_zst` is instantiated with non-ZST `T`s. A error during mono might sound scary, but this is exactly what a "desugared" inline const would do:
    ```rust
    fn assert_zst<T>() {
        struct F<T>(T);
        impl<T> F<T> {
            const V: () = assert!(std::mem::size_of::<T>() == 0);
        }
        let _ = F::<T>::V;
    }
    ```
    
    It should also be noted that the current inline const implementation can already reference the type params via type inference, so this resolver-level restriction is not any useful either:
    ```rust
    fn foo<T>() -> usize {
        let (_, size): (PhantomData<T>, usize) = const {
            const fn my_size_of<T>() -> (PhantomData<T>, usize) {
                (PhantomData, std::mem::size_of::<T>())
            }
            my_size_of()
        };
        size
    }
    ```
    
    ```@rustbot``` label: F-inline_const
    GuillaumeGomez authored May 6, 2022
    Configuration menu
    Copy the full SHA
    13e8ace View commit details
    Browse the repository at this point in the history

Commits on May 7, 2022

  1. Auto merge of rust-lang#96531 - kckeiks:remove-item-like-visitor-from…

    …-rustc-typeck, r=cjgillot
    
    Remove ItemLikeVisitor impls from rustc_typeck
    
    Issue rust-lang#95004
    cc `@cjgillot`
    bors committed May 7, 2022
    Configuration menu
    Copy the full SHA
    dd6ee7f View commit details
    Browse the repository at this point in the history
  2. Lint for significant drops who may have surprising lifetimes #1

    author Preston From <[email protected]> 1645164142 -0600
    committer Preston From <[email protected]> 1650005351 -0600
    PrestonFrom committed May 7, 2022
    Configuration menu
    Copy the full SHA
    41c7e4d View commit details
    Browse the repository at this point in the history
  3. fix

    tamaroning committed May 7, 2022
    Configuration menu
    Copy the full SHA
    8d85889 View commit details
    Browse the repository at this point in the history
  4. Auto merge of rust-lang#8794 - smoelius:fix-8759, r=llogiq

    Address `unnecessary_to_owned` false positive
    
    My proposed fix for rust-lang#8759 is to revise the conditions that delineate `redundant_clone` and `unnecessary_to_owned`:
    ```rust
            // Only flag cases satisfying at least one of the following three conditions:
            // * the referent and receiver types are distinct
            // * the referent/receiver type is a copyable array
            // * the method is `Cow::into_owned`
            // This restriction is to ensure there is no overlap between `redundant_clone` and this
            // lint. It also avoids the following false positive:
            //  rust-lang/rust-clippy#8759
            //   Arrays are a bit of a corner case. Non-copyable arrays are handled by
            // `redundant_clone`, but copyable arrays are not.
    ```
    This change causes a few cases that were previously flagged by `unnecessary_to_owned` to no longer be flagged. But one could argue those cases would be better handled by `redundant_clone`.
    
    Closes rust-lang#8759
    
    changelog: none
    bors committed May 7, 2022
    Configuration menu
    Copy the full SHA
    9c78883 View commit details
    Browse the repository at this point in the history
  5. Track if a where bound comes from a impl Trait desugar

    With rust-lang#93803 `impl Trait` function arguments get desugared to hidden
    where bounds. However, Clippy needs to know if a bound was originally a
    impl Trait or an actual bound. This adds a field to the
    `WhereBoundPredicate` struct to keep track of this information during
    HIR lowering.
    flip1995 committed May 7, 2022
    Configuration menu
    Copy the full SHA
    bca3d8a View commit details
    Browse the repository at this point in the history
  6. Configuration menu
    Copy the full SHA
    03960eb View commit details
    Browse the repository at this point in the history

Commits on May 8, 2022

  1. Auto merge of rust-lang#94206 - PrestonFrom:significant_drop, r=flip1995

    Create clippy lint against unexpectedly late drop for temporaries in match scrutinee expressions
    
    A new clippy lint for issue 93883 (rust-lang#93883). Relies on a new trait in `marker` (called `SignificantDrop` to enable linting), which is why this PR is for the rust-lang repo and not the clippy repo.
    
    changelog: new lint [`significant_drop_in_scrutinee`]
    bors committed May 8, 2022
    Configuration menu
    Copy the full SHA
    6d03789 View commit details
    Browse the repository at this point in the history
  2. Pass msrvs by copy

    smoelius committed May 8, 2022
    Configuration menu
    Copy the full SHA
    bdfea1c View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    597f61b View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    21e4765 View commit details
    Browse the repository at this point in the history
  5. Auto merge of rust-lang#96770 - flip1995:fix-trait-type-in-bounds, r=…

    …cjgillot
    
    Track if a where bound comes from a impl Trait desugar
    
    With rust-lang#93803 `impl Trait` function arguments get desugared to hidden where bounds. However, Clippy needs to know if a bound was originally a `impl Trait` or an actual bound. This adds a field to the `WhereBoundPredicate` struct to keep track of this information during AST->HIR lowering.
    
    r? `@cjgillot`
    
    cc `@estebank` (as the reviewer of rust-lang#93803)
    bors committed May 8, 2022
    Configuration menu
    Copy the full SHA
    1d018ce View commit details
    Browse the repository at this point in the history
  6. Auto merge of rust-lang#8802 - smoelius:allow-expect-unwrap-in-tests,…

    … r=llogiq
    
    Optionally allow `expect` and `unwrap` in tests
    
    This addresses rust-lang#1015, except it makes the new behavior optional.
    
    The reason for the msrv-related changes is as follows.
    
    Rather than expand `check_methods` list of arguments, it seemed easier to make `check_methods` a method of `Methods`, so that `check_methods` could access `Methods`' fields.
    
    `check_methods` had an `msrv` parameter, which I consequently made a field of `Methods`. But, to avoid adding a lifetime parameter to `Methods`, I made the field type `Option<RustcVersion>` instead of the parameter's existing type, `Option<&RustcVersion>`. This seemed sensible since `RustcVersion` implements `Copy`. But this broke a lot of code that expected an `Option<&RustcVersion>` or `&Option<RustcVersion>`. I changed all of those occurrences to `Option<RustcVersion>`. IMHO, the code is better as a result of these changes, though.
    
    The msrv-related changes are in their own commit to (hopefully) ease review.
    
    Closes rust-lang#1015
    
    changelog: optionally allow `expect` and `unwrap` in tests
    
    r? `@llogiq`
    bors committed May 8, 2022
    Configuration menu
    Copy the full SHA
    4667198 View commit details
    Browse the repository at this point in the history

Commits on May 9, 2022

  1. Auto merge of rust-lang#95542 - xFrednet:rfc-2383-expect-query, r=wes…

    …leywiser
    
    Support tool lints with the `#[expect]` attribute (RFC 2383)
    
    This PR fixes the ICE rust-lang#94953 by making the assert for converted expectation IDs conditional.
    
    Additionally, it moves the lint expectation check into a separate query to support rustdoc and other tools. On the way, I've also added some tests to ensure that the attribute works for Clippy and rustdoc lints.
    
    The number of changes comes from the long test file. This may look like a monster PR, this may smell like a monster PR and this may be a monster PR, but it's a harmless monster. 🦕
    
    ---
    
    Closes: rust-lang#94953
    
    cc: rust-lang#85549
    
    r? `@wesleywiser`
    
    cc: `@rust-lang/rustdoc`
    bors committed May 9, 2022
    Configuration menu
    Copy the full SHA
    670bc53 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    5e4f092 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    c9d88ef View commit details
    Browse the repository at this point in the history
  4. fix clippy

    SparrowLii committed May 9, 2022
    Configuration menu
    Copy the full SHA
    47e9afa View commit details
    Browse the repository at this point in the history
  5. Auto merge of rust-lang#8805 - Alexendoo:let-chain-docs, r=flip1995

    Recommend let chains over if_chain in docs
    
    Switches over bit_mask.rs to let chains in order to create a nice example
    
    While the rustfmt thing isn't resolved yet, my rust-analyzer isn't a fan of large `if_chains!`s, it stops giving me hover info and such after some number of if statements
    
    changelog: none
    bors committed May 9, 2022
    Configuration menu
    Copy the full SHA
    c3f3c58 View commit details
    Browse the repository at this point in the history
  6. Configuration menu
    Copy the full SHA
    0f1544f View commit details
    Browse the repository at this point in the history
  7. Configuration menu
    Copy the full SHA
    993b401 View commit details
    Browse the repository at this point in the history
  8. Auto merge of rust-lang#8797 - xFrednet:0000-expect-a-playground, r=f…

    …lip1995
    
    Replace `#[allow]` with `#[expect]` in Clippy
    
    Hey `@rust-lang/clippy,` `@Alexendoo,` `@dswij,` I'm currently working on the expect attribute as defined in [Rust RFC 2383](https://rust-lang.github.io/rfcs/2383-lint-reasons.html). With that, an `#[allow]` attribute can be replaced with a `#[expect]` attribute that suppresses the lint, but also emits a warning, if the lint isn't emitted in the expected scope.
    
    With this PR I would like to test the attribute on a project scale and Clippy obviously came to mind. This PR replaces (almost) all `#[allow]` attributes in `clippy_utils` and `clippy_lints` with the `#[expect]` attribute. I was also able to remove some allows since, the related FPs have been fixed 🎉.
    
    My question is now, are there any concerns regarding this? It's still okay to add normal `#[allow]` attributes, I see the need to nit-pick about that in new PRs, unless it's actually a FP. Also, I would not recommend using `#[expect]` in tests, as changes to a lint could the trigger the expect attribute in other files.
    
    Additionally, I've noticed that Clippy has a bunch of `#[allow(clippy::too_many_lines)]` attributes. Should we maybe allow the lint all together or increase the threshold setting? To me, it seems like we mostly just ignore it in our code. 😅 🙃
    
    ---
    
    changelog: none
    
    r? `@flip1995` (I've requested you for now, since you're also helping with reviewing the expect implementation. You are welcome to delegate this PR, even if it should be a simple review 🙃 )
    bors committed May 9, 2022
    Configuration menu
    Copy the full SHA
    aa03344 View commit details
    Browse the repository at this point in the history
  9. Configuration menu
    Copy the full SHA
    6edf0b4 View commit details
    Browse the repository at this point in the history
  10. Auto merge of rust-lang#8809 - Alexendoo:metadata-collection-expect, …

    …r=xFrednet
    
    Ignore unfulfilled_lint_expectations in metadata collection
    
    r? `@xFrednet`
    
    When metadata collection is enabled the regular early/late pass registrations are skipped, which the `#[expect()]`s were no fan of: https://github.com/rust-lang/rust-clippy/runs/6356675328?check_suite_focus=true
    
    changelog: none
    bors committed May 9, 2022
    Configuration menu
    Copy the full SHA
    77effb7 View commit details
    Browse the repository at this point in the history

Commits on May 10, 2022

  1. Configuration menu
    Copy the full SHA
    fe84ff3 View commit details
    Browse the repository at this point in the history
  2. update clippy

    lcnr committed May 10, 2022
    Configuration menu
    Copy the full SHA
    107ee40 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    feb6d8c View commit details
    Browse the repository at this point in the history
  4. Auto merge of rust-lang#8769 - yonip23:8719, r=xFrednet

    introduce rc_clone_in_vec_init lint
    
    Closes rust-lang#8719
    
    changelog: Introduce [`rc_clone_in_vec_init`] lint
    bors committed May 10, 2022
    Configuration menu
    Copy the full SHA
    1a11a49 View commit details
    Browse the repository at this point in the history
  5. Auto merge of rust-lang#8796 - nsunderland1:master, r=giraffate

    New lint: [`derive_partial_eq_without_eq`]
    
    Introduces a new lint, [`derive_partial_eq_without_eq`].
    
    See: rust-lang#1781 (doesn't close it though).
    
    changelog: add lint [`derive_partial_eq_without_eq`]
    bors committed May 10, 2022
    Configuration menu
    Copy the full SHA
    d422baa View commit details
    Browse the repository at this point in the history
  6. fix

    tamaroning committed May 10, 2022
    Configuration menu
    Copy the full SHA
    aaf87c3 View commit details
    Browse the repository at this point in the history
  7. chore

    tamaroning committed May 10, 2022
    Configuration menu
    Copy the full SHA
    1926217 View commit details
    Browse the repository at this point in the history
  8. Configuration menu
    Copy the full SHA
    631b4ee View commit details
    Browse the repository at this point in the history
  9. Configuration menu
    Copy the full SHA
    f3e01c4 View commit details
    Browse the repository at this point in the history
  10. Configuration menu
    Copy the full SHA
    554dc41 View commit details
    Browse the repository at this point in the history

Commits on May 11, 2022

  1. Introduce EarlyBinder

    jackh726 committed May 11, 2022
    Configuration menu
    Copy the full SHA
    cf8ea64 View commit details
    Browse the repository at this point in the history
  2. Use the traits added to the Rust 2021 Edition prelude

    Follow up rust-lang#96861.
    
    This PR uses the traits added to the Rust 2021 Edition prelude.
    
    > The `TryInto`, `TryFrom` and `FromIterator` traits are now part of the prelude.
    
    https://doc.rust-lang.org/edition-guide/rust-2021/prelude.html
    koic committed May 11, 2022
    Configuration menu
    Copy the full SHA
    ae0216d View commit details
    Browse the repository at this point in the history
  3. Bless clippy.

    cjgillot committed May 11, 2022
    Configuration menu
    Copy the full SHA
    3182532 View commit details
    Browse the repository at this point in the history
  4. Auto merge of rust-lang#8726 - Serial-ATA:issue-8723, r=dswij,xFrednet

    Fix `match_single_binding` suggestion for assign expressions
    
    changelog: Fix suggestion for assign expressions in [`match_single_binding`]
    closes: rust-lang#8723
    bors committed May 11, 2022
    Configuration menu
    Copy the full SHA
    6889d09 View commit details
    Browse the repository at this point in the history
  5. fix review comments

    yonip23 committed May 11, 2022
    Configuration menu
    Copy the full SHA
    344888a View commit details
    Browse the repository at this point in the history
  6. Auto merge of rust-lang#8818 - koic:use_rust_2021_prelude, r=flip1995

    Use the traits added to the Rust 2021 Edition prelude
    
    Follow up rust-lang#96861.
    
    This PR uses the traits added to the Rust 2021 Edition prelude.
    
    > The `TryInto`, `TryFrom` and `FromIterator` traits are now part of the prelude.
    
    https://doc.rust-lang.org/edition-guide/rust-2021/prelude.html
    
    ---
    
    changelog: none
    bors committed May 11, 2022
    Configuration menu
    Copy the full SHA
    a3d1f28 View commit details
    Browse the repository at this point in the history
  7. fix clippy warning

    yonip23 committed May 11, 2022
    Configuration menu
    Copy the full SHA
    a791205 View commit details
    Browse the repository at this point in the history

Commits on May 12, 2022

  1. fix

    tamaroning committed May 12, 2022
    Configuration menu
    Copy the full SHA
    9e66f2d View commit details
    Browse the repository at this point in the history
  2. fix indentation + test

    yonip23 committed May 12, 2022
    Configuration menu
    Copy the full SHA
    dc23b5d View commit details
    Browse the repository at this point in the history
  3. Some lintcheck cleanup

    Alexendoo committed May 12, 2022
    Configuration menu
    Copy the full SHA
    8708a26 View commit details
    Browse the repository at this point in the history
  4. Auto merge of rust-lang#95562 - lcnr:attr-no-encode, r=davidtwco

    don't encode only locally used attrs
    
    Part of rust-lang/compiler-team#505.
    
    We now filter builtin attributes before encoding them in the crate metadata in case they should only be used in the local crate. To prevent accidental misuse `get_attrs` now requires the caller to state which attribute they are interested in. For places where that isn't trivially possible, I've added a method `fn get_attrs_unchecked` which I intend to remove in a followup PR.
    
    After this pull request landed, we can then slowly move all attributes to only be used in the local crate while being certain that we don't accidentally try to access them from extern crates.
    
    cc rust-lang#94963 (comment)
    bors committed May 12, 2022
    Configuration menu
    Copy the full SHA
    7161a70 View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    0def44a View commit details
    Browse the repository at this point in the history
  6. Configuration menu
    Copy the full SHA
    ed3744b View commit details
    Browse the repository at this point in the history
  7. Auto merge of rust-lang#8799 - Alexendoo:lintcheck-common, r=giraffate

    Some lintcheck cleanup
    
    A grab bag of smaller changes:
    
    Panics if a crate source isn't valid, and fixes the `ryu` crate entry so it's picked up. Took me a while to realise why I couldn't do `cargo lintcheck --only ryu` 😅
    
    Parses messages with `cargo_metadata`, this catches a few more lints that were ignored because the message had an [expansion field](https://docs.rs/cargo_metadata/latest/cargo_metadata/diagnostic/struct.DiagnosticSpanMacroExpansion.html) that contained a path pointing into `.../.toolchains/...`. It also no longer emits some log lines with `null` as the column
    
    It also merges the `run_clippy_lint` invocations and splits `LintcheckConfig` out into its own file
    
    changelog: none
    bors committed May 12, 2022
    Configuration menu
    Copy the full SHA
    b54f446 View commit details
    Browse the repository at this point in the history

Commits on May 13, 2022

  1. Tweak some words improved representation

    This PR has implemented improved representation.
    
    - Use "lib" instead of "lifb"
    - Use "triggered" instead of "triggere"
    - Use "blacklisted_name" instead of "blackisted_name"
    - Use "stabilization" instead of "stabilisation"
    - Use "behavior" instead of "behaviour"
    - Use "target" instead of "tartet"
    - Use "checked_add" instead of "chcked_add"
    - Use "anti-pattern" instead of "antipattern"
    - Use "suggestion" instead of "suggesttion"
    - Use "example" instead of "exampel"
    - Use "Cheat Sheet" instead of "Cheatsheet"
    ydah committed May 13, 2022
    Configuration menu
    Copy the full SHA
    4e5f69c View commit details
    Browse the repository at this point in the history
  2. Auto merge of rust-lang#8825 - ydah:fix_spelling, r=giraffate

    Tweak some words improved representation
    
    Hello! Thank you for this awesome project!
    
    This PR has implemented improved representation.
    
    - Use "lib" instead of "lifb"
    - Use "triggered" instead of "triggere"
    - Use "blacklisted_name" instead of "blackisted_name"
    - Use "stabilization" instead of "stabilisation"
    - Use "behavior" instead of "behaviour"
    - Use "target" instead of "tartet"
    - Use "checked_add" instead of "chcked_add"
    - Use "anti-pattern" instead of "antipattern"
    - Use "suggestion" instead of "suggesttion"
    - Use "example" instead of "exampel"
    - Use "Cheat Sheet" instead of "Cheatsheet"
    
    ---
    
    changelog: none
    bors committed May 13, 2022
    Configuration menu
    Copy the full SHA
    01d75b1 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    ad7338e View commit details
    Browse the repository at this point in the history
  4. Auto merge of rust-lang#8813 - evantypanski:redundant_alloc_fat_ptr, …

    …r=Alexendoo
    
    Fix redundant_allocation warning for Rc<Box<str>>
    
    changelog: [`redundant_allocation`] Fixes rust-lang#8604
    
    Fixes false positives where a fat pointer with `str` type was made thin by another allocation, but that thinning allocation was marked as redundant
    bors committed May 13, 2022
    Configuration menu
    Copy the full SHA
    2038084 View commit details
    Browse the repository at this point in the history
  5. remove TestItemNamesVisitor

    Signed-off-by: Miguel Guarniz <[email protected]>
    kckeiks committed May 13, 2022
    Configuration menu
    Copy the full SHA
    b622f56 View commit details
    Browse the repository at this point in the history
  6. Add bound_type_of

    jackh726 committed May 13, 2022
    Configuration menu
    Copy the full SHA
    cc0607a View commit details
    Browse the repository at this point in the history
  7. Add bound_fn_sig

    jackh726 committed May 13, 2022
    Configuration menu
    Copy the full SHA
    6dab55c View commit details
    Browse the repository at this point in the history

Commits on May 14, 2022

  1. Add duplicate_mod lint

    Alexendoo committed May 14, 2022
    Configuration menu
    Copy the full SHA
    1f79a44 View commit details
    Browse the repository at this point in the history
  2. Auto merge of rust-lang#96883 - jackh726:early-binder-2, r=oli-obk

    Add EarlyBinder
    
    Chalk has no concept of `Param` (https://github.com/rust-lang/chalk/blob/e0ade19d139bc784384acc6736cd960c91dd55a1/chalk-ir/src/lib.rs#L579) or `ReEarlyBound` (https://github.com/rust-lang/chalk/blob/e0ade19d139bc784384acc6736cd960c91dd55a1/chalk-ir/src/lib.rs#L1308). Everything  is just "bound" - the equivalent of rustc's late-bound. It's not completely clear yet whether to move everything to the same time of binder in rustc or add `Param` and `ReEarlyBound` in Chalk.
    
    Either way, tracking when we have or haven't already substituted out these in rustc can be helpful.
    
    As a first step, I'm just adding a `EarlyBinder` newtype that is required to call `subst`. I also add a couple "transparent" `bound_*` wrappers around a couple query that are often immediately substituted.
    
    r? `@nikomatsakis`
    bors committed May 14, 2022
    Configuration menu
    Copy the full SHA
    198c70d View commit details
    Browse the repository at this point in the history

Commits on May 15, 2022

  1. Configuration menu
    Copy the full SHA
    a30587e View commit details
    Browse the repository at this point in the history
  2. Auto merge of rust-lang#8832 - Alexendoo:duplicate-mod, r=Manishearth

    Add `duplicate_mod` lint
    
    Inspired by rust-lang#8827, warns if there's a single file that is loaded by more than one `mod` item
    
    ```rust,ignore
    // lib.rs
    mod a;
    mod b;
    ```
    ```rust,ignore
    // a.rs
    #[path = "./b.rs"]
    mod b;
    ```
    
    It adds a `canonicalize` call per `mod file;` encountered, which I don't think should be too heavy
    
    Integration tests with common modules, e.g. [`test_utils`](https://github.com/rust-lang/rust-clippy/tree/2038084cf2253b57cf8b405ab000a92b68346f43/tests/test_utils) doesn't trigger it as each test is compiled separately, however I couldn't figure out a good way to add a test for that
    
    changelog: Add [`duplicate_mod`] lint
    bors committed May 15, 2022
    Configuration menu
    Copy the full SHA
    c10bfae View commit details
    Browse the repository at this point in the history
  3. Use early returns

    Serial-ATA committed May 15, 2022
    Configuration menu
    Copy the full SHA
    b81d703 View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    f112e4d View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    50eada1 View commit details
    Browse the repository at this point in the history
  6. Configuration menu
    Copy the full SHA
    4fd2968 View commit details
    Browse the repository at this point in the history
  7. Configuration menu
    Copy the full SHA
    f7378da View commit details
    Browse the repository at this point in the history
  8. Auto merge of rust-lang#8621 - Jarcho:eval_order_dependence_4637, r=J…

    …archo
    
    Rename `eval_order_dependence` to `mixed_read_write_expression`, move to nursery
    
    As per the [reference](https://doc.rust-lang.org/1.51.0/reference/expressions.html#evaluation-order-of-operands) evaluation order is now defined.
    
    I'm pretty sure rust always compiled with this evaluation order anyways so there's no reason the put an msrv limit on the lint.
    
    changelog: Rename `eval_order_dependence` to `mixed_read_write_expression`, move to nursery
    bors committed May 15, 2022
    Configuration menu
    Copy the full SHA
    1c0a61e View commit details
    Browse the repository at this point in the history
  9. Update vec_init_then_push docs

    Jarcho committed May 15, 2022
    Configuration menu
    Copy the full SHA
    f1574cc View commit details
    Browse the repository at this point in the history
  10. Auto merge of rust-lang#8699 - Jarcho:vec_init_then_push_7071, r=dswi…

    …j,xFrednet
    
    Don't lint `vec_init_then_push` when further extended
    
    fixes rust-lang#7071
    
    This will still lint when a larger number of pushes are done (four currently). The exact number could be debated, but this is more readable then a sequence of pushes so it shouldn't be too large.
    
    changelog: Don't lint `vec_init_then_push` when further extended.
    changelog: Remove `mut` binding from `vec_init_then_push` when possible.
    bors committed May 15, 2022
    Configuration menu
    Copy the full SHA
    6ec7359 View commit details
    Browse the repository at this point in the history

Commits on May 16, 2022

  1. Auto merge of rust-lang#8761 - tamaroning:fix_8505, r=Jarcho

    `undocumented_unsafe_blocks` does not trigger on unsafe trait impls
    
    Closes rust-lang#8505
    
    changelog: This lint checks unsafe impls NOT from macro expansions and checks ones in macro declarations.
    ~~`unsafe impl`s from macro invocations don't trigger the lint for now.~~
    ~~This lint checks unsafe impls from/not from macro expansions~~
    bors committed May 16, 2022
    Configuration menu
    Copy the full SHA
    a1632ff View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    0f30866 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    c649d4e View commit details
    Browse the repository at this point in the history
  4. Auto merge of rust-lang#8752 - Serial-ATA:improve-filtering, r=xFrednet

    Add version filtering option to the lint list
    
    I'm no web dev, so I don't know if this is the best execution 😄.
    
    Here's how it looks:
    
    ![Desktop](https://user-images.githubusercontent.com/69764315/165403602-9e39fe0f-6a96-46cb-ba51-8b035e74cce4.gif)
    
    And on mobile:
    
    ![Mobile](https://user-images.githubusercontent.com/69764315/165403908-fc4a0051-2ed4-48a3-b45b-b261f49ce259.png)
    
    I've split this into two commits, in the second one I moved the JS into its own file to make it easier to work on. Is that alright? And if so, could the same thing be done to the css?
    
    changelog: none
    cc: rust-lang#7958, `@repi`
    r? `@xFrednet`
    bors committed May 16, 2022
    Configuration menu
    Copy the full SHA
    6e86ab0 View commit details
    Browse the repository at this point in the history
  5. Auto merge of rust-lang#8835 - Jarcho:let_unit_ice, r=llogiq

    Fix ICE in `let_unit_value` when calling a static or const callable type
    
    fixes rust-lang#8821
    
    changelog: Fix ICE in `let_unit_value` when calling a static or const callable type
    bors committed May 16, 2022
    Configuration menu
    Copy the full SHA
    219d702 View commit details
    Browse the repository at this point in the history

Commits on May 17, 2022

  1. Configuration menu
    Copy the full SHA
    d7a6654 View commit details
    Browse the repository at this point in the history
  2. Auto merge of rust-lang#8814 - yonip23:add-suggestion-to-rc-clone-in-…

    …vec-init, r=xFrednet
    
    add suggestions to rc_clone_in_vec_init
    
    A followup to rust-lang/rust-clippy#8769
    I also switch the order of the 2 suggestions, since the loop initialization one is probably the common case.
    
    `@xFrednet` I'm not letting you guys rest for a minute 😅
    changelog: add suggestions to [`rc_clone_in_vec_init`]
    bors committed May 17, 2022
    Configuration menu
    Copy the full SHA
    d901079 View commit details
    Browse the repository at this point in the history
  3. Auto merge of rust-lang#96825 - kckeiks:remove-item-like-visitor-trai…

    …t, r=cjgillot
    
     Retire `ItemLikeVisitor` trait
    
    Issue rust-lang#95004
    cc `@cjgillot`
    bors committed May 17, 2022
    Configuration menu
    Copy the full SHA
    7062eb4 View commit details
    Browse the repository at this point in the history
  4. Auto merge of rust-lang#97012 - oli-obk:🦀_intrinsics, r=davidtwco

    Add a query for checking whether a function is an intrinsic.
    
    work towards rust-lang#93145
    
    This will reduce churn when we add more ways to declare intrinsics
    
    r? `@scottmcm`
    bors committed May 17, 2022
    Configuration menu
    Copy the full SHA
    e9f3cdf View commit details
    Browse the repository at this point in the history
  5. Rollup merge of rust-lang#97079 - SparrowLii:successors, r=lcnr

    Change `Successors` to `impl Iterator<Item = BasicBlock>`
    
    This PR fixes the FIXME in `compiler\rustc_middle\src\mir\mod.rs`.
    This can omit several `&`, `*` or `cloned` operations on Successros' generated elements
    JohnTitor authored May 17, 2022
    Configuration menu
    Copy the full SHA
    ae9d727 View commit details
    Browse the repository at this point in the history
  6. Auto merge of rust-lang#97111 - JohnTitor:rollup-x3vjf6u, r=JohnTitor

    Rollup of 7 pull requests
    
    Successful merges:
    
     - rust-lang#96329 (Add a couple tests for rust-lang#90887 fixes)
     - rust-lang#97009 (Allow `unused_macro_rules` in path tests)
     - rust-lang#97075 (Add regression test for rust-lang#81804)
     - rust-lang#97079 (Change `Successors` to `impl Iterator<Item = BasicBlock>`)
     - rust-lang#97080 (remove the `RelateResultCompare` trait)
     - rust-lang#97093 (Migrate `maybe_recover_from_bad_type_plus` diagnostic)
     - rust-lang#97102 (Update function pointer call error message)
    
    Failed merges:
    
    r? `@ghost`
    `@rustbot` modify labels: rollup
    bors committed May 17, 2022
    Configuration menu
    Copy the full SHA
    acc822a View commit details
    Browse the repository at this point in the history
  7. fix

    tamaroning committed May 17, 2022
    Configuration menu
    Copy the full SHA
    b4c3f0f View commit details
    Browse the repository at this point in the history

Commits on May 18, 2022

  1. Auto merge of rust-lang#8807 - Jarcho:cmp_owned, r=giraffate

    Fix `cmp_owned` on copy types
    
    fixes rust-lang#8803
    fixes rust-lang#7365
    
    changelog: Don't lint `cmp_owned` on `From::from` for copy types
    bors committed May 18, 2022
    Configuration menu
    Copy the full SHA
    bf2e631 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    5647257 View commit details
    Browse the repository at this point in the history
  3. Add copy lint name button

    Serial-ATA committed May 18, 2022
    Configuration menu
    Copy the full SHA
    27fec01 View commit details
    Browse the repository at this point in the history
  4. Auto merge of rust-lang#8823 - smoelius:unknown-field, r=xFrednet

    Improve "unknown field" error messages
    
    Fixes rust-lang#8806
    
    Sample output:
    ```
    error: error reading Clippy's configuration file `/home/smoelius/github/smoelius/rust-clippy/clippy.toml`: unknown field `foobar`, expected one of
               allow-expect-in-tests              enable-raw-pointer-heuristic-for-send    standard-macro-braces
               allow-unwrap-in-tests              enforced-import-renames                  third-party
               allowed-scripts                    enum-variant-name-threshold              too-large-for-stack
               array-size-threshold               enum-variant-size-threshold              too-many-arguments-threshold
               avoid-breaking-exported-api        literal-representation-threshold         too-many-lines-threshold
               await-holding-invalid-types        max-fn-params-bools                      trivial-copy-size-limit
               blacklisted-names                  max-include-file-size                    type-complexity-threshold
               cargo-ignore-publish               max-struct-bools                         unreadable-literal-lint-fractions
               cognitive-complexity-threshold     max-suggested-slice-pattern-length       upper-case-acronyms-aggressive
               cyclomatic-complexity-threshold    max-trait-bounds                         vec-box-size-threshold
               disallowed-methods                 msrv                                     verbose-bit-mask-threshold
               disallowed-types                   pass-by-value-size-limit                 warn-on-all-wildcard-imports
               doc-valid-idents                   single-char-binding-names-threshold
           at line 1 column 1
    ```
    
    You can test this by (say) adding `foobar = 42` to Clippy's root `clippy.toml` file, and running `cargo run --bin cargo-clippy`.
    
    Note that, to get the terminal width, this PR adds `termize` as a dependency to `cargo-clippy`. However, `termize` is also [how `rustc_errors` gets the terminal width](https://github.com/rust-lang/rust/blob/481db40311cdd241ae4d33f34f2f75732e44d8e8/compiler/rustc_errors/src/emitter.rs#L1607). So, hopefully, this is not a dealbreaker.
    
    r? `@xFrednet`
    
    changelog: Enhancements: the "unknown field" error messages for config files now wraps the field names.
    bors committed May 18, 2022
    Configuration menu
    Copy the full SHA
    b6ad6fc View commit details
    Browse the repository at this point in the history
  5. Auto merge of rust-lang#96863 - SparrowLii:let, r=michaelwoerister

    use `hir::Let` in `hir::Guard::IfLet`
    
    This PR fixes the FIXME about using `hir::Let` in `hir::Guard::IfLet`
    bors committed May 18, 2022
    Configuration menu
    Copy the full SHA
    01421e0 View commit details
    Browse the repository at this point in the history
  6. innerHTML -> textContent

    Serial-ATA committed May 18, 2022
    Configuration menu
    Copy the full SHA
    8aae26b View commit details
    Browse the repository at this point in the history
  7. textContent -> innerHTML

    Serial-ATA committed May 18, 2022
    Configuration menu
    Copy the full SHA
    e05da56 View commit details
    Browse the repository at this point in the history
  8. Auto merge of rust-lang#8839 - Serial-ATA:copy-lint-name, r=xFrednet

    Add copy lint name button
    
    changelog: Documentation: Add a *copy lint name*-button to Clippy's lint list
    
    closes rust-lang#7959
    bors committed May 18, 2022
    Configuration menu
    Copy the full SHA
    6f8d18f View commit details
    Browse the repository at this point in the history

Commits on May 19, 2022

  1. fix

    tamaroning committed May 19, 2022
    Configuration menu
    Copy the full SHA
    db41df1 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    b787f4c View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    944e1bb View commit details
    Browse the repository at this point in the history
  4. Auto merge of rust-lang#8838 - tamaroning:fix_dbg, r=Jarcho,xFrednet

    [dbg_macro] tolerates use of `dbg!` in items which have `#[cfg(test)]` attribute
    
    fix: rust-lang#8758
    changelog: [dbg_macro] tolerates use of `dbg!` in items with `#[cfg(test)]` attribute
    bors committed May 19, 2022
    Configuration menu
    Copy the full SHA
    ea96091 View commit details
    Browse the repository at this point in the history
  5. Auto merge of rust-lang#8840 - xFrednet:0000-mini-changelog-update, r…

    …=llogiq
    
    Mini changelog update for Rust 1.61.0
    
    I'll do the full release and sync tomorrow, as I sadly don't have the time today. This is a quick update to ensure that Rust's changelog will link to the correct section in our changelog.  The change is according to [our docs](https://github.com/rust-lang/rust-clippy/blob/8751e47bae68f6bf7ec833dbd42bde51a74f1a65/book/src/development/infrastructure/release.md#update-changelogmd)
    
    changelog: none
    bors committed May 19, 2022
    Configuration menu
    Copy the full SHA
    879cd37 View commit details
    Browse the repository at this point in the history
  6. Auto merge of rust-lang#8841 - Serial-ATA:remove-code-block, r=xFrednet

    Remove code block from `pub_enum_variant_names`
    
    changelog: none
    
    Just noticed this empty code block that no other lint has 😄.
    ![old](https://user-images.githubusercontent.com/69764315/169314573-098ce938-8a4c-4451-afd7-7b082823a0de.png)
    
    r? `@xFrednet`
    bors committed May 19, 2022
    Configuration menu
    Copy the full SHA
    6f26383 View commit details
    Browse the repository at this point in the history

Commits on May 20, 2022

  1. Configuration menu
    Copy the full SHA
    5730fd4 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    4e6cf00 View commit details
    Browse the repository at this point in the history
  3. move to sus and fix dogfood

    xFrednet committed May 20, 2022
    Configuration menu
    Copy the full SHA
    5b72632 View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    8283238 View commit details
    Browse the repository at this point in the history
  5. Auto merge of rust-lang#8852 - Alexendoo:indirect-disallowed-methods,…

    … r=Manishearth
    
    Lint indirect usages in `disallowed_methods`
    
    Fixes rust-lang#8849
    
    changelog: Lint indirect usages in [`disallowed_methods`]
    bors committed May 20, 2022
    Configuration menu
    Copy the full SHA
    f26f117 View commit details
    Browse the repository at this point in the history
  6. Configuration menu
    Copy the full SHA
    7842dbc View commit details
    Browse the repository at this point in the history
  7. Auto merge of rust-lang#8856 - xFrednet:rustup, r=Manishearth,Alexendoo

    Rustup
    
    `@rust-lang/clippy,` `@Jarcho,` `@dswij,` `@Alexendoo.` Could someone review this? It should be pretty straight forward since it's just a sync. I think it's also fine if either one of `@Jarcho,` `@dswij,` `@Alexendoo` approves this, as these are usually not reviewed. I just want to make sure that I didn't break something obvious 🙃
    
    It should be enough to look at the merge commit 🙃
    
    changelog: none
    changelog: move [`significant_drop_in_scrutinee`] to `suspicious`
    bors committed May 20, 2022
    Configuration menu
    Copy the full SHA
    b312ad7 View commit details
    Browse the repository at this point in the history

Commits on May 21, 2022

  1. Configuration menu
    Copy the full SHA
    13cc27b View commit details
    Browse the repository at this point in the history
  2. Fix lint registration

    xFrednet committed May 21, 2022
    Configuration menu
    Copy the full SHA
    6e87c24 View commit details
    Browse the repository at this point in the history