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

Clippy subtree update #117021

Merged
merged 70 commits into from
Oct 21, 2023
Merged

Clippy subtree update #117021

merged 70 commits into from
Oct 21, 2023

Commits on Sep 16, 2023

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

Commits on Sep 20, 2023

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

Commits on Oct 4, 2023

  1. Fix typo in attrs.rs

    documenation -> documentation
    eltociear authored Oct 4, 2023
    Configuration menu
    Copy the full SHA
    faacd55 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    31fd282 View commit details
    Browse the repository at this point in the history
  3. dogfood

    y21 committed Oct 4, 2023
    Configuration menu
    Copy the full SHA
    e6f29f1 View commit details
    Browse the repository at this point in the history

Commits on Oct 5, 2023

  1. Rename Features::active_features.

    The word "active" is currently used in two different and confusing ways:
    - `ACTIVE_FEATURES` actually means "available unstable features"
    - `Features::active_features` actually means "features declared in the
      crate's code", which can include feature within `ACTIVE_FEATURES` but
      also others.
    
    (This is also distinct from "enabled" features which includes declared
    features but also some edition-specific features automatically enabled
    depending on the edition in use.)
    
    This commit changes the `Features::active_features` to
    `Features::declared_features` which actually matches its meaning.
    Likewise, `Features::active` becomes `Features::declared`.
    nnethercote committed Oct 5, 2023
    Configuration menu
    Copy the full SHA
    010a9b1 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    9de3e6c View commit details
    Browse the repository at this point in the history

Commits on Oct 6, 2023

  1. Add regression test for rust-lang#11610 about mutable usage of argume…

    …nt in async function for the `needless_pass_by_ref_mut` lint
    GuillaumeGomez committed Oct 6, 2023
    Configuration menu
    Copy the full SHA
    ddd1564 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    8ebed4c View commit details
    Browse the repository at this point in the history
  3. Fix ice

    koka831 committed Oct 6, 2023
    Configuration menu
    Copy the full SHA
    68d2082 View commit details
    Browse the repository at this point in the history
  4. Auto merge of rust-lang#11623 - koka831:fix/11619, r=llogiq

    Fix ice in `redundant_locals`
    
    Fixes rust-lang#11619
    
    Rebinding over macro like the code below, idents will be different (`x#4` and `x#0` in that case).
    
    ```rust
    fn reassign_in_macro() {
      let x = 10;
      macro_rules! mac {
        ($i:ident) => {
          let mut x = x;
        }
      }
      mac!(y);
    }
    ```
    
    It causes unwrapping `None`.
    
    https://github.com/rust-lang/rust-clippy/blob/9554e477c29e6ddca9e5cdce71524341ef9d48e8/clippy_lints/src/redundant_locals.rs#L88-L98
    
    changelog: ICE: [`redundant_locals`]: No longer lints rebinding over macro
    bors committed Oct 6, 2023
    Configuration menu
    Copy the full SHA
    3662bd8 View commit details
    Browse the repository at this point in the history
  5. Rollup merge of rust-lang#116423 - eltociear:patch-22, r=flip1995

    Fix typo in attrs.rs
    
    documenation -> documentation
    matthiaskrgr authored Oct 6, 2023
    Configuration menu
    Copy the full SHA
    0ed398e View commit details
    Browse the repository at this point in the history

Commits on Oct 7, 2023

  1. Configuration menu
    Copy the full SHA
    bffba76 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    1c6fa29 View commit details
    Browse the repository at this point in the history
  3. Auto merge of rust-lang#11639 - y21:issue11635, r=llogiq

    [`into_iter_without_iter`]: walk up deref impl chain to find `iter` methods
    
    Fixes rust-lang#11635
    
    changelog: [`into_iter_without_iter`]: walk up deref impl chain to find `iter` methods
    bors committed Oct 7, 2023
    Configuration menu
    Copy the full SHA
    7624045 View commit details
    Browse the repository at this point in the history
  4. Auto merge of rust-lang#116437 - nnethercote:rustc_features, r=Nilstrieb

    Clean up `rustc_features`
    
    Plenty more to be done, but this is a decent start.
    
    r? `@Nilstrieb`
    bors committed Oct 7, 2023
    Configuration menu
    Copy the full SHA
    56400a0 View commit details
    Browse the repository at this point in the history
  5. Auto merge of rust-lang#11638 - samueltardieu:into-iter, r=Manishearth

    Fix two typos in lint description
    
    Fix rust-lang#11636
    
    changelog: none
    bors committed Oct 7, 2023
    Configuration menu
    Copy the full SHA
    33f49f3 View commit details
    Browse the repository at this point in the history

Commits on Oct 8, 2023

  1. Update ui_test to 0.21.2

    Alexendoo committed Oct 8, 2023
    Configuration menu
    Copy the full SHA
    850f2f5 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    5ed338d View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    7755737 View commit details
    Browse the repository at this point in the history
  4. Auto merge of rust-lang#11550 - blyxyas:fix-impl_trait_in_params-for_…

    …assocfn, r=dswij
    
    `impl_trait_in_params` now supports impls and traits
    
    Before this PR, the lint `impl_trait_in_params`. This PR gives the lint support for functions in impls and traits. (Also, some pretty heavy refactor)
    
    fixes rust-lang#11548
    changelog:[`impl_trait_in_params`] now supports `impl` blocks and functions in traits
    bors committed Oct 8, 2023
    Configuration menu
    Copy the full SHA
    bde0482 View commit details
    Browse the repository at this point in the history

Commits on Oct 9, 2023

  1. Auto merge of rust-lang#11645 - Alexendoo:ui_test, r=flip1995

    Update ui_test to 0.21.2
    
    Hopefully fixes rust-lang#11489
    
    r? `@flip1995`
    
    changelog: none
    bors committed Oct 9, 2023
    Configuration menu
    Copy the full SHA
    929a288 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    70b8d15 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    0b60531 View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    bba155e View commit details
    Browse the repository at this point in the history

Commits on Oct 10, 2023

  1. Rejig some top-level rustc_hir_pretty functions.

    There are several that are unused and can be removed.
    
    And there are some calls to `to_string`, which can be expressed more
    nicely as a `foo_to_string` call, and then `to_string` need not be
    `pub`. (This requires adding `pat_to_string`).
    nnethercote committed Oct 10, 2023
    Configuration menu
    Copy the full SHA
    359fa98 View commit details
    Browse the repository at this point in the history

Commits on Oct 12, 2023

  1. Rollup merge of rust-lang#116625 - nnethercote:rustc_hir_pretty, r=fe…

    …e1-dead
    
    `rustc_hir_pretty` cleanups
    
    Just some improvements I found while looking through this code.
    
    r? ``@fee1-dead``
    matthiaskrgr authored Oct 12, 2023
    Configuration menu
    Copy the full SHA
    0b8495b View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    b5488f9 View commit details
    Browse the repository at this point in the history
  3. Auto merge of rust-lang#11659 - aDotInTheVoid:hexdigit, r=Jarcho

    [`manual_is_ascii_check`]: Also check for `is_ascii_hexdigt`
    
    changelog: [`manual_is_ascii_check`]: Also check for `is_ascii_hexdigt`
    bors committed Oct 12, 2023
    Configuration menu
    Copy the full SHA
    ff00e9c View commit details
    Browse the repository at this point in the history

Commits on Oct 13, 2023

  1. Avoid panic!, omit instead

    koka831 committed Oct 13, 2023
    Configuration menu
    Copy the full SHA
    eb6fb18 View commit details
    Browse the repository at this point in the history
  2. add test for macro-in-loop

    koka831 committed Oct 13, 2023
    Configuration menu
    Copy the full SHA
    9fc717d View commit details
    Browse the repository at this point in the history
  3. Auto merge of rust-lang#11664 - koka831:fix/11134, r=blyxyas

    Fix/11134
    
    Fix rust-lang#11134
    
    Hir of `qpath` will be `TypeRelative(Ty { kind: Path(LangItem...` when a closure contains macro (e.g. rust-lang/rust-clippy#11651) and rust-lang#11134, it causes panic.
    This PR avoids panicking and emitting incomplete path string when `qpath` contains `LangItem`.
    
    changelog: none
    bors committed Oct 13, 2023
    Configuration menu
    Copy the full SHA
    c40359d View commit details
    Browse the repository at this point in the history
  4. Document conflicting lints

    c410-f3r committed Oct 13, 2023
    Configuration menu
    Copy the full SHA
    d179605 View commit details
    Browse the repository at this point in the history
  5. Address comment

    c410-f3r committed Oct 13, 2023
    Configuration menu
    Copy the full SHA
    8c0870d View commit details
    Browse the repository at this point in the history
  6. Configuration menu
    Copy the full SHA
    1ffd09a View commit details
    Browse the repository at this point in the history

Commits on Oct 14, 2023

  1. Make multiple_unsafe_ops_per_block ignore await desugaring

    The await desugaring contains two calls (`Poll::new_unchecked` and
    `get_context`) inside a single unsafe block. That violates the lint.
    Noratrieb committed Oct 14, 2023
    Configuration menu
    Copy the full SHA
    6ed04af View commit details
    Browse the repository at this point in the history

Commits on Oct 15, 2023

  1. Configuration menu
    Copy the full SHA
    bb6516a View commit details
    Browse the repository at this point in the history
  2. Auto merge of rust-lang#11609 - y21:get_first_non_primitives, r=giraf…

    …fate
    
    [`get_first`]: lint on non-primitive slices
    
    Fixes rust-lang#11594
    
    I left the issue open for a couple days before making the PR to see if anyone has something to say, but it looks like there aren't any objections to removing this check that prevented linting on non-primitive slices, so here's the PR now.
    There's a couple of instances in clippy itself where we now emit the lint. The actual relevant change is in the first commit and fixing the `.get(0)` instances in clippy itself is in the 2nd commit.
    
    changelog: [`get_first`]: lint on non-primitive slices
    bors committed Oct 15, 2023
    Configuration menu
    Copy the full SHA
    ef95be5 View commit details
    Browse the repository at this point in the history

Commits on Oct 16, 2023

  1. Auto merge of rust-lang#11514 - pitaj:triagebot_no-merges_exclude-tit…

    …les, r=flip1995
    
    triagebot no-merges: exclude "Rustup"s, add labels
    
    rust-lang/triagebot#1720
    
    changelog: none
    bors committed Oct 16, 2023
    Configuration menu
    Copy the full SHA
    ae52ee5 View commit details
    Browse the repository at this point in the history
  2. Auto merge of rust-lang#11666 - c410-f3r:dsadasewqasdsa, r=flip1995

    Document conflicting lints
    
    Documents the outcome described in rust-lang/rust-clippy#11662 so that the situation can be avoided in the future by other individuals.
    
    changelog: none
    bors committed Oct 16, 2023
    Configuration menu
    Copy the full SHA
    387d756 View commit details
    Browse the repository at this point in the history
  3. Now declare_interior_mutable_const and `borrow_interior_mutable_con…

    …st` respect the `ignore-interior-mutability` configuration entry
    
    changelog: Now `declare_interior_mutable_const` and `borrow_interior_mutable_const` respect the `ignore-interior-mutability` configuration entry
    Signed-off-by: slinkydeveloper <francescoguard@gmail.com>
    slinkydeveloper committed Oct 16, 2023
    Configuration menu
    Copy the full SHA
    3960bc0 View commit details
    Browse the repository at this point in the history
  4. Auto merge of rust-lang#11673 - y21:issue11672, r=Manishearth

    [`unnecessary_lazy_eval`]: reduce applicability if closure has return type annotation
    
    Fixes rust-lang#11672
    
    We already check if closure parameters don't have type annotations and reduce the applicability to `MaybeIncorrect` if they do, since those help type inference and removing them breaks code. We didn't do this for return type annotations however. This PR adds it. This doesn't change it to produce a fix that will compile, but it will prevent rustfix from auto-applying it.
    
    (In general I'm not sure if we can suggest a fix that will compile. In this specific example, it might be possible to suggest `&[] as &[u8]`, but as-casts won't always work, e.g. `Default::default() as &[u8]` is a compile error, so just reducing applicability should be a safe fix in any case for now)
    
    changelog: [`unnecessary_lazy_eval`]: reduce applicability to `MaybeIncorrect` if closure has return type annotation
    bors committed Oct 16, 2023
    Configuration menu
    Copy the full SHA
    9f27b15 View commit details
    Browse the repository at this point in the history

Commits on Oct 17, 2023

  1. Auto merge of rust-lang#11646 - Nilstrieb:compiler-does-not-comply-wi…

    …th-the-lints!!, r=giraffate
    
    Make `multiple_unsafe_ops_per_block` ignore await desugaring
    
    The await desugaring contains two calls (`Poll::new_unchecked` and `get_context`) inside a single unsafe block. That violates the lint.
    
    fixes rust-lang#11312
    
    changelog: [`multiple_unsafe_ops_per_block`]: fix false positives in `.await`
    bors committed Oct 17, 2023
    Configuration menu
    Copy the full SHA
    2cf708d View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    9ee26d0 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    09535a5 View commit details
    Browse the repository at this point in the history
  4. Auto merge of rust-lang#11622 - GuillaumeGomez:needless_pass_by_ref_m…

    …ut-regression-test-11610, r=blyxyas
    
    Add regression test for rust-lang#11610 about mutable usage of argument in async function for the `needless_pass_by_ref_mut` lint
    
    Fixes rust-lang/rust-clippy#11610.
    
    This was already fixed. I simply added a regression test.
    
    changelog: Add regression test for rust-lang#11610 about mutable usage of argument in async function for the `needless_pass_by_ref_mut` lint
    bors committed Oct 17, 2023
    Configuration menu
    Copy the full SHA
    2640d5c View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    bc97f7d View commit details
    Browse the repository at this point in the history
  6. Add test for needless_pass_by_ref_mut to ensure that the lint is no…

    …t emitted if variable is used in an unsafe block or function
    GuillaumeGomez committed Oct 17, 2023
    Configuration menu
    Copy the full SHA
    80a092c View commit details
    Browse the repository at this point in the history

Commits on Oct 18, 2023

  1. Configuration menu
    Copy the full SHA
    d9dc5ee View commit details
    Browse the repository at this point in the history
  2. add lint for struct field names

    side effect for `enum_variants`:
    use .first() instead of .get(0) in enum_variants lint
    move to_camel_case to str_util module
    move module, enum and struct name repetitions check to a single file `item_name_repetitions`
    rename enum_variants threshold config option
    jonboh committed Oct 18, 2023
    Configuration menu
    Copy the full SHA
    8b02dac View commit details
    Browse the repository at this point in the history
  3. Auto merge of rust-lang#11624 - GuillaumeGomez:needless_pass_by_ref_m…

    …ut-unsafe-fn-block, r=blyxyas
    
    Don't emit `needless_pass_by_ref_mut` if the variable is used in an unsafe block or function
    
    Fixes rust-lang/rust-clippy#11586.
    Fixes rust-lang/rust-clippy#11180.
    
    As suggested in the two issues above, this lint should not be emitted if this an unsafe function or if the argument is used in an unsafe block.
    
    changelog: [`needless_pass_by_ref_mut`]: Don't emit if the variable is used in an unsafe block or function
    bors committed Oct 18, 2023
    Configuration menu
    Copy the full SHA
    5fb312e View commit details
    Browse the repository at this point in the history
  4. Auto merge of rust-lang#11496 - jonboh:prefix_postfix_struct, r=y21

    add lint for struct field names
    
    changelog: [`struct_field_names`]: lint structs with the same pre/postfix in all fields or with fields that are pre/postfixed with the name of the struct.
    
    fixes rust-lang#2555
    
    I've followed general structure and naming from the code in [enum_variants](https://github.com/rust-lang/rust-clippy/blob/b788addfcc955368b9771b77d312c248fab60253/clippy_lints/src/enum_variants.rs) lint, which implements the same logic for enum variants.
    bors committed Oct 18, 2023
    Configuration menu
    Copy the full SHA
    fe21991 View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    ec2b8ab View commit details
    Browse the repository at this point in the history
  6. Configuration menu
    Copy the full SHA
    3b4b07c View commit details
    Browse the repository at this point in the history
  7. Configuration menu
    Copy the full SHA
    3e6db95 View commit details
    Browse the repository at this point in the history
  8. Configuration menu
    Copy the full SHA
    1528c1d View commit details
    Browse the repository at this point in the history
  9. Configuration menu
    Copy the full SHA
    a07c032 View commit details
    Browse the repository at this point in the history

Commits on Oct 19, 2023

  1. Auto merge of rust-lang#11683 - Alexendoo:msrv-config, r=Manishearth,…

    …flip1995
    
    Deserialize `Msrv` directly in `Conf`
    
    Gives the error a span pointing to the invalid config value
    
    Also puts `Conf` itself in the `OnceLock` rather than just the `Msrv` for [the `register_late_mod_pass` work](rust-lang#116731) since it will be used from two different callbacks
    
    changelog: none
    bors committed Oct 19, 2023
    Configuration menu
    Copy the full SHA
    9574d28 View commit details
    Browse the repository at this point in the history
  2. Auto merge of rust-lang#11621 - GuillaumeGomez:needless_pass_by_ref_m…

    …ut-closure-non-async-fn, r=blyxyas
    
    Needless pass by ref mut closure non async fn
    
    Fixes rust-lang/rust-clippy#11620.
    Fixes rust-lang/rust-clippy#11561.
    
    changelog: [`needless_pass_by_ref_mut`]: Correctly handle arguments moved into closure in non-async functions.
    
    r? `@Centri3`
    bors committed Oct 19, 2023
    Configuration menu
    Copy the full SHA
    cd477d4 View commit details
    Browse the repository at this point in the history
  3. Auto merge of rust-lang#115214 - Urgau:rfc-3127-trim-paths, r=compile…

    …r-errors
    
    Implement rustc part of RFC 3127 trim-paths
    
    This PR implements (or at least tries to) [RFC 3127 trim-paths](rust-lang#111540), the rustc part. That is `-Zremap-path-scope` with all of it's components/scopes.
    
    `@rustbot` label: +F-trim-paths
    bors committed Oct 19, 2023
    Configuration menu
    Copy the full SHA
    214b4d9 View commit details
    Browse the repository at this point in the history

Commits on Oct 20, 2023

  1. Auto merge of rust-lang#11521 - y21:issue9122, r=llogiq

    [`map_identity`]: allow closure with type annotations
    
    Fixes rust-lang#9122
    
    `.map(|a: u32| a)` can help type inference, so we should probably allow this and not warn about "unnecessary map of the identity function"
    
    changelog: [`map_identity`]: allow closure with type annotations
    bors committed Oct 20, 2023
    Configuration menu
    Copy the full SHA
    e230f19 View commit details
    Browse the repository at this point in the history
  2. Auto merge of rust-lang#11678 - slinkydeveloper:master, r=Alexendoo

    Now `declare_interior_mutable_const` and `borrow_interior_mutable_const` respect the `ignore-interior-mutability` configuration entry
    
    Fix rust-lang#10537
    
    changelog: Now `declare_interior_mutable_const` and `borrow_interior_mutable_const` respect the `ignore-interior-mutability` configuration entry
    bors committed Oct 20, 2023
    Configuration menu
    Copy the full SHA
    090df7a View commit details
    Browse the repository at this point in the history
  3. s/Generator/Coroutine/

    oli-obk committed Oct 20, 2023
    Configuration menu
    Copy the full SHA
    868e513 View commit details
    Browse the repository at this point in the history
  4. s/generator/coroutine/

    oli-obk committed Oct 20, 2023
    Configuration menu
    Copy the full SHA
    d9259fd View commit details
    Browse the repository at this point in the history

Commits on Oct 21, 2023

  1. Auto merge of rust-lang#11539 - taiki-e:enforced-import-renames, r=Ce…

    …ntri3
    
    Warn missing_enforced_import_renames by default
    
    Similar to rust-lang/rust-clippy#8261 that did the same thing to disallowed_methods & disallowed_types.
    This lint is also only triggered if import renames are defined in the `clippy.toml` file.
    
    changelog: Moved [`missing_enforced_import_renames`] to `style` (Now warn-by-default)
    [rust-lang#11539](rust-lang/rust-clippy#11539)
    bors committed Oct 21, 2023
    Configuration menu
    Copy the full SHA
    23af253 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    5f03156 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    a585cda View commit details
    Browse the repository at this point in the history
  4. Auto merge of rust-lang#11694 - flip1995:rustup, r=flip1995

    Rustup
    
    r? `@ghost`
    
    changelog: none
    bors committed Oct 21, 2023
    Configuration menu
    Copy the full SHA
    2b030eb View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    24b3554 View commit details
    Browse the repository at this point in the history
  6. Configuration menu
    Copy the full SHA
    b8b55fe View commit details
    Browse the repository at this point in the history