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 #103337

Merged
merged 116 commits into from
Oct 24, 2022
Merged

Update Clippy #103337

merged 116 commits into from
Oct 24, 2022

Commits on Sep 10, 2022

  1. Add manual_filter lint for Option

    Share much of its implementation with `manual_map` and should greatly benefit from its previous feedback.
    kraktus committed Sep 10, 2022
    Configuration menu
    Copy the full SHA
    0958f94 View commit details
    Browse the repository at this point in the history

Commits on Oct 1, 2022

  1. Add as_ptr_cast_mut lint

    This lint detects calls to a `&self`-taking `as_ptr` method, where
    the result is then immediately cast to a `*mut T`. Code like this
    is probably invalid, as that pointer will not have write permissions,
    and `*mut T` is usually used to write through.
    Noratrieb committed Oct 1, 2022
    Configuration menu
    Copy the full SHA
    b91dc03 View commit details
    Browse the repository at this point in the history
  2. Improve wording

    Noratrieb committed Oct 1, 2022
    Configuration menu
    Copy the full SHA
    169ef78 View commit details
    Browse the repository at this point in the history
  3. Fix example

    Noratrieb committed Oct 1, 2022
    Configuration menu
    Copy the full SHA
    2b944d0 View commit details
    Browse the repository at this point in the history

Commits on Oct 2, 2022

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

Commits on Oct 3, 2022

  1. refactor manual_filter

    Move common functions to `manual_utils.rs`, better arm matching, use clippy utils `contains_unsafe_block`
    kraktus committed Oct 3, 2022
    Configuration menu
    Copy the full SHA
    b89ac0c View commit details
    Browse the repository at this point in the history

Commits on Oct 5, 2022

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

Commits on Oct 6, 2022

  1. Configuration menu
    Copy the full SHA
    d75b25f View commit details
    Browse the repository at this point in the history
  2. Remove mir::CastKind::Misc

    ouz-a committed Oct 6, 2022
    Configuration menu
    Copy the full SHA
    13dbc33 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    d3c041a View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    09a554d View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    4936848 View commit details
    Browse the repository at this point in the history
  6. Configuration menu
    Copy the full SHA
    23b1699 View commit details
    Browse the repository at this point in the history
  7. Configuration menu
    Copy the full SHA
    39164ac View commit details
    Browse the repository at this point in the history
  8. Auto merge of rust-lang#9601 - evantypanski:et/issue9575, r=Manishearth

    [`match_single_binding`] Add curlies for more cases to fix suggestion causes error
    
    Fixes rust-lang#9575
    
    changelog: [`match_single_binding`]: Add curlies for scrutinees with side effects for more cases
    bors committed Oct 6, 2022
    Configuration menu
    Copy the full SHA
    3690199 View commit details
    Browse the repository at this point in the history

Commits on Oct 7, 2022

  1. Auto merge of rust-lang#9595 - Alexendoo:author-let-chains, r=Jarcho

    Replace if_chain with let chains in `clippy::author` output
    
    Should help nudge new contributors towards let chains
    
    changelog: none
    bors committed Oct 7, 2022
    Configuration menu
    Copy the full SHA
    65ae666 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    037f698 View commit details
    Browse the repository at this point in the history
  3. Fix adjacent code

    smoelius committed Oct 7, 2022
    Configuration menu
    Copy the full SHA
    9cc8da2 View commit details
    Browse the repository at this point in the history
  4. Introduce TypeErrCtxt

    TypeErrCtxt optionally has a TypeckResults so that InferCtxt doesn't
    need to.
    camsteffen committed Oct 7, 2022
    Configuration menu
    Copy the full SHA
    3b328e7 View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    6819e85 View commit details
    Browse the repository at this point in the history
  6. Auto merge of rust-lang#9585 - rust-lang:extend-box-default, r=Alexendoo

    extend `box-default` lint, add suggestion
    
    This extends the recently added `box-default` lint to also cover `Box::new(vec![])`, `Box::new(String::from(""))` and `Box::new(Vec::from([]))`. Also the lint now suggests a suitable replacement. I did not find a simple way to check whether the type is fully determined by the outside, so I at least checked for some variations to remove the turbofish in those cases.
    
    ---
    
    changelog: none
    bors committed Oct 7, 2022
    Configuration menu
    Copy the full SHA
    2c8e473 View commit details
    Browse the repository at this point in the history
  7. make const_err a hard error

    RalfJung committed Oct 7, 2022
    Configuration menu
    Copy the full SHA
    e91746e View commit details
    Browse the repository at this point in the history
  8. Auto merge of rust-lang#102091 - RalfJung:const_err, r=oli-obk

    make const_err a hard error
    
    This lint has been deny-by-default with future incompat wording since [Rust 1.51](rust-lang#80394) and the stable release of this week starts showing it in cargo's future compat reports. I can't wait to finally get rid of at least some of the mess in our const-err-reporting-code. ;)
    
    r? `@oli-obk`
    Fixes rust-lang#71800
    Fixes rust-lang#100114
    bors committed Oct 7, 2022
    Configuration menu
    Copy the full SHA
    7c372cd View commit details
    Browse the repository at this point in the history

Commits on Oct 8, 2022

  1. Configuration menu
    Copy the full SHA
    5f6e1d3 View commit details
    Browse the repository at this point in the history
  2. Rollup merge of rust-lang#102675 - ouz-a:mir-technical-debt, r=oli-obk

    Remove `mir::CastKind::Misc`
    
    As discussed in rust-lang#97649 `mir::CastKind::Misc` is not clear, this PR addresses that by creating a new enum variant for every valid cast.
    
    r? ````@oli-obk````
    matthiaskrgr authored Oct 8, 2022
    Configuration menu
    Copy the full SHA
    4013d36 View commit details
    Browse the repository at this point in the history
  3. [unnecessary_cast] Do not lint negative hexadecimal literals when c…

    …ast as float
    
    Floats cannot be expressed as hexadecimal literals
    kraktus committed Oct 8, 2022
    Configuration menu
    Copy the full SHA
    6f4546a View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    39a7d00 View commit details
    Browse the repository at this point in the history
  5. Auto merge of rust-lang#9451 - kraktus:manual_filter2, r=dswij

    Add `manual_filter` lint for `Option`
    
    Share much of its implementation with `manual_map` and should greatly benefit from its previous feedback.
    I'm sure it's possible to even more refactor both and would gladly take input on that as well as any clippy idiomatic usage, since this is my first lint addition.
    
    I've added the lint to the complexity section for now, I don't know if every new lint needs to go in nursery first.
    
    The matching could be expanded to more than `Some(<value>)` to lint on arbitrary struct matching inside the `Some` but I've left it like it was for `manual_map` for now. `needless_match::pat_same_as_expr` provides a more generic match example.
    
    close rust-lang/rust-clippy#8822
    
    changelog: Add lint [`manual_filter`] for `Option`
    bors committed Oct 8, 2022
    Configuration menu
    Copy the full SHA
    292e313 View commit details
    Browse the repository at this point in the history
  6. Auto merge of rust-lang#9386 - smoelius:further-enhance-needless-borr…

    …ow, r=Jarcho
    
    Further enhance `needless_borrow`, mildly refactor `redundant_clone`
    
    This PR does the following:
    * Moves some code from `redundant_clone` into a new `clippy_utils` module called `mir`, and wraps that code in a function called `dropped_without_further_use`.
    * Relaxes the "is copyable" condition condition from rust-lang#9136 by also suggesting to remove borrows from values dropped without further use. The changes involve the just mentioned function.
    * Separates `redundant_clone` into modules.
    
    Strictly speaking, the last bullet is independent of the others. `redundant_clone` is somewhat hairy, IMO. Separating it into modules makes it slightly less so, by helping to delineate what depends upon what.
    
    I've tried to break everything up into digestible commits.
    
    r? `@Jarcho`
    
    (`@Jarcho` I hope you don't mind.)
    
    changelog: continuation of rust-lang#9136
    bors committed Oct 8, 2022
    Configuration menu
    Copy the full SHA
    272bbfb View commit details
    Browse the repository at this point in the history

Commits on Oct 9, 2022

  1. Configuration menu
    Copy the full SHA
    8e76d66 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    3fc903e View commit details
    Browse the repository at this point in the history
  3. fixup lint name

    WaffleLapkin committed Oct 9, 2022
    Configuration menu
    Copy the full SHA
    05dcfd9 View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    7cfc6fa View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    1688368 View commit details
    Browse the repository at this point in the history
  6. Rollup merge of rust-lang#102829 - compiler-errors:rename-impl-item-k…

    …ind, r=TaKO8Ki
    
    rename `ImplItemKind::TyAlias` to `ImplItemKind::Type`
    
    The naming of this variant seems inconsistent given that this is not really a "type alias", and the associated type variant for `TraitItemKind` is just called `Type`.
    JohnTitor authored Oct 9, 2022
    Configuration menu
    Copy the full SHA
    5ccf727 View commit details
    Browse the repository at this point in the history

Commits on Oct 10, 2022

  1. Rollup merge of rust-lang#102275 - Urgau:stabilize-half_open_range_pa…

    …tterns, r=cjgillot
    
    Stabilize `half_open_range_patterns`
    
    This PR stabilize `feature(half_open_range_patterns)`:
    ```
    Allows using `..=X` as a pattern.
    ```
    
    And adds a new `feature(half_open_range_patterns_in_slices)` for the slice part, rust-lang#102275 (comment).
    
    The FCP was completed in rust-lang#67264.
    JohnTitor authored Oct 10, 2022
    Configuration menu
    Copy the full SHA
    e7a5249 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    7a42219 View commit details
    Browse the repository at this point in the history
  3. Rollup merge of rust-lang#99696 - WaffleLapkin:uplift, r=fee1-dead

    Uplift `clippy::for_loops_over_fallibles` lint into rustc
    
    This PR, as the title suggests, uplifts [`clippy::for_loops_over_fallibles`] lint into rustc. This lint warns for code like this:
    ```rust
    for _ in Some(1) {}
    for _ in Ok::<_, ()>(1) {}
    ```
    i.e. directly iterating over `Option` and `Result` using `for` loop.
    
    There are a number of suggestions that this PR adds (on top of what clippy suggested):
    1. If the argument (? is there a better name for that expression) of a `for` loop is a `.next()` call, then we can suggest removing it (or rather replacing with `.by_ref()` to allow iterator being used later)
       ```rust
        for _ in iter.next() {}
        // turns into
        for _ in iter.by_ref() {}
        ```
    2. (otherwise) We can suggest using `while let`, this is useful for non-iterator, iterator-like things like [async] channels
       ```rust
       for _ in rx.recv() {}
       // turns into
       while let Some(_) = rx.recv() {}
       ```
    3. If the argument type is `Result<impl IntoIterator, _>` and the body has a `Result<_, _>` type, we can suggest using `?`
       ```rust
       for _ in f() {}
       // turns into
       for _ in f()? {}
       ```
    4. To preserve the original behavior and clear intent, we can suggest using `if let`
       ```rust
       for _ in f() {}
       // turns into
       if let Some(_) = f() {}
       ```
    (P.S. `Some` and `Ok` are interchangeable depending on the type)
    
    I still feel that the lint wording/look is somewhat off, so I'll be happy to hear suggestions (on how to improve suggestions :D)!
    
    Resolves rust-lang#99272
    
    [`clippy::for_loops_over_fallibles`]: https://rust-lang.github.io/rust-clippy/master/index.html#for_loops_over_fallibles
    Dylan-DPC authored Oct 10, 2022
    Configuration menu
    Copy the full SHA
    5577e42 View commit details
    Browse the repository at this point in the history
  4. Rollup merge of rust-lang#102868 - compiler-errors:rename-assoc-tyali…

    …as-to-ty, r=TaKO8Ki
    
    Rename `AssocItemKind::TyAlias` to `AssocItemKind::Type`
    
    Thanks `@camsteffen` for catching this in ast too, cc rust-lang#102829 (comment)
    Dylan-DPC authored Oct 10, 2022
    Configuration menu
    Copy the full SHA
    1469e8d View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    178799f View commit details
    Browse the repository at this point in the history
  6. Auto merge of rust-lang#9610 - Jarcho:fix-9608, r=Alexendoo

    Don't suggest moving tuple structs with a significant drop to late evaluation
    
    fixes rust-lang#9608
    
    changelog: Don't suggest moving tuple structs with a significant drop to late evaluation
    bors committed Oct 10, 2022
    Configuration menu
    Copy the full SHA
    cf72565 View commit details
    Browse the repository at this point in the history
  7. Configuration menu
    Copy the full SHA
    c3f077c View commit details
    Browse the repository at this point in the history
  8. Configuration menu
    Copy the full SHA
    bd61fdb View commit details
    Browse the repository at this point in the history
  9. Configuration menu
    Copy the full SHA
    0cc7492 View commit details
    Browse the repository at this point in the history
  10. Configuration menu
    Copy the full SHA
    f48d13f View commit details
    Browse the repository at this point in the history

Commits on Oct 11, 2022

  1. Auto merge of rust-lang#9572 - Nilstrieb:as-ptr-cast-mut, r=dswij

    Add `as_ptr_cast_mut` lint
    
    This lint detects calls to a `&self`-taking `as_ptr` method, where the result is then immediately cast to a `*mut T`. Code like this is probably invalid, as that pointer will not have write permissions, and `*mut T` is usually used to write through.
    
    Examples of broken code with this pattern:
    https://miri.saethlin.dev/ub?crate=lol_alloc&version=0.1.3
    https://miri.saethlin.dev/ub?crate=sophon-wasm&version=0.19.0
    https://miri.saethlin.dev/ub?crate=polars-core&version=0.24.2
    https://miri.saethlin.dev/ub?crate=ach-cell&version=0.1.17
    
    changelog: Add [`as_ptr_cast_mut`]
    bors committed Oct 11, 2022
    Configuration menu
    Copy the full SHA
    8e87d39 View commit details
    Browse the repository at this point in the history
  2. Auto merge of rust-lang#9616 - unvalley:add-default-to-lint-groups, r…

    …=xFrednet
    
    Add Default to Clippy Lints Lint groups
    
    - related to rust-lang#7958
    
    This PR adds a default (reset) button to Clippy Lints Lint groups. (change for website)
    [The page](https://rust-lang.github.io/rust-clippy/master/index.html) sets only `Deprecated` to false by default.
    Certainly it is easy to set only `deprecated` to false, but it may be a bit lazy for beginners.
    
    https://user-images.githubusercontent.com/38400669/194831117-3ade7e0d-c4de-4189-9daf-3be8ea3cdd18.mov
    
    changelog: none
    bors committed Oct 11, 2022
    Configuration menu
    Copy the full SHA
    122ae22 View commit details
    Browse the repository at this point in the history
  3. Auto merge of rust-lang#9629 - est31:let_else, r=Jarcho

    Replace manual let else patterns with let else
    
    Clears the codebase from places where the lint added by rust-lang#8437 is firing, by adopting let else.
    
    changelog: none
    bors committed Oct 11, 2022
    Configuration menu
    Copy the full SHA
    854015c View commit details
    Browse the repository at this point in the history

Commits on Oct 12, 2022

  1. Configuration menu
    Copy the full SHA
    74ba7e1 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    ac6d2ba View commit details
    Browse the repository at this point in the history
  3. Auto merge of rust-lang#9605 - nyurik:fix-inline-edition, r=llogiq

    fix: uninlined_format_args shouldn't inline panic! before 2021ed
    
    Before 2021 edition, `panic!("...")` was not treated as a format string.
    Clippy autofix of `panic!("{}", foo)` into `panic!("{foo}")` is incorrect.
    
    changelog: [`uninlined_format_args`]: Do not inline panic! macros before 2021 edition
    bors committed Oct 12, 2022
    Configuration menu
    Copy the full SHA
    2d58817 View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    31006b4 View commit details
    Browse the repository at this point in the history
  5. add cast-nan-to-int lint

    llogiq committed Oct 12, 2022
    Configuration menu
    Copy the full SHA
    e4c80f2 View commit details
    Browse the repository at this point in the history
  6. Auto merge of rust-lang#9633 - royrustdev:fix_rc_buffer, r=llogiq

    update Applicability of `rc_buffer` lint from `MachineApplicable` to `Unspecified`
    
    `Unspecified`
    
    This changes `rc_buffer` from MachineApplicable to Unspecified
    
    ```
    changelog: change [`rc_buffer`] to Unspecified.
    ```
    
    fixes rust-lang#6241
    
    ---
    
    changelog: change [`rc_buffer`] to Unspecified.
    bors committed Oct 12, 2022
    Configuration menu
    Copy the full SHA
    6354d12 View commit details
    Browse the repository at this point in the history
  7. Auto merge of rust-lang#9617 - llogiq:cast-nan-to-int, r=Alexendoo

    add `cast-nan-to-int` lint
    
    This fixes rust-lang#371.
    
    r? `@Alexendoo`
    
    ---
    
    changelog: add [`cast-nan-to-int`] lint
    bors committed Oct 12, 2022
    Configuration menu
    Copy the full SHA
    b8a9a50 View commit details
    Browse the repository at this point in the history
  8. Configuration menu
    Copy the full SHA
    524ec2e View commit details
    Browse the repository at this point in the history
  9. Auto merge of rust-lang#9627 - Jarcho:ice-9625, r=xFrednet

    Use the correct type when comparing nested constants.
    
    fixes rust-lang#9625
    
    changelog: `manual_range_contains`: fix ICE when the values are behind a reference
    bors committed Oct 12, 2022
    Configuration menu
    Copy the full SHA
    45dd9f3 View commit details
    Browse the repository at this point in the history
  10. Configuration menu
    Copy the full SHA
    e51e930 View commit details
    Browse the repository at this point in the history
  11. refactor default_numeric_fallback

    We only need to store if the literal binding has an explicit type bound or not
    kraktus committed Oct 12, 2022
    Configuration menu
    Copy the full SHA
    36b2685 View commit details
    Browse the repository at this point in the history
  12. Fix to_string_in_format_args in parens

    Fix suggestions like
    
    ```
    print!("error: something failed at {}", (Location::caller().to_string()));
    ```
    
    where the parenthesis enclose some portion of the value.
    nyurik committed Oct 12, 2022
    Configuration menu
    Copy the full SHA
    7717904 View commit details
    Browse the repository at this point in the history
  13. Auto merge of rust-lang#9590 - nyurik:fix-parens, r=Alexendoo

    Fix to_string_in_format_args in parens
    
    Fix suggestions like
    
    ```
    print!("error: something failed at {}", (Location::caller().to_string()));
    ```
    
    where the parenthesis enclose some portion of the value.
    
    Fixes rust-lang#9540
    
    changelog: [`to_string_in_format_args`]: fix incorrect fix when value is enclosed in parenthesis
    bors committed Oct 12, 2022
    Configuration menu
    Copy the full SHA
    42bdfa2 View commit details
    Browse the repository at this point in the history

Commits on Oct 13, 2022

  1. Configuration menu
    Copy the full SHA
    124caeb View commit details
    Browse the repository at this point in the history
  2. Auto merge of rust-lang#9600 - nyurik:inline-fmt-style, r=llogiq

    Change uninlined_format_args into a style lint
    
    As [previously discussed](rust-lang/rust-clippy#9233 (comment)), the `uninlined_format_args` should probably be a part of the default style because `println!("{}", foo)` is not as concise or easy to understand as `println!("{foo}")`
    
    changelog: [`uninlined_format_args`]: change to be the default `style`
    bors committed Oct 13, 2022
    Configuration menu
    Copy the full SHA
    58ef56e View commit details
    Browse the repository at this point in the history
  3. Auto merge of rust-lang#9584 - royrustdev:implicit_saturating_sub, r=…

    …llogiq
    
    add tests in `implicit_saturating_sub` lint
    
    This adds more tests to the `implicit_saturating_sub` lint to rule out certain false positives that have appeared in the past.
    
    Now with those false positives out of the equation, we can move the lint to `style`.
    
    ---
    
    changelog: promote [`implicit-saturating-sub`] to the `style` category
    bors committed Oct 13, 2022
    Configuration menu
    Copy the full SHA
    fe3200c View commit details
    Browse the repository at this point in the history
  4. Auto merge of rust-lang#9640 - Alexendoo:edition-revisions, r=llogiq

    Fix edition revision ui tests
    
    rust-lang#9605 had me wondering how the edition revision tests were working for `manual_assert` but not for `@nyurik,` but it turns out `manual_assert`'s tests weren't working either. I checked how `rust-lang/rust` does it and apparently it comes down to whitespace, `//[rev] edition:X` works 😬
    
    Removes the revisions from `match_wild_err_arm` as I couldn't find any edition dependant behaviour there
    
    r? `@llogiq`
    
    changelog: none
    bors committed Oct 13, 2022
    Configuration menu
    Copy the full SHA
    4e89ffa View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    a31462a View commit details
    Browse the repository at this point in the history
  6. Auto merge of rust-lang#9641 - Alexendoo:sparse-registry, r=flip1995

    Enable cargo sparse registry in CI
    
    https://blog.rust-lang.org/2022/06/22/sparse-registry-testing.html
    
    The initial registry update takes around 1 minute currently, so this gives quite a nice speed boost to CI build times
    
    r? `@flip1995`
    
    changelog: none
    bors committed Oct 13, 2022
    Configuration menu
    Copy the full SHA
    9a6eca5 View commit details
    Browse the repository at this point in the history

Commits on Oct 14, 2022

  1. Configuration menu
    Copy the full SHA
    135a273 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    4f50e6f View commit details
    Browse the repository at this point in the history
  3. add missing comma

    hkBst authored Oct 14, 2022
    Configuration menu
    Copy the full SHA
    950f5fa View commit details
    Browse the repository at this point in the history
  4. Auto merge of rust-lang#9644 - hkBst:patch-1, r=flip1995

    add missing comma
    
    changelog: none
    bors committed Oct 14, 2022
    Configuration menu
    Copy the full SHA
    8e0da62 View commit details
    Browse the repository at this point in the history
  5. Auto merge of rust-lang#9643 - icecream17:patch-1, r=flip1995

    Book: Small grammar + link a11y change
    
    *Please write a short comment explaining your change (or "none" for internal only changes)*
    
    changelog: none
    
    ---
    
    Very minor
    
    For the link accessibility change, `here` and related don't provide context for screen readers who are reading a list of links.
    (Random supporting google links)
    https://www.w3.org/QA/Tips/noClickHere
    https://usability.yale.edu/web-accessibility/articles/links
    bors committed Oct 14, 2022
    Configuration menu
    Copy the full SHA
    efa361b View commit details
    Browse the repository at this point in the history
  6. Configuration menu
    Copy the full SHA
    344b7bc View commit details
    Browse the repository at this point in the history
  7. Auto merge of rust-lang#9645 - Jarcho:ptr_arg_9542, r=llogiq

    Don't lint `ptr_arg` when used as an incompatible trait object
    
    fixes rust-lang#9542
    changelog: [`ptr_arg`](https://rust-lang.github.io/rust-clippy/master/#ptr_arg): Don't lint when used as an incompatible trait object
    bors committed Oct 14, 2022
    Configuration menu
    Copy the full SHA
    b510557 View commit details
    Browse the repository at this point in the history
  8. Configuration menu
    Copy the full SHA
    4b8df8d View commit details
    Browse the repository at this point in the history

Commits on Oct 15, 2022

  1. Auto merge of rust-lang#9649 - Alexendoo:from-over-into-suggestion, r…

    …=llogiq
    
    Add a suggestion and a note about orphan rules for `from_over_into`
    
    Adds a machine applicable suggestion to convert the `Into` impl into a `From` one to `from_over_into`
    
    Also adds a note explaining that `impl From<Local> for Foreign` is fine if the `Into` type is foreign
    
    Closes rust-lang#7444
    Addresses half of rust-lang#9638
    
    changelog: [`from_over_into`] Add a suggestion and a note about orphan rules
    bors committed Oct 15, 2022
    Configuration menu
    Copy the full SHA
    50f192f View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    dfd3525 View commit details
    Browse the repository at this point in the history
  3. Move some things around

    smoelius committed Oct 15, 2022
    Configuration menu
    Copy the full SHA
    c84ac4c View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    8611a0b View commit details
    Browse the repository at this point in the history
  5. Fix adjacent code

    smoelius committed Oct 15, 2022
    Configuration menu
    Copy the full SHA
    2e5e356 View commit details
    Browse the repository at this point in the history
  6. Format affected files

    smoelius committed Oct 15, 2022
    Configuration menu
    Copy the full SHA
    5dc54c6 View commit details
    Browse the repository at this point in the history
  7. explicit_ty_bound code golf

    kraktus committed Oct 15, 2022
    Configuration menu
    Copy the full SHA
    d38175f View commit details
    Browse the repository at this point in the history
  8. Configuration menu
    Copy the full SHA
    2e3342a View commit details
    Browse the repository at this point in the history
  9. Configuration menu
    Copy the full SHA
    f8ae2f5 View commit details
    Browse the repository at this point in the history

Commits on Oct 16, 2022

  1. Auto merge of rust-lang#9655 - llogiq:unbox-default, r=dswij

    fix `box-default` linting `no_std` non-boxes
    
    This fixes rust-lang#9653 by doing the check against the `Box` type correctly even if `Box` isn't there, as in `no_std` code. Thanks to `@lukas-code` for opening the issue and supplying a reproducer!
    
    ---
    
    changelog: none
    bors committed Oct 16, 2022
    Configuration menu
    Copy the full SHA
    ff33d6e View commit details
    Browse the repository at this point in the history
  2. Auto merge of rust-lang#9636 - kraktus:numeric-fallback, r=dswij

    [`default_numeric_fallback`] do not lint on constants
    
    fix rust-lang/rust-clippy#9632
    
    changelog:[`default_numeric_fallback`] do not lint on constants
    bors committed Oct 16, 2022
    Configuration menu
    Copy the full SHA
    eba5ff9 View commit details
    Browse the repository at this point in the history
  3. Auto merge of rust-lang#9566 - smoelius:diagnostic-item-path, r=dswij

    Expand internal lint `unnecessary_def_path`
    
    This PR does essentially two things:
    * Separates the internal lints into modules by pass. (`internal_lints.rs` was over 1400 lines, which is a little unruly IMHO.)
    * ~Adds a new~ Expands the `unnecessary_def_path` internal lint to flag hardcoded paths to diagnostic and language items.
    
    My understanding is that the latter is currently done by reviewers. Automating this process should make things easier for both reviewers and contributors.
    
    I could make the first bullet a separate PR, or remove it entirely, if desired.
    
    changelog: Add internal lint `diagnostic_item_path`
    bors committed Oct 16, 2022
    Configuration menu
    Copy the full SHA
    332b5b3 View commit details
    Browse the repository at this point in the history
  4. Add new lint partial_pub_fields

    Signed-off-by: TennyZhuang <[email protected]>
    TennyZhuang committed Oct 16, 2022
    Configuration menu
    Copy the full SHA
    7ac97b6 View commit details
    Browse the repository at this point in the history
  5. fix dogfood

    Signed-off-by: TennyZhuang <[email protected]>
    TennyZhuang committed Oct 16, 2022
    Configuration menu
    Copy the full SHA
    b10882a View commit details
    Browse the repository at this point in the history
  6. add many tests

    Signed-off-by: TennyZhuang <[email protected]>
    TennyZhuang committed Oct 16, 2022
    Configuration menu
    Copy the full SHA
    abd5db3 View commit details
    Browse the repository at this point in the history
  7. fix a doctest

    Signed-off-by: TennyZhuang <[email protected]>
    TennyZhuang committed Oct 16, 2022
    Configuration menu
    Copy the full SHA
    360b48b View commit details
    Browse the repository at this point in the history
  8. Auto merge of rust-lang#9658 - TennyZhuang:partial-pub-fields, r=llogiq

    Add new lint `partial_pub_fields`
    
    Signed-off-by: TennyZhuang <[email protected]>
    
    *Please write a short comment explaining your change (or "none" for internal only changes)*
    
    changelog: `partial_pub_fields`: new lint to disallow partial fields of a struct be pub
    
    Resolve rust-lang#9604
    bors committed Oct 16, 2022
    Configuration menu
    Copy the full SHA
    d917590 View commit details
    Browse the repository at this point in the history
  9. Auto merge of rust-lang#9652 - kraktus:octo_89, r=xFrednet

    [`zero_prefixed_literal`] Do not advise to use octal form if not possible
    
    fix rust-lang/rust-clippy#9651
    
    changelog: [`zero_prefixed_literal`] Do not advise to use octal form if not possible
    bors committed Oct 16, 2022
    Configuration menu
    Copy the full SHA
    34142fd View commit details
    Browse the repository at this point in the history

Commits on Oct 17, 2022

  1. Auto merge of rust-lang#9609 - kraktus:hexa_f32, r=giraffate

    [`unnecessary_cast`] Do not lint negative hexadecimal literals when cast as floats
    
    fix rust-lang/rust-clippy#9603
    
    changelog: [`unnecessary_cast`] Do not lint negative hexadecimal literals when cast as floats
    bors committed Oct 17, 2022
    Configuration menu
    Copy the full SHA
    4eaf543 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    136c2cd View commit details
    Browse the repository at this point in the history
  3. Auto merge of rust-lang#9637 - Alexendoo:unused-format-specs, r=xFrednet

    Add `unused_format_specs` lint
    
    Currently catches two cases:
    
    An empty precision specifier:
    
    ```rust
    // the same as {}
    println!("{:.}", x);
    ```
    
    And using formatting specs on `format_args!()`:
    
    ```rust
    // prints `x.`, not `x    .`
    println("{:5}.", format_args!("x"));
    ```
    
    changelog: new lint: [`unused_format_specs`]
    bors committed Oct 17, 2022
    Configuration menu
    Copy the full SHA
    502e87c View commit details
    Browse the repository at this point in the history

Commits on Oct 19, 2022

  1. Update Applicability of redundant_allocation lint from

    `MachineApplicable` to `Unspecified`
    roynrishingha committed Oct 19, 2022
    Configuration menu
    Copy the full SHA
    1da1ff6 View commit details
    Browse the repository at this point in the history
  2. Auto merge of rust-lang#9634 - royrustdev:fix_redundant_allocation, r…

    …=Manishearth
    
    Update Applicability of `redundant_allocation` lint from `MachineApplicable` to `MaybeIncorrect`
    
    This changes `redundant_allocation` lint from MachineApplicable to MaybeIncorrect
    
    ```
    changelog: [`redundant_allocation]: Change Applicability from MachineApplicable to MaybeIncorrect
    
    ```
    
    fixes rust-lang#6243
    
    ---
    changelog: [`redundant_allocation`]: Change Applicability from MachineApplicable to MaybeIncorrect
    bors committed Oct 19, 2022
    Configuration menu
    Copy the full SHA
    1afc7e2 View commit details
    Browse the repository at this point in the history

Commits on Oct 20, 2022

  1. Configuration menu
    Copy the full SHA
    b6a860e View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    fb8ecb9 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    4ff2364 View commit details
    Browse the repository at this point in the history
  4. Auto merge of rust-lang#9680 - flip1995:rustup, r=flip1995

    Rustup
    
    r? `@ghost`
    
    I ran out of time and will have to do the Clippy->Rust sync tomorrow.
    
    changelog: none
    bors committed Oct 20, 2022
    Configuration menu
    Copy the full SHA
    a4e8726 View commit details
    Browse the repository at this point in the history
  5. Auto merge of rust-lang#9670 - Alexendoo:missing-trait-methods, r=Jarcho

    Add `missing_trait_methods` lint
    
    Closes rust-lang#9661
    
    changelog: new lint: [`missing_trait_methods`]
    bors committed Oct 20, 2022
    Configuration menu
    Copy the full SHA
    4612fdf View commit details
    Browse the repository at this point in the history
  6. Auto merge of rust-lang#9635 - smoelius:fix-9386-bug, r=Jarcho

    Fix bug introduced by rust-lang#9386
    
    rust-lang#9386 introduced a potential out-of-bounds array access. Specifically, a location returned by `local_assignments` could have  [`location.statement_index` equal to `mir.basic_blocks[location.block].statements.len()`](https://github.com/rust-lang/rust-clippy/blob/b8a9a507bf9e3149d287841454842116c72d66c4/clippy_utils/src/mir/mod.rs#L129), in which case the location would refer to the block terminator:
    https://github.com/rust-lang/rust-clippy/blob/b8a9a507bf9e3149d287841454842116c72d66c4/clippy_lints/src/dereference.rs#L1204-L1206
    I suspect the bug is not triggerable now, because of checks leading up to where it occurs. But a future code change could make it triggerable. Hence, it should be fixed.
    
    r? `@Jarcho`
    
    changelog: none
    bors committed Oct 20, 2022
    Configuration menu
    Copy the full SHA
    967f172 View commit details
    Browse the repository at this point in the history

Commits on Oct 21, 2022

  1. ref_option_ref do not lint when inner reference is mutable

    As it makes the `Option` Non Copy
    kraktus committed Oct 21, 2022
    Configuration menu
    Copy the full SHA
    615b761 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    487c6fc View commit details
    Browse the repository at this point in the history
  3. Auto merge of rust-lang#9685 - kraktus:collapsible_match, r=llogiq

    [`collapsible_match`] specify field name when destructuring structs
    
    changelog: [`collapsible_match`] specify field name when destructuring structs
    
    fix rust-lang/rust-clippy#9647
    
    I wasn't the sure about the best way to convey the message in the lint message since it does not use suggestion. Because I liked the former output highlighting both spans, I've left it as before, only modifying the span label.
    bors committed Oct 21, 2022
    Configuration menu
    Copy the full SHA
    b2e5a71 View commit details
    Browse the repository at this point in the history
  4. Auto merge of rust-lang#9684 - kraktus:ref_option_ref, r=xFrednet

    `ref_option_ref` do not lint when inner reference is mutable
    
    changelog: FP: [`ref_option_ref`]: No longer lints if the inner reference is mutable
    
    fix rust-lang/rust-clippy#9682
    bors committed Oct 21, 2022
    Configuration menu
    Copy the full SHA
    b72e451 View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    815876d View commit details
    Browse the repository at this point in the history

Commits on Oct 22, 2022

  1. Configuration menu
    Copy the full SHA
    5c6c353 View commit details
    Browse the repository at this point in the history
  2. Apply --fix fixes

    smoelius committed Oct 22, 2022
    Configuration menu
    Copy the full SHA
    e38bb1a View commit details
    Browse the repository at this point in the history
  3. Apply manual fixes

    smoelius committed Oct 22, 2022
    Configuration menu
    Copy the full SHA
    bbee1c9 View commit details
    Browse the repository at this point in the history
  4. Auto merge of rust-lang#9691 - smoelius:lint-lintcheck, r=llogiq

    Add `lintcheck` to packages linted by `dogfood` test
    
    Currently, `lintcheck` is not checked by the `dogfood` test. I assume that is not intentional. If it is intentional, then this PR can be ignored.
    
    changelog: Add `lintcheck` to packages linted by `dogfood` test
    bors committed Oct 22, 2022
    Configuration menu
    Copy the full SHA
    b62ef60 View commit details
    Browse the repository at this point in the history

Commits on Oct 23, 2022

  1. Auto merge of rust-lang#9688 - Alexendoo:msrv-tests, r=Manishearth

    Move MSRV tests into the lint specific test files
    
    There are currently two ways MSRV tests are done in the ui test suite, adding a case to the `#![clippy::msrv = "1.0"]` `tests/ui/min_rust_version_attr.rs` or adding the two `msrv_1_xx` functions to the test file of the lint in question
    
    This updates the clippy book to suggest the `msrv_1_xx` style, and replaces the tests in `tests/ui/min_rust_version_attr.rs` with ones of that style
    
    Almost the entire diff is just moving stuff around as a result, I made sure to check the line numbers the lints are emitted at correspond with the right `msrv` case, so feel free to only skim that part
    
    changelog: none
    bors committed Oct 23, 2022
    Configuration menu
    Copy the full SHA
    28cd1ec View commit details
    Browse the repository at this point in the history
  2. Auto merge of rust-lang#9622 - llogiq:box-dyn-default, r=Alexendoo

    fix `box-default` ignoring trait objects' types
    
    This avoids removing the turbofish when the `Box` type is a `dyn` or `impl _`.
    
    This fixes rust-lang#9621.
    
    ---
    
    changelog: none
    bors committed Oct 23, 2022
    Configuration menu
    Copy the full SHA
    4f142aa View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    da9755b View commit details
    Browse the repository at this point in the history