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

Update Clippy #97730

Merged
merged 126 commits into from
Jun 6, 2022
Merged

Update Clippy #97730

merged 126 commits into from
Jun 6, 2022

Commits on Feb 1, 2022

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

Commits on May 4, 2022

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

Commits on May 10, 2022

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

Commits on May 19, 2022

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

Commits on May 21, 2022

  1. Auto merge of rust-lang#96923 - eholk:fix-fake-read, r=nikomatsakis

    Drop Tracking: Implement `fake_read` callback
    
    This PR updates drop tracking's use of `ExprUseVisitor` so that we treat `fake_read` events as borrows. Without doing this, we were not handling match expressions correctly, which showed up as a breakage in the `addassign-yield.rs` test. We did not previously notice this because we still had rather large temporary scopes that we held borrows for, which changed in rust-lang#94309.
    
    This PR also includes a variant of the `addassign-yield.rs` test case to make sure we continue to have correct behavior here with drop tracking.
    
    r? `@nikomatsakis`
    bors committed May 21, 2022
    Configuration menu
    Copy the full SHA
    8d04a32 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    4587b66 View commit details
    Browse the repository at this point in the history
  3. Fix lint registration

    xFrednet committed May 21, 2022
    Configuration menu
    Copy the full SHA
    fc965c7 View commit details
    Browse the repository at this point in the history
  4. Auto merge of rust-lang#8848 - Serial-ATA:auto-detect-theme, r=xFrednet

    Auto-detect preferred colorscheme
    
    changelog: none
    
    This just sets the theme to coal by default if the user prefers dark color schemes.
    
    r? `@xFrednet`
    bors committed May 21, 2022
    Configuration menu
    Copy the full SHA
    91644d1 View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    cbe6607 View commit details
    Browse the repository at this point in the history
  6. get_last_with_len: lint VecDeque and any deref to slice

    previously only vecs were supported
    Alexendoo committed May 21, 2022
    Configuration menu
    Copy the full SHA
    8558490 View commit details
    Browse the repository at this point in the history
  7. Configuration menu
    Copy the full SHA
    a319937 View commit details
    Browse the repository at this point in the history

Commits on May 22, 2022

  1. factor out the rvalue lifetime rule

    remove region_scope_tree from RegionCtxt
    
    Apply suggestions from code review
    
    Co-authored-by: Niko Matsakis <niko@alum.mit.edu>
    dingxiangfei2009 and nikomatsakis committed May 22, 2022
    Configuration menu
    Copy the full SHA
    e885157 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    5cf07c6 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    0fd03a8 View commit details
    Browse the repository at this point in the history

Commits on May 23, 2022

  1. Configuration menu
    Copy the full SHA
    8ec9e5e View commit details
    Browse the repository at this point in the history
  2. Rollup merge of rust-lang#97254 - jhpratt:remove-crate-vis, r=cjgillot

    Remove feature: `crate` visibility modifier
    
    FCP completed in rust-lang#53120.
    Dylan-DPC authored May 23, 2022
    Configuration menu
    Copy the full SHA
    77d2b10 View commit details
    Browse the repository at this point in the history
  3. update dependencies

    hellow554 committed May 23, 2022
    Configuration menu
    Copy the full SHA
    9b55ea7 View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    a342f52 View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    0ad3a0a View commit details
    Browse the repository at this point in the history
  6. Auto merge of rust-lang#8870 - Serial-ATA:issue-8865, r=xFrednet

    Strip `clippy::` prefix from search strings
    
    changelog: none
    closes: rust-lang#8865
    
    r? `@xFrednet`
    bors committed May 23, 2022
    Configuration menu
    Copy the full SHA
    3642e33 View commit details
    Browse the repository at this point in the history
  7. Configuration menu
    Copy the full SHA
    0684d62 View commit details
    Browse the repository at this point in the history

Commits on May 24, 2022

  1. Rollup merge of rust-lang#97289 - compiler-errors:tcxify-clippy, r=Ma…

    …rk-Simulacrum
    
    Lifetime variance fixes for clippy
    
    rust-lang#97287 migrates rustc to a `Ty` type that is invariant over its lifetime `'tcx`, so I need to fix a bunch of places that assume that `Ty<'a>` and `Ty<'b>` can be shortened to some common lifetime.
    
    This is doable, since everything is already `'tcx`, so all this PR does is be a bit more explicit that elided lifetimes are actually `'tcx`.
    
    Split out from rust-lang#97287 so the clippy team can review independently.
    JohnTitor authored May 24, 2022
    Configuration menu
    Copy the full SHA
    1f3116f View commit details
    Browse the repository at this point in the history
  2. Auto merge of rust-lang#8872 - hellow554:dependency_update, r=llogiq

    update dependencies
    
    changelog: none
    
    Updating some dependencies, but the biggest one is clap to v3, but without using the derive struct thingy.
    bors committed May 24, 2022
    Configuration menu
    Copy the full SHA
    050cdd6 View commit details
    Browse the repository at this point in the history
  3. Auto merge of rust-lang#96098 - JakobDegen:always-return-place, r=oli…

    …-obk
    
    Refactor call terminator to always include destination place
    
    In rust-lang#71117 people seemed to agree that call terminators should always have a destination place, even if the call was guaranteed to diverge. This implements that. Unsurprisingly, the diff touches a lot of code, but thankfully I had to do almost nothing interesting. The only interesting thing came up in const prop, where the stack frame having no return place was also used to indicate that the layout could not be computed (or similar). I replaced this with a ZST allocation, which should continue to do the right things.
    
    cc `@RalfJung` `@eddyb` who were involved in the original conversation
    
    r? rust-lang/mir-opt
    bors committed May 24, 2022
    Configuration menu
    Copy the full SHA
    286b717 View commit details
    Browse the repository at this point in the history
  4. New lint no_effect_replace

    Closes rust-lang#1595
    
    changelog: Add no_effect_replace lint.
    guerinoni committed May 24, 2022
    Configuration menu
    Copy the full SHA
    ea62347 View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    22673bc View commit details
    Browse the repository at this point in the history
  6. prepare test for 8734

    hellow554 committed May 24, 2022
    Configuration menu
    Copy the full SHA
    04297de View commit details
    Browse the repository at this point in the history
  7. Fix imports for "Checking if a type defines a specific method"

    The import of `clippy_utils::is_type_diagnostic_item` would cause this
    error:
    
    ```
    error[E0432]: unresolved import `clippy_utils::is_type_diagnostic_item
    ```
    Dany Marcoux committed May 24, 2022
    Configuration menu
    Copy the full SHA
    21d9493 View commit details
    Browse the repository at this point in the history
  8. Fix manual_range_contains with equal precedence

    Evan Typanski committed May 24, 2022
    Configuration menu
    Copy the full SHA
    78f7e37 View commit details
    Browse the repository at this point in the history
  9. Auto merge of rust-lang#8754 - guerinoni:no_effect_replace, r=llogiq

    New lint `no_effect_replace`
    
    Closes rust-lang#1595
    
    Signed-off-by: Federico Guerinoni <guerinoni.federico@gmail.com>
    
    changelog: Add [`no_effect_replace`] lint.
    bors committed May 24, 2022
    Configuration menu
    Copy the full SHA
    fbb9e56 View commit details
    Browse the repository at this point in the history
  10. Auto merge of rust-lang#8881 - dmarcoux:update-outdated-doc, r=llogiq

    Fix imports for "Checking if a type defines a specific method"
    
    The import of `clippy_utils::is_type_diagnostic_item` would cause this error:
    
    ```
    error[E0432]: unresolved import `clippy_utils::is_type_diagnostic_item
    ```
    
    changelog: none
    bors committed May 24, 2022
    Configuration menu
    Copy the full SHA
    6269ab1 View commit details
    Browse the repository at this point in the history
  11. Fix issue with mismatched parens in suggestion

    Evan Typanski committed May 24, 2022
    Configuration menu
    Copy the full SHA
    257f097 View commit details
    Browse the repository at this point in the history
  12. Auto merge of rust-lang#8786 - Alexendoo:identity-op-suggestions, r=d…

    …swij,xFrednet
    
    `identity_op`: add parenthesis to suggestions where required
    
    changelog: [`identity_op`]: add parenthesis to suggestions where required
    
    Follow up to rust-lang#8730, wraps the cases we can't lint as-is in parenthesis rather than ignoring them
    
    Catches a couple new FPs with mixed operator precedences and `as` casts
    
    ```rust
    // such as
    0 + { a } * 2;
    0 + a as usize;
    ```
    
    The suggestions are now applied using `span_lint_and_sugg` rather than appearing in just the message and have a `run-rustfix` test
    bors committed May 24, 2022
    Configuration menu
    Copy the full SHA
    c41c410 View commit details
    Browse the repository at this point in the history
  13. Auto merge of rust-lang#8880 - hellow554:rustfix_update, r=Manishearth

    Add some testcases for recent rustfix update
    
    changelog: none
    
    This adds a testcase for a bugfix that has been fixed by https://github.com/rust-lang/rustfix/tree/v0.6.1
    
    `rustfix` is pulled in by `compiletest_rs`. So to test that the correct rustfix version is used, I added one (and a half) testcase.
    
    I tried to add a testcase for rust-lang#8734 as well, but interesting enough the rustfix is wrong:
    
    ```diff
     fn issue8734() {
         let _ = [0u8, 1, 2, 3]
             .into_iter()
    -        .and_then(|n| match n {
    +        .flat_map(|n| match n {
    +            1 => [n
    +                .saturating_add(1)
                 1 => [n
                     .saturating_add(1)
                     .saturating_add(1)
                     .saturating_add(1)
                     .saturating_add(1)
                     .saturating_add(1)
                     .saturating_add(1)
                     .saturating_add(1)
                     .saturating_add(1)],
                 n => [n],
             });
     }
    ```
    
    this needs some investigation and then this testcase needs to be enabled by commenting it out
    
    closes rust-lang#8878
    related to rust-lang#8734
    bors committed May 24, 2022
    Configuration menu
    Copy the full SHA
    67a0891 View commit details
    Browse the repository at this point in the history
  14. Auto merge of rust-lang#8862 - Alexendoo:get-last-with-len, r=Jarcho,…

    …xFrednet
    
    `get_last_with_len`: lint `VecDeque` and any deref to slice
    
    changelog: [`get_last_with_len`]: lint `VecDeque` and any deref to slice
    
    Previously only `Vec`s were linted, this will now catch any usages on slices, arrays, etc. It also suggests `.back()` for `VecDeque`s
    
    Also moves the lint into `methods/`
    bors committed May 24, 2022
    Configuration menu
    Copy the full SHA
    b97784f View commit details
    Browse the repository at this point in the history

Commits on May 25, 2022

  1. Configuration menu
    Copy the full SHA
    1dd0266 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    b531eb1 View commit details
    Browse the repository at this point in the history
  3. ignore clippy::get_first

    kyoto7250 committed May 25, 2022
    Configuration menu
    Copy the full SHA
    e47c5b0 View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    d0f93c1 View commit details
    Browse the repository at this point in the history
  5. Auto merge of rust-lang#8882 - kyoto7250:get_first, r=llogiq

    feat(lint): impl lint about use first() instead of get(0)
    
    close rust-lang#8851
    
    This PR adds new lint about considering replacing .get(0) with .first().
    
    Thank you in advance.
    
    changelog: adds new lint [`get_first`] to consider replacing .get(0) with .first()
    bors committed May 25, 2022
    Configuration menu
    Copy the full SHA
    3cc50a4 View commit details
    Browse the repository at this point in the history
  6. Configuration menu
    Copy the full SHA
    d8a281e View commit details
    Browse the repository at this point in the history
  7. Configuration menu
    Copy the full SHA
    4de301e View commit details
    Browse the repository at this point in the history
  8. Configuration menu
    Copy the full SHA
    f489954 View commit details
    Browse the repository at this point in the history
  9. Configuration menu
    Copy the full SHA
    2f25078 View commit details
    Browse the repository at this point in the history
  10. Collect renamed lints

    Serial-ATA committed May 25, 2022
    Configuration menu
    Copy the full SHA
    45be175 View commit details
    Browse the repository at this point in the history
  11. Configuration menu
    Copy the full SHA
    1c573c7 View commit details
    Browse the repository at this point in the history
  12. Auto merge of rust-lang#8889 - Serial-ATA:remove-newlines, r=xFrednet

    Remove newlines in [`match_str_case_mismatch`] example
    
    changelog: none
    bors committed May 25, 2022
    Configuration menu
    Copy the full SHA
    45785fe View commit details
    Browse the repository at this point in the history
  13. Configuration menu
    Copy the full SHA
    9ee211a View commit details
    Browse the repository at this point in the history

Commits on May 26, 2022

  1. Auto merge of rust-lang#8866 - botahamec:unused-rounding, r=llogiq

    Add new lint `[unused_rounding]`
    
    fixes rust-lang#39
    
    changelog: added a ``[`unused_rounding`]`` lint to check for the rounding of whole-number literals
    bors committed May 26, 2022
    Configuration menu
    Copy the full SHA
    bc4d39e View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    17f7047 View commit details
    Browse the repository at this point in the history
  3. fix

    tamaroning committed May 26, 2022
    Configuration menu
    Copy the full SHA
    ea06a41 View commit details
    Browse the repository at this point in the history
  4. Auto merge of rust-lang#8896 - Alexendoo:fn_sig_ice, r=llogiq

    Only return `DefId`s to `Fn`-like definitions in `clippy_utils::fn_def_id`
    
    Fixes rust-lang#8850
    
    in `returns.rs` `tcx.fn_sig` is called on the result of `fn_def_id`, which panics if the def is a `const`/`static`/etc rather than a functions definition
    
    https://github.com/rust-lang/rust-clippy/blob/bc4d39e5fea64970dded1e6d2132d41435c0ef24/clippy_lints/src/returns.rs#L294-L303
    
    changelog: Fix ICE due to callable `static`/`const`s
    bors committed May 26, 2022
    Configuration menu
    Copy the full SHA
    6553b98 View commit details
    Browse the repository at this point in the history

Commits on May 27, 2022

  1. Configuration menu
    Copy the full SHA
    fc28f6a View commit details
    Browse the repository at this point in the history
  2. Auto merge of rust-lang#8885 - Serial-ATA:rc-clone-in-vec-init-weak, …

    …r=llogiq
    
    Support `Weak` in [`rc_clone_in_vec_init`]
    
    changelog: Support `Weak` in [`rc_clone_in_vec_init`]
    bors committed May 27, 2022
    Configuration menu
    Copy the full SHA
    a5ece81 View commit details
    Browse the repository at this point in the history
  3. When setting suggestion, add suggestion for MoveAndClone for non-ref

    When trying to set the current suggestion, if the type of the expression
    is not a reference and it is not trivially pure clone copy, we should still
    trigger and emit a lint message. Since this fix may require cloning an
    expensive-to-clone type, do not attempt to offer a suggested fix.
    
    This change means that matches generated from TryDesugar and AwaitDesugar
    would normally trigger a lint, but they are out of scope for this lint,
    so we will explicitly ignore matches with sources of TryDesugar or
    AwaitDesugar.
    
    changelog: Update for [`significant_drop_in_scrutinee`] to correctly
    emit lint messages for cases where the type is not a reference and
    not trivially pure clone copy.
    PrestonFrom committed May 27, 2022
    Configuration menu
    Copy the full SHA
    e33d87d View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    911eb1f View commit details
    Browse the repository at this point in the history
  5. Address review comments

    smoelius committed May 27, 2022
    Configuration menu
    Copy the full SHA
    c91a7f0 View commit details
    Browse the repository at this point in the history
  6. Fix assert! message

    smoelius committed May 27, 2022
    Configuration menu
    Copy the full SHA
    8f49e41 View commit details
    Browse the repository at this point in the history
  7. Auto merge of rust-lang#8897 - tamaroning:improve_dbg, r=Alexendoo

    Introduce `allow-dbg-in-tests` config value
    
    related to: Issue rust-lang#8758,  PR rust-lang/rust-clippy#8838
    
    changelog: Introduced `allow-dbg-in-tests` config value. [dbg_macro] does not allow `dbg!` in test code by default.
    bors committed May 27, 2022
    Configuration menu
    Copy the full SHA
    461a661 View commit details
    Browse the repository at this point in the history
  8. Auto merge of rust-lang#8892 - smoelius:fix-empty-line-false-positive…

    …, r=Manishearth
    
    Fix `empty_line_after_outer_attribute` false positive
    
    This PR fixes a false positive in `empty_line_after_outer_attribute`.
    
    Here is a minimal example that trigger the FP:
    ```rust
    #[derive(clap::Parser)]
    #[clap(after_help = "This ia a help message.
    
    You're welcome.
    ")]
    pub struct Args;
    ```
    
    changelog: PF: [`empty_line_after_outer_attribute`]: No longer lints empty lines in inner string values.
    bors committed May 27, 2022
    Configuration menu
    Copy the full SHA
    1dd5547 View commit details
    Browse the repository at this point in the history
  9. Ignore crashes dir

    smoelius committed May 27, 2022
    Configuration menu
    Copy the full SHA
    6027255 View commit details
    Browse the repository at this point in the history
  10. Configuration menu
    Copy the full SHA
    4fc0ee6 View commit details
    Browse the repository at this point in the history
  11. Configuration menu
    Copy the full SHA
    19f94d5 View commit details
    Browse the repository at this point in the history

Commits on May 28, 2022

  1. Configuration menu
    Copy the full SHA
    c9be57d View commit details
    Browse the repository at this point in the history
  2. Auto merge of rust-lang#8844 - smoelius:fixed-paths, r=Alexendoo

    Check `.fixed` paths' existence in `run_ui`
    
    This PR adds a test to check that there exists a `.fixed` file for every `.stderr` file in `tests/ui` that mentions a `MachineApplicable` lint. The test leverages `compiletest-rs`'s `rustfix_coverage` option.
    
    I tried to add `.fixed` files where they appeared to be missing. However, 38 exceptional `.rs` files remain. Several of those include comments indicating that they are exceptions, though not all do. Apologies, as I have not tried to associate the 38 files with GH issues. (I think that would be a lot of work, and I worry about linking the wrong issue.)
    
    changelog: none
    bors committed May 28, 2022
    Configuration menu
    Copy the full SHA
    5920fa3 View commit details
    Browse the repository at this point in the history
  3. Make docs more consistent

    Serial-ATA committed May 28, 2022
    Configuration menu
    Copy the full SHA
    cfd0f55 View commit details
    Browse the repository at this point in the history
  4. Update lint creation docs

    Serial-ATA committed May 28, 2022
    Configuration menu
    Copy the full SHA
    adafb6c View commit details
    Browse the repository at this point in the history
  5. Auto merge of rust-lang#8385 - cameron1024:doc_link_with_quotes, r=ll…

    …ogiq
    
    add doc_link_with_quotes lint
    
    I'm not sure about wording, it seems OK to me but happy to change if other people have better ideas
    
    closes rust-lang#8383
    
    ---
    changelog: add [`doc_link_with_quotes`] lint
    bors committed May 28, 2022
    Configuration menu
    Copy the full SHA
    39231b4 View commit details
    Browse the repository at this point in the history

Commits on May 29, 2022

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

Commits on May 30, 2022

  1. needless_deref

    lengyijun committed May 30, 2022
    Configuration menu
    Copy the full SHA
    c541015 View commit details
    Browse the repository at this point in the history
  2. run-rustfix

    lengyijun committed May 30, 2022
    Configuration menu
    Copy the full SHA
    8430fa2 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    2aa4569 View commit details
    Browse the repository at this point in the history
  4. Fix rust-lang#8748

    b-ncMN authored and infrandomness committed May 30, 2022
    Configuration menu
    Copy the full SHA
    0a7f19b View commit details
    Browse the repository at this point in the history
  5. Auto merge of rust-lang#8899 - botahamec:use-self-tuple-struct-varian…

    …ts, r=Alexendoo
    
    Fix `[use_self]` false negative with on struct and tuple struct patterns
    
    fixes rust-lang#8845
    
    changelog: Triggered the warning for ``[`use_self`]`` on `TupleStruct` and `Struct` patterns, whereas currently it's only triggered for `Path` patterns
    bors committed May 30, 2022
    Configuration menu
    Copy the full SHA
    d9f4978 View commit details
    Browse the repository at this point in the history

Commits on May 31, 2022

  1. Add a pointer to address cast kind

    A pointer to address cast are often special-cased.
    Introduce a dedicated cast kind to make them easy distinguishable.
    tmiasko committed May 31, 2022
    Configuration menu
    Copy the full SHA
    4e45960 View commit details
    Browse the repository at this point in the history
  2. Auto merge of rust-lang#8913 - InfRandomness:ICE-rust-lang#8748, r=gi…

    …raffate
    
    Fix rust-lang#8748
    
    Thank you for making Clippy better!
    
    changelog: Fix ICE rust-lang#8748 in shadow.rs
    bors committed May 31, 2022
    Configuration menu
    Copy the full SHA
    588e198 View commit details
    Browse the repository at this point in the history
  3. Auto merge of rust-lang#8912 - Alexendoo:needless-late-init-ice, r=gi…

    …raffate
    
    needless_late_init: fix ICE when all branches return the never type
    
    Fixes rust-lang#8911
    
    When the assignment is done in a match guard or the if condition and all of the branches return the never type `assignment_suggestions` would return an empty `Vec` which caused the ICE. It now returns `None` in that scenario
    
    Also moves some tests to the top of the file
    
    changelog: ICE Fixes: [`needless_late_init`] rust-lang#8911
    bors committed May 31, 2022
    Configuration menu
    Copy the full SHA
    e1607e9 View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    eb2908b View commit details
    Browse the repository at this point in the history
  5. Auto merge of rust-lang#8918 - Jarcho:almost_complete_letter_range, r…

    …=llogiq
    
    Add lint `almost_complete_letter_range`
    
    fixes rust-lang#7269
    
    changelog: Add lint `almost_complete_letter_range`
    bors committed May 31, 2022
    Configuration menu
    Copy the full SHA
    2466a05 View commit details
    Browse the repository at this point in the history
  6. Configuration menu
    Copy the full SHA
    9c9cca3 View commit details
    Browse the repository at this point in the history
  7. Configuration menu
    Copy the full SHA
    0c6ebf1 View commit details
    Browse the repository at this point in the history
  8. Auto merge of rust-lang#8876 - Alexendoo:cast-abs-to-different-uint, …

    …r=dswij,xFrednet
    
    `cast_abs_to_unsigned`: do not remove cast if it's required
    
    Fixes rust-lang#8873
    
    If `iX` is not cast to `uX` then keep the cast rather than removing it
    
    changelog: [`cast_abs_to_unsigned`]: do not remove cast if it's required
    bors committed May 31, 2022
    Configuration menu
    Copy the full SHA
    9add456 View commit details
    Browse the repository at this point in the history
  9. Auto merge of rust-lang#8564 - Jarcho:transmute_erase_regions, r=Alex…

    …endoo
    
    Don't lint `useless_transmute` on types with erased regions
    
    fixes rust-lang#6356
    fixes rust-lang#3340
    fixes rust-lang#2906
    
    This should get a proper fix at some point, but this at least gets the lint running on some types.
    
    cc rust-lang#5343
    
    changelog: Don't lint `useless_transmute` on types with erased regions
    bors committed May 31, 2022
    Configuration menu
    Copy the full SHA
    7000e75 View commit details
    Browse the repository at this point in the history
  10. Auto merge of rust-lang#8884 - evantypanski:manual_range_contains_mul…

    …tiple, r=Manishearth
    
    Fix `manual_range_contains` false negative with chains of `&&` and `||`
    
    Fixes rust-lang#8745
    
    Since the precedence for `&&` is the same as itself the HIR for a chain of `&&` ends up with a right skewed tree like:
    
    ```
         &&
        /  \
      &&   c2
     /  \
    ... c1
    ```
    
    So only the leftmost `&&` was actually "fully" checked, the top level was just `c2` and `&&` so the `manual_range_contains` lint won't apply. This change makes it also check `c2` with `c1`.
    
    There's a bit of a hacky solution in the [second commit](rust-lang/rust-clippy@257f097) to check if the number of open/closing parens in the snippet match. This is to prevent a case like `((x % 2 == 0) || (x < 0)) || (x >= 10)` from offering a suggestion like `((x % 2 == 0) || !(0..10).contains(&x)` which now won't compile.
    
    Any suggestions for that paren hack welcome, kinda new to working on this so not too sure about possible solutions :) it's weird because I don't know how else to check for parens in HIR considering they're removed when lowering AST.
    
    changelog: Fix [`manual_range_contains`] false negative with chains of `&&` and `||`
    bors committed May 31, 2022
    Configuration menu
    Copy the full SHA
    5b1a4c0 View commit details
    Browse the repository at this point in the history
  11. Add lint swap_ptr_to_ref

    Jarcho committed May 31, 2022
    Configuration menu
    Copy the full SHA
    ca78e24 View commit details
    Browse the repository at this point in the history
  12. Auto merge of rust-lang#8916 - Jarcho:swap_ptr_to_ref, r=Manishearth

    New lint `swap_ptr_to_ref`
    
    fixes: rust-lang#7381
    
    changelog: New lint `swap_ptr_to_ref`
    bors committed May 31, 2022
    Configuration menu
    Copy the full SHA
    f0bf200 View commit details
    Browse the repository at this point in the history

Commits on Jun 1, 2022

  1. Lazify SourceFile::lines.

    `SourceFile::lines` is a big part of metadata. It's stored in a compressed form
    (a difference list) to save disk space. Decoding it is a big fraction of
    compile time for very small crates/programs.
    
    This commit introduces a new type `SourceFileLines` which has a `Lines`
    form and a `Diffs` form. The latter is used when the metadata is first
    read, and it is only decoded into the `Lines` form when line data is
    actually needed. This avoids the decoding cost for many files,
    especially in `std`. It's a performance win of up to 15% for tiny
    crates/programs where metadata decoding is a high part of compilation
    costs.
    
    A `Lock` is needed because the methods that access lines data (which can
    trigger decoding) take `&self` rather than `&mut self`. To allow for this,
    `SourceFile::lines` now takes a `FnMut` that operates on the lines slice rather
    than returning the lines slice.
    nnethercote committed Jun 1, 2022
    Configuration menu
    Copy the full SHA
    11d22ae View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    202fdb9 View commit details
    Browse the repository at this point in the history
  3. Auto merge of rust-lang#7930 - lengyijun:needless_deref_new, r=Jarcho

    new lint: `borrow_deref_ref`
    
    changelog: ``[`borrow_deref_ref`]``
    
    Related pr: rust-lang#6837 rust-lang#7577
    `@Jarcho` Could you please give a review?
    
    `cargo lintcheck` gives no false negative (but tested crates are out-of-date).
    
    TODO:
    1. Not sure the name. `deref_on_immutable_ref` or some others?
    bors committed Jun 1, 2022
    Configuration menu
    Copy the full SHA
    c4c413b View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    86092a7 View commit details
    Browse the repository at this point in the history
  5. Auto merge of rust-lang#8869 - Jarcho:derive_partial_eq_without_eq, r…

    …=flip1995
    
    Set correct `ParamEnv` for `derive_partial_eq_without_eq`
    
    fixes rust-lang#8867
    
    changelog: Handle differing predicates applied by `#[derive(PartialEq)]` and `#[derive(Eq)]` in `derive_partial_eq_without_eq`
    bors committed Jun 1, 2022
    Configuration menu
    Copy the full SHA
    7572b6b View commit details
    Browse the repository at this point in the history
  6. Combine doc examples

    Serial-ATA committed Jun 1, 2022
    Configuration menu
    Copy the full SHA
    b20f95c View commit details
    Browse the repository at this point in the history

Commits on Jun 2, 2022

  1. Auto merge of rust-lang#8908 - Serial-ATA:doc-comment-issues, r=xFrednet

    Make docs more consistent
    
    changelog: none
    
    This just fixes some docs to make them more consistent. I mostly just changed `// Good`, `// Bad`, etc to `Use instead:`.
    bors committed Jun 2, 2022
    Configuration menu
    Copy the full SHA
    0d5ace3 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    bc5a8e9 View commit details
    Browse the repository at this point in the history
  3. account for generics

    llogiq committed Jun 2, 2022
    Configuration menu
    Copy the full SHA
    756caf7 View commit details
    Browse the repository at this point in the history
  4. Auto merge of rust-lang#8905 - c410-f3r:arith, r=llogiq

    [1/N] Implement Arithmetic lint
    
    Assuming that rust-lang/rust-clippy#8903 is OK, this PR starts the creation of the `Arithmetic` lint with configurable types.
    
    My current struggle to get a rustc review inspired me to create smaller PRs in order to easy review and make merges as fast as possible. So the first step here only moves the `arithmetic.rs` file to `numeric_arithmetic.rs` to make room for the new lint.
    
    --
    changelog: none
    bors committed Jun 2, 2022
    Configuration menu
    Copy the full SHA
    9428e2e View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    b885035 View commit details
    Browse the repository at this point in the history
  6. Configuration menu
    Copy the full SHA
    678dcdd View commit details
    Browse the repository at this point in the history
  7. Configuration menu
    Copy the full SHA
    0600de4 View commit details
    Browse the repository at this point in the history
  8. Auto merge of rust-lang#8906 - rust-lang:copy-large-enum-variants, r=…

    …Jarcho
    
    remove `large_enum_variant` suggestion for `Copy` types
    
    Replaces the (erroneous) suggestion on `large_enum_variant` for `Copy` types by a note. This fixes rust-lang#8894.
    
    ---
    
    changelog: none
    bors committed Jun 2, 2022
    Configuration menu
    Copy the full SHA
    e32b66c View commit details
    Browse the repository at this point in the history
  9. Auto merge of rust-lang#8902 - PrestonFrom:add_suggestion_for_move_an…

    …d_clone_when_not_ref, r=flip1995
    
    When setting suggestion for significant_drop_in_scrutinee, add suggestion for MoveAndClone for non-ref
    
    When trying to set the current suggestion, if the type of the expression
    is not a reference and it is not trivially pure clone copy, we should still
    trigger and emit a lint message. Since this fix may require cloning an
    expensive-to-clone type, do not attempt to offer a suggested fix.
    
    This change means that matches generated from TryDesugar and AwaitDesugar
    would normally trigger a lint, but they are out of scope for this lint,
    so we will explicitly ignore matches with sources of TryDesugar or
    AwaitDesugar.
    
    changelog: Update for ``[`significant_drop_in_scrutinee`]`` to correctly
    emit lint messages for cases where the type is not a reference *and*
    not trivially pure clone copy.
    changelog: [`significant_drop_in_scrutinee`]: No longer lint on Try `?`
    and `await` desugared expressions.
    bors committed Jun 2, 2022
    Configuration menu
    Copy the full SHA
    97e5449 View commit details
    Browse the repository at this point in the history
  10. Auto merge of rust-lang#97575 - nnethercote:lazify-SourceFile-lines, …

    …r=Mark-Simulacrum
    
    Lazify `SourceFile::lines`.
    
    `SourceFile::lines` is a big part of metadata. It's stored in a compressed form
    (a difference list) to save disk space. Decoding it is a big fraction of
    compile time for very small crates/programs.
    
    This commit introduces a new type `SourceFileLines` which has a `Lines`
    form and a `Diffs` form. The latter is used when the metadata is first
    read, and it is only decoded into the `Lines` form when line data is
    actually needed. This avoids the decoding cost for many files,
    especially in `std`. It's a performance win of up to 15% for tiny
    crates/programs where metadata decoding is a high part of compilation
    costs.
    
    A `RefCell` is needed because the methods that access lines data (which can
    trigger decoding) take `&self` rather than `&mut self`. To allow for this,
    `SourceFile::lines` now takes a `FnMut` that operates on the lines slice rather
    than returning the lines slice.
    
    r? `@Mark-Simulacrum`
    bors committed Jun 2, 2022
    Configuration menu
    Copy the full SHA
    2a18d12 View commit details
    Browse the repository at this point in the history

Commits on Jun 3, 2022

  1. Auto merge of rust-lang#8932 - dswij:pr-8879, r=giraffate

    `needless_return` checks for macro expr in return stmts
    
    closes rust-lang#8879
    
    Macro expressions in returns were not checked by `needless_return`. The test added in [this commit](rust-lang/rust-clippy@6396a7a#diff-a869168cfafb7e6e5010feb76a16389d6c96d59e98113dee5c2b304a5160e43aR51-R55) seems to have regressed.
    
    changelog: [`needless_return`] checks for macro exprs in return statements
    bors committed Jun 3, 2022
    Configuration menu
    Copy the full SHA
    1194c63 View commit details
    Browse the repository at this point in the history
  2. Add new lint mismatching_type_param_order

    Add new lint for checking if type parameters are consistent between type
    definitions and impl blocks.
    arieluy committed Jun 3, 2022
    Configuration menu
    Copy the full SHA
    58cd01c View commit details
    Browse the repository at this point in the history
  3. Rollup merge of rust-lang#97653 - RalfJung:int-to-ptr, r=oli-obk

    add cast kind of from_exposed_addr (int-to-ptr casts)
    
    This is basically the dual to rust-lang#97582, for int2ptr casts.
    
    Cc `@tmiasko` rust-lang#97649
    Dylan-DPC authored Jun 3, 2022
    Configuration menu
    Copy the full SHA
    baacbfd View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    1e86cc5 View commit details
    Browse the repository at this point in the history
  5. Auto merge of rust-lang#8831 - arieluy:type_params, r=dswij

    Add new lint `mismatching_type_param_order`
    
    changelog: Add new lint [`mismatching_type_param_order`] for checking if type parameters are consistent between type definitions and impl blocks.
    
    fixes rust-lang#7147
    bors committed Jun 3, 2022
    Configuration menu
    Copy the full SHA
    7c0d649 View commit details
    Browse the repository at this point in the history
  6. Rollup merge of rust-lang#97415 - cjgillot:is-late-bound-solo, r=este…

    …bank
    
    Compute `is_late_bound_map` query separately from lifetime resolution
    
    This query is actually very simple, and is only useful for functions and method.  It can be computed directly by fetching the HIR, with no need to embed it within the lifetime resolution visitor.
    
    Based on rust-lang#96296
    Dylan-DPC authored Jun 3, 2022
    Configuration menu
    Copy the full SHA
    5730482 View commit details
    Browse the repository at this point in the history
  7. add as_underscore lint

    DevAccentor committed Jun 3, 2022
    Configuration menu
    Copy the full SHA
    64fe4e3 View commit details
    Browse the repository at this point in the history
  8. Configuration menu
    Copy the full SHA
    81e4450 View commit details
    Browse the repository at this point in the history
  9. Auto merge of rust-lang#8934 - DevAccentor:as_underscore, r=Manishearth

    add [`as_underscore`] lint
    
    closes rust-lang#8847
    
    detect usage of `as _` and enforce the usage of explicit type like
    ```rust
    fn foo(n: usize) {}
    let n: u16 = 256;
    foo(n as _);
    ```
    will suggest to change to
    ```rust
    fn foo(n: usize) {}
    let n: u16 = 256;
    foo(n as usize);
    ```
    
    changelog: add [`as_underscore`] lint
    bors committed Jun 3, 2022
    Configuration menu
    Copy the full SHA
    ebd357e View commit details
    Browse the repository at this point in the history
  10. Configuration menu
    Copy the full SHA
    b337f9e View commit details
    Browse the repository at this point in the history
  11. Configuration menu
    Copy the full SHA
    3d8d734 View commit details
    Browse the repository at this point in the history
  12. Configuration menu
    Copy the full SHA
    8c8a52e View commit details
    Browse the repository at this point in the history
  13. Configuration menu
    Copy the full SHA
    dbc7753 View commit details
    Browse the repository at this point in the history
  14. Configuration menu
    Copy the full SHA
    67cb5ec View commit details
    Browse the repository at this point in the history
  15. Configuration menu
    Copy the full SHA
    68c411f View commit details
    Browse the repository at this point in the history

Commits on Jun 4, 2022

  1. Auto merge of rust-lang#8937 - Jarcho:merge_match_passes, r=llogiq

    Merge various passes into `Matches`
    
    changelog: None
    bors committed Jun 4, 2022
    Configuration menu
    Copy the full SHA
    b1a3e7e View commit details
    Browse the repository at this point in the history
  2. Auto merge of rust-lang#8843 - Serial-ATA:collect-renamed, r=xFrednet

    Collect renamed lints
    
    changelog: Display past names of renamed lints on Clippy's lint list
    
    cc rust-lang#7172
    
    r? `@xFrednet`
    bors committed Jun 4, 2022
    Configuration menu
    Copy the full SHA
    8ef4908 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    7f402b1 View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    36b1892 View commit details
    Browse the repository at this point in the history
  5. Auto merge of rust-lang#8942 - flip1995:rustup, r=flip1995

    Rustup
    
    r? `@ghost`
    
    changelog: none
    bors committed Jun 4, 2022
    Configuration menu
    Copy the full SHA
    d9ddce8 View commit details
    Browse the repository at this point in the history
  6. Configuration menu
    Copy the full SHA
    d55c373 View commit details
    Browse the repository at this point in the history
  7. Remove unnecessary clap_derive dependency added in 9ee211a

    The fixed issue in this commit can be tested without depending on
    clap/clap_derive. This updates the test case to do so.
    flip1995 committed Jun 4, 2022
    Configuration menu
    Copy the full SHA
    c22d4e6 View commit details
    Browse the repository at this point in the history
  8. Update Cargo.lock

    This updates the Cargo.lock file for Clippy:
    
    - parking_lot 0.11.2 -> 0.12 (now 2 versions in parking lot)
    - rustfix 0.6.0 -> 0.6.1 (now only one version left)
    - compiletest_rs 0.7.1 -> 0.8
    - clap 2.34.0 -> 3.1.1
    flip1995 committed Jun 4, 2022
    Configuration menu
    Copy the full SHA
    586cbd0 View commit details
    Browse the repository at this point in the history

Commits on Jun 6, 2022

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