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

Merged
merged 123 commits into from
Sep 26, 2023
Merged

Clippy subtree update #116139

merged 123 commits into from
Sep 26, 2023

Commits on Sep 2, 2023

  1. Configuration menu
    Copy the full SHA
    26c0f97 View commit details
    Browse the repository at this point in the history
  2. Stabilize the Saturating type (saturating_int_impl, rust-langgh-87920)

    Also stabilizes saturating_int_assign_impl, rust-langgh-92354.
    
    And also make pub fns const where the underlying saturating_*
    fns became const in the meantime since the Saturating type was
    created.
    kellerkindt committed Sep 2, 2023
    Configuration menu
    Copy the full SHA
    1c27ba9 View commit details
    Browse the repository at this point in the history

Commits on Sep 4, 2023

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

Commits on Sep 5, 2023

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

Commits on Sep 7, 2023

  1. Use Freeze for SourceFile.lines

    Zoxc committed Sep 7, 2023
    Configuration menu
    Copy the full SHA
    0f74faf View commit details
    Browse the repository at this point in the history

Commits on Sep 8, 2023

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

Commits on Sep 10, 2023

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

Commits on Sep 11, 2023

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

Commits on Sep 12, 2023

  1. Configuration menu
    Copy the full SHA
    f598bb7 View commit details
    Browse the repository at this point in the history
  2. Auto merge of rust-lang#115689 - Alexendoo:clippy-doc-comments, r=not…

    …riddle,Manishearth,flip1995
    
    Reuse rustdoc's doc comment handling in Clippy
    
    Moves `source_span_for_markdown_range` and `span_of_attrs` (renamed to `span_of_fragments`) to `rustc_resolve::rustdoc` so it can be used in Clippy
    
    Fixes rust-lang/rust-clippy#10277
    Fixes rust-lang/rust-clippy#5593
    Fixes rust-lang/rust-clippy#10263
    Fixes rust-lang/rust-clippy#2581
    bors committed Sep 12, 2023
    Configuration menu
    Copy the full SHA
    b643f20 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    f136e16 View commit details
    Browse the repository at this point in the history
  4. Auto merge of rust-lang#11413 - jonboh:master, r=Alexendoo

    new unnecessary_map_on_constructor lint
    
    changelog: [`unnecessary_map_on_constructor`]: adds lint for cases in which map is not necessary. `Some(4).map(myfunction)` => `Some(myfunction(4))`
    
    Closes rust-lang/rust-clippy#6472
    
    Note that the case mentioned in the issue `Some(..).and_then(|..| Some(..))` is fixed by a chain of lint changes. This PR completes the last part of that chain.
    
    By `bind_instead_of_map`[lint](https://rust-lang.github.io/rust-clippy/master/index.html#/bind_instead_of_map):
    `Some(4).and_then(|x| Some(foo(4)))` => `Some(4).map(|x| foo)`
    
    By `redundant_closure` [lint](https://rust-lang.github.io/rust-clippy/master/index.html#/redundant_closure):
    `Some(4).map(|x| foo)` => `Some(4).map(fun)`
    
    Finally by this PR `unnecessary_map_on_constructor`:
    `Some(4).map(fun)` => `Some(fun(4))`
    
    I'm not sure this is the desired behavior for clippy and if it should be addressed in another issue/PR. I'd be up to give it a try if that's the case.
    bors committed Sep 12, 2023
    Configuration menu
    Copy the full SHA
    cb05701 View commit details
    Browse the repository at this point in the history
  5. Auto merge of rust-lang#11473 - Alexendoo:format-args-span-parents, r…

    …=dswij
    
    Ignore span's parents in `collect_ast_format_args`/`find_format_args`
    
    Fixes rust-lang#11470, covers some cases missed by rust-lang#10980
    
    Can't have a test yet because of rust-lang#11126 but it works locally
    
    changelog: none
    
    r? `@dswij`
    bors committed Sep 12, 2023
    Configuration menu
    Copy the full SHA
    b788add View commit details
    Browse the repository at this point in the history
  6. Configuration menu
    Copy the full SHA
    471469d View commit details
    Browse the repository at this point in the history

Commits on Sep 13, 2023

  1. Configuration menu
    Copy the full SHA
    7f87020 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    5cd391c View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    e3267b1 View commit details
    Browse the repository at this point in the history
  4. Remove derive_new test dependency

    It is the last thing depending on syn 1.0 in clippy
    Alexendoo committed Sep 13, 2023
    Configuration menu
    Copy the full SHA
    0c7dcba View commit details
    Browse the repository at this point in the history
  5. Auto merge of rust-lang#115790 - flip1995:clippyup, r=Manishearth

    Update Clippy
    
    r? `@Manishearth`
    bors committed Sep 13, 2023
    Configuration menu
    Copy the full SHA
    0698591 View commit details
    Browse the repository at this point in the history
  6. Auto merge of rust-lang#11452 - y21:issue11165, r=Centri3

    [`len_without_is_empty`]: follow type alias to find inherent `is_empty` method
    
    Fixes rust-lang#11165
    
    When we see an `impl B` and `B` is a type alias to some type `A`, then we need to follow the type alias to look for an `is_empty` method on the aliased type `A`. Before this PR, it'd get the inherent impls of `B`, which there aren't any and so it would warn that there isn't an `is_empty` method even if there was one.
    Passing the type alias `DefId` to `TyCtxt::type_of` gives us the aliased `DefId` (or simply return the type itself if it wasn't a type alias) so we can just use that
    
    changelog: [`len_without_is_empty`]: follow type alias to find inherent `is_empty` method
    bors committed Sep 13, 2023
    Configuration menu
    Copy the full SHA
    2009b58 View commit details
    Browse the repository at this point in the history

Commits on Sep 14, 2023

  1. Auto merge of rust-lang#11497 - Alexendoo:remove-derive-new, r=dswij

    Remove `derive_new` test dependency
    
    It is the last thing depending on syn 1.0 in clippy
    
    changelog: none
    bors committed Sep 14, 2023
    Configuration menu
    Copy the full SHA
    0273ed3 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    2aaaeb4 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    b2d5d68 View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    8d3bbb0 View commit details
    Browse the repository at this point in the history
  5. treat host effect params as erased generics in codegen

    This fixes the changes brought to codegen tests when effect params are
    added to libcore, by not attempting to monomorphize functions that get
    the host param by being `const fn`.
    fee1-dead committed Sep 14, 2023
    Configuration menu
    Copy the full SHA
    272df70 View commit details
    Browse the repository at this point in the history
  6. Configuration menu
    Copy the full SHA
    477a9b8 View commit details
    Browse the repository at this point in the history
  7. Auto merge of rust-lang#115817 - fee1-dead-contrib:fix-codegen, r=oli…

    …-obk
    
    treat host effect params as erased in codegen
    
    This fixes the changes brought to codegen tests when effect params are added to libcore, by not attempting to monomorphize functions that get the host param by being `const fn`.
    
    r? `@oli-obk`
    bors committed Sep 14, 2023
    Configuration menu
    Copy the full SHA
    eb545d7 View commit details
    Browse the repository at this point in the history
  8. Configuration menu
    Copy the full SHA
    c29de92 View commit details
    Browse the repository at this point in the history
  9. Auto merge of rust-lang#11444 - Alexendoo:find-format-args-lifetime-c…

    …rimes, r=flip1995
    
    Return a value from find_format_args instead of using a callback
    
    r? `@flip1995`
    
    changelog: none
    bors committed Sep 14, 2023
    Configuration menu
    Copy the full SHA
    b27fc10 View commit details
    Browse the repository at this point in the history
  10. Configuration menu
    Copy the full SHA
    da4244e View commit details
    Browse the repository at this point in the history
  11. Auto merge of rust-lang#115677 - matthewjasper:let-expr-recovery, r=b…

    …-naber
    
    Improve invalid let expression handling
    
    - Move all of the checks for valid let expression positions to parsing.
    - Add a field to ExprKind::Let in AST/HIR to mark whether it's in a valid location.
    - Suppress some later errors and MIR construction for invalid let expressions.
    - Fix a (drop) scope issue that was also responsible for rust-lang#104172.
    
    Fixes rust-lang#104172
    Fixes rust-lang#104868
    bors committed Sep 14, 2023
    Configuration menu
    Copy the full SHA
    9756a13 View commit details
    Browse the repository at this point in the history
  12. Configuration menu
    Copy the full SHA
    1d49cb6 View commit details
    Browse the repository at this point in the history
  13. don't point at const usage site for resolution-time errors

    also share the code that emits the actual error
    RalfJung committed Sep 14, 2023
    Configuration menu
    Copy the full SHA
    3226e4b View commit details
    Browse the repository at this point in the history
  14. Configuration menu
    Copy the full SHA
    a2a31a0 View commit details
    Browse the repository at this point in the history
  15. Configuration menu
    Copy the full SHA
    3c0fc15 View commit details
    Browse the repository at this point in the history
  16. Auto merge of rust-lang#11505 - Alexendoo:metadata-collector-truncate…

    …, r=Manishearth
    
    Truncate files when opening in metadata-collector
    
    Fixes the issue seen here rust-lang/rust-clippy#11483 (comment) and in a couple other PRs
    
    The changelog file was opened without truncating it, so if the new version is shorter than the old one stray contents would remain at the end of the file
    
    The other two files first removed the file so didn't have this problem, but in all cases we now use `fs::write`/`File::create` which is write + create + truncate
    
    changelog: none
    bors committed Sep 14, 2023
    Configuration menu
    Copy the full SHA
    6734e96 View commit details
    Browse the repository at this point in the history

Commits on Sep 15, 2023

  1. Configuration menu
    Copy the full SHA
    1d76eed View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    c9b212d View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    c81888e View commit details
    Browse the repository at this point in the history
  4. Auto merge of rust-lang#11504 - Alexendoo:type-lints-closures, r=xFre…

    …dnet
    
    Ignore closures for some type lints
    
    Fixes rust-lang#11417
    
    `hir_ty_to_ty` is used in a couple of the `!is_local` lints, which doesn't play nicely inside bodies
    
    changelog: none
    bors committed Sep 15, 2023
    Configuration menu
    Copy the full SHA
    2c629cc View commit details
    Browse the repository at this point in the history
  5. Auto merge of rust-lang#115851 - Alexendoo:clippy-doc-hidden-headers,…

    … r=flip1995
    
    Ignore `#[doc(hidden)]` functions in clippy doc lints
    
    Fixes rust-lang/rust-clippy#11501
    
    The implementation before rust-lang#115689 had a check for unsugared doc comments that also happened to catch `#[doc(hidden)]`, this adds the check back in more explicitly
    
    https://github.com/rust-lang/rust/blob/852bf4e51bf260550cd1a280d2146f1c0641b1e8/src/tools/clippy/clippy_lints/src/doc.rs#L526-L529
    
    r? `@flip1995`
    bors committed Sep 15, 2023
    Configuration menu
    Copy the full SHA
    2121629 View commit details
    Browse the repository at this point in the history
  6. Auto merge of rust-lang#11484 - mkrasnitski:fix-11302, r=Jarcho

    [`extra_unused_type_parameters`]: Fix edge case FP for parameters in where bounds
    
    Generic parameters can end up being used on the left side of where-bounds if they are not directly bound but instead appear nested in some concrete generic type. Therefore, we should walk the left side of where bounds, but only if the bounded type is *not* a generic param, in which case we still need to ignore the bound.
    
    Fixes rust-lang#11302
    
    changelog: [`extra_unused_type_parameters`]: Fix edge case false positive for parameters in where bounds
    bors committed Sep 15, 2023
    Configuration menu
    Copy the full SHA
    e609279 View commit details
    Browse the repository at this point in the history
  7. Auto merge of rust-lang#11506 - mojave2:issue-11503, r=giraffate

    fix filter_map_bool_then with a bool reference
    
    changelog: [`filter_map_bool_then`]: Fix the incorrect autofix when the `bool` in question is a reference.
    
    fix rust-lang#11503
    bors committed Sep 15, 2023
    Configuration menu
    Copy the full SHA
    eaf640d View commit details
    Browse the repository at this point in the history
  8. new lint: path_ends_with_ext

    y21 committed Sep 15, 2023
    Configuration menu
    Copy the full SHA
    981e960 View commit details
    Browse the repository at this point in the history
  9. Auto merge of rust-lang#11483 - y21:path_ends_with, r=Alexendoo

    new lint: `path_ends_with_ext`
    
    Closes rust-lang#11479
    
    Not sure if it needs more test cases. I couldn't come up with any other ones, but it is a pretty simple lint logic wise with not too many checks
    
    changelog: new lint: [`path_ends_with_ext`]
    bors committed Sep 15, 2023
    Configuration menu
    Copy the full SHA
    daadab5 View commit details
    Browse the repository at this point in the history
  10. add a test case

    kiscad committed Sep 15, 2023
    Configuration menu
    Copy the full SHA
    7426c83 View commit details
    Browse the repository at this point in the history
  11. Configuration menu
    Copy the full SHA
    fed036a View commit details
    Browse the repository at this point in the history

Commits on Sep 16, 2023

  1. Auto merge of rust-lang#11301 - y21:issue11300, r=dswij

    [`useless_conversion`]: don't lint if type parameter has unsatisfiable bounds for `.into_iter()` receiver
    
    Fixes rust-lang#11300.
    
    Before this PR, clippy assumed that if it sees a `f(x.into_iter())` call and the type at that argument position is generic over any `IntoIterator`, then the `.into_iter()` call must be useless because `x` already implements `IntoIterator`, *however* this assumption is not right if the generic parameter has more than just the `IntoIterator` bound (because other traits can be implemented for the IntoIterator target type but not the IntoIterator implementor, as can be seen in the linked issue: `<[i32; 3] as IntoIterator>::IntoIter` satisfies `ExactSizeIterator`, but `[i32; 3]` does not).
    
    So, this PR makes it check that the type parameter only has a single `IntoIterator` bound. It *might* be possible to check if the type of `x` in `f(x.into_iter())` satisfies all the bounds on the generic type parameter as defined on the function (which would allow removing the `.into_iter()` call even with multiple bounds), however I'm not sure how to do that, and the current fix should always work.
    
    **Edit:** This PR has been changed to check if any of the bounds don't hold for the type of the `.into_iter()` receiver, so we can still lint in some cases.
    
    changelog: [`useless_conversion`]: don't lint `.into_iter()` if type parameter has multiple bounds
    bors committed Sep 16, 2023
    Configuration menu
    Copy the full SHA
    59636a2 View commit details
    Browse the repository at this point in the history
  2. Auto merge of rust-lang#11507 - J-ZhengLi:issue11485, r=dswij

    trigger [`transmute_null_to_fn`] on chain of casts
    
    fixes: rust-lang#11485
    
    changelog: trigger [`transmute_null_to_fn`] on chain of casts
    bors committed Sep 16, 2023
    Configuration menu
    Copy the full SHA
    3f9db90 View commit details
    Browse the repository at this point in the history
  3. Auto merge of rust-lang#11509 - mojave2:issue-11502, r=llogiq

    fix FP of let_unit_value on async fn args
    
    changelog: [`let_unit_value`]: fix the FalsePostive on async fn arguments
    
    fix rust-lang#11502
    bors committed Sep 16, 2023
    Configuration menu
    Copy the full SHA
    f54275f View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    860e800 View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    2ec6f3b View commit details
    Browse the repository at this point in the history
  6. Update clippy_lints/src/matches/redundant_guards.rs

    fix typo
    
    Co-authored-by: Alejandra González <blyxyas@gmail.com>
    kiscad and blyxyas committed Sep 16, 2023
    Configuration menu
    Copy the full SHA
    67f0ba4 View commit details
    Browse the repository at this point in the history
  7. Configuration menu
    Copy the full SHA
    af2a847 View commit details
    Browse the repository at this point in the history
  8. 更新 cast_lossless.rs

    Co-authored-by: Timo <30553356+y21@users.noreply.github.com>
    kiscad and y21 committed Sep 16, 2023
    Configuration menu
    Copy the full SHA
    3cad623 View commit details
    Browse the repository at this point in the history
  9. Auto merge of rust-lang#11468 - mojave2:issue-11465, r=blyxyas

    add extra `byref` checking for the guard's local
    
    changelog: [`redundant_guards`]: Now checks if the variable is bound using `ref` before linting.
    
    The lint should not be emitted, when the local variable is bind by-ref in the pattern.
    
    fixes rust-lang#11465
    bors committed Sep 16, 2023
    Configuration menu
    Copy the full SHA
    ef73648 View commit details
    Browse the repository at this point in the history

Commits on Sep 17, 2023

  1. Configuration menu
    Copy the full SHA
    5b790ff View commit details
    Browse the repository at this point in the history
  2. Auto merge of rust-lang#11515 - y21:filter_map_bool_then_peel_refs, r…

    …=Jarcho
    
    [`filter_map_bool_then`]: include multiple derefs from adjustments
    
    In rust-lang#11506 this lint was improved to suggest one deref if the bool is behind references (fixed the FP rust-lang#11503), however it might need multiple dereferences if the bool is behind multiple layers of references or custom derefs. E.g. `&&&bool` needs `***b`.
    
    changelog: [`filter_map_bool_then`]: suggest as many dereferences as there are needed to get to the bool
    bors committed Sep 17, 2023
    Configuration menu
    Copy the full SHA
    7b5e019 View commit details
    Browse the repository at this point in the history
  3. Rollup merge of rust-lang#115477 - kellerkindt:stabilized_int_impl, r…

    …=dtolnay
    
    Stabilize the `Saturating` type
    
    Closes rust-lang#87920
    Closes rust-lang#92354
    
    Stabilization report rust-lang#87920 (comment)
    FCP rust-lang#87920 (comment)
    Dylan-DPC committed Sep 17, 2023
    Configuration menu
    Copy the full SHA
    66aa7f7 View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    3665a41 View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    558ae4c View commit details
    Browse the repository at this point in the history
  6. Configuration menu
    Copy the full SHA
    79247d9 View commit details
    Browse the repository at this point in the history
  7. Auto merge of rust-lang#11511 - Jarcho:split_borrow, r=llogiq

    Split `needless_borrow` into two lints
    
    Splits off the case where the borrow is used as a generic argument to a function. I think the two cases are different  enough to warrant a separate lint.
    
    The tests for the new lint have been reordered to group related parts together. Two warning have been dropped, one looked like it was testing the generic argument form, but it ends up triggering the auto-deref variant. The second was just a redundant test that didn't do anything interesting.
    
    An issue with cycle detection is also included. The old version was checking if a cycle was reachable from a block when it should have been checking if the block is part or a cycle.
    
    As a side note, I'm liking the style of just jamming all the tests into separate scopes in main.
    
    changelog: Split off `needless_borrows_for_generic_args` from `needless_borrow`
    bors committed Sep 17, 2023
    Configuration menu
    Copy the full SHA
    251a475 View commit details
    Browse the repository at this point in the history
  8. Configuration menu
    Copy the full SHA
    32d3387 View commit details
    Browse the repository at this point in the history
  9. Add redundant_as_str lint

    This lint checks for `as_str` on a `String` immediately followed by `as_bytes` or `is_empty` as those methods are available on `String` too. This could possibly also be extended to `&[u8]` in the future.
    Dev380 committed Sep 17, 2023
    Configuration menu
    Copy the full SHA
    1c9f3be View commit details
    Browse the repository at this point in the history
  10. Configuration menu
    Copy the full SHA
    01056c5 View commit details
    Browse the repository at this point in the history

Commits on Sep 18, 2023

  1. Auto merge of rust-lang#11523 - Alexendoo:used-underscore-bindings-li…

    …nt-levels, r=xFrednet
    
    used_underscore_bindings: respect lint levels on the binding definition
    
    Fixes rust-lang#11520
    Fixes rust-lang#947
    
    Also ignores usages of `PhantomData`
    
    changelog: none
    bors committed Sep 18, 2023
    Configuration menu
    Copy the full SHA
    c92de58 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    b06b915 View commit details
    Browse the repository at this point in the history
  3. Update remark CI deps

    Alexendoo committed Sep 18, 2023
    Configuration menu
    Copy the full SHA
    3251952 View commit details
    Browse the repository at this point in the history
  4. Auto merge of rust-lang#11531 - Alexendoo:remark-deps, r=flip1995

    Update remark CI deps
    
    [Remark v15](https://github.com/remarkjs/remark/releases/tag/15.0.0) was just released that needs a newer node version, this updates us to 18 (the current LTS)
    
    Also updates mdbook while we're at it
    
    changelog: none
    bors committed Sep 18, 2023
    Configuration menu
    Copy the full SHA
    ea16f81 View commit details
    Browse the repository at this point in the history
  5. Improve code readability by moving the retrieval of closures inside a…

    …sync functions right besides other closures handling.
    
    Add doc comment explaining what `MutablyUsedVariablesCtxt::prev_move_to_closure` is about.
    GuillaumeGomez committed Sep 18, 2023
    Configuration menu
    Copy the full SHA
    b8b420c View commit details
    Browse the repository at this point in the history
  6. Auto merge of rust-lang#11517 - mojave2:issue-11426, r=Alexendoo

    fix ICE by `u64::try_from(<u128>)`
    
    changelog: Fix the ICE in [`cast_possible_truncation`], when the `Shr` bits is larger than `u64::MAX`
    
    fix rust-lang#11426
    bors committed Sep 18, 2023
    Configuration menu
    Copy the full SHA
    4022591 View commit details
    Browse the repository at this point in the history
  7. Auto merge of rust-lang#115748 - RalfJung:post-mono, r=oli-obk

    move required_consts check to general post-mono-check function
    
    This factors some code that is common between the interpreter and the codegen backends into shared helper functions. Also as a side-effect the interpreter now uses the same `eval` functions as everyone else to get the evaluated MIR constants.
    
    Also this is in preparation for another post-mono check that will be needed for (the current hackfix for) rust-lang#115709: ensuring that all locals are dynamically sized.
    
    I didn't expect this to change diagnostics, but it's just cycle errors that change.
    
    r? `@oli-obk`
    bors committed Sep 18, 2023
    Configuration menu
    Copy the full SHA
    e9dc753 View commit details
    Browse the repository at this point in the history
  8. Configuration menu
    Copy the full SHA
    f2ab16e View commit details
    Browse the repository at this point in the history
  9. Configuration menu
    Copy the full SHA
    00ca47b View commit details
    Browse the repository at this point in the history
  10. Configuration menu
    Copy the full SHA
    367ba9c View commit details
    Browse the repository at this point in the history
  11. Configuration menu
    Copy the full SHA
    5224853 View commit details
    Browse the repository at this point in the history
  12. Configuration menu
    Copy the full SHA
    17d174d View commit details
    Browse the repository at this point in the history
  13. Configuration menu
    Copy the full SHA
    d9d25e9 View commit details
    Browse the repository at this point in the history
  14. Auto merge of rust-lang#11526 - Dev380:redundant-as-str, r=Manishearth

    Add redundant_as_str lint
    
    This lint checks for `as_str` on a `String` immediately followed by `as_bytes` or `is_empty` as those methods are available on `String` too. This could possibly also be extended to `&[u8]` in the future.
    
    changelog: New lint [`redundant_as_str`] rust-lang#11526
    bors committed Sep 18, 2023
    Configuration menu
    Copy the full SHA
    5cba09c View commit details
    Browse the repository at this point in the history
  15. Auto merge of rust-lang#11530 - Alexendoo:zero-ptr-file-location, r=b…

    …lyxyas
    
    Move zero_ptr to the casts module
    
    Also a bit of a touch up to the code while I was there
    
    changelog: none
    bors committed Sep 18, 2023
    Configuration menu
    Copy the full SHA
    889e1b9 View commit details
    Browse the repository at this point in the history

Commits on Sep 19, 2023

  1. move ConstValue into mir

    this way we have mir::ConstValue and ty::ValTree as reasonably parallel
    RalfJung committed Sep 19, 2023
    Configuration menu
    Copy the full SHA
    b30cefc View commit details
    Browse the repository at this point in the history

Commits on Sep 20, 2023

  1. Auto merge of rust-lang#11516 - mojave2:issue-11458, r=giraffate

    fix cast_lossless with macro call
    
    changelog: fix [`cast_lossless`] in the case when the cast operand is a macro call
    
    fix rust-lang#11458
    bors committed Sep 20, 2023
    Configuration menu
    Copy the full SHA
    f464149 View commit details
    Browse the repository at this point in the history
  2. Change default configuration of undocumented_unsafe_blocks

    This patch sets the two configuration options for
    `undocumented_unsafe_blocks` to `true` by default: these are
    `accept-comment-above-statement` and `accept-comment-above-attributes`.
    Having these values `false` by default prevents what many users would
    consider clean code, e.g. placing the `// SAFETY:` comment above a
    single-line functino call, rather than directly next to the argument.
    
    changelog: [`undocumented_unsafe_blocks`]: set
    `accept-comment-above-statement` and `accept-comment-above-attributes`
    to `true` by default.
    tgross35 committed Sep 20, 2023
    Configuration menu
    Copy the full SHA
    1b3e5dd View commit details
    Browse the repository at this point in the history
  3. Auto merge of rust-lang#11492 - GuillaumeGomez:async-fn-returned-clos…

    …ure, r=Centri3
    
    Fix mutaby used async function argument in closure for `needless_pass_by_ref_mut`
    
    Fixes rust-lang/rust-clippy#11380.
    
    The problem was that it needed to go through closures as well in async functions to correctly find the mutable usage of async function arguments.
    
    changelog: Correctly handle mutable usage of async function arguments in closures.
    
    r? `@Centri3`
    bors committed Sep 20, 2023
    Configuration menu
    Copy the full SHA
    ece3878 View commit details
    Browse the repository at this point in the history
  4. Auto merge of rust-lang#11170 - tgross35:undocumented-unsafe-blocks-d…

    …efaults, r=Centri3
    
    Change defaults of `accept-comment-above-statement` and `accept-comment-above-attributes`
    
    This patch sets the two configuration options for `undocumented_unsafe_blocks` to `true` by default: these are `accept-comment-above-statement` and `accept-comment-above-attributes`. Having these values `false` by default prevents what many users would consider clean code, e.g. placing the `// SAFETY:` comment above a single-line functino call, rather than directly next to the argument.
    
    This was originally discussed in rust-lang/rust-clippy#11162
    
    changelog: [`undocumented_unsafe_blocks`]: set
    `accept-comment-above-statement` and `accept-comment-above-attributes` to `true` by default.
    bors committed Sep 20, 2023
    Configuration menu
    Copy the full SHA
    ddbe110 View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    01c25a8 View commit details
    Browse the repository at this point in the history
  6. Auto merge of rust-lang#11522 - y21:redundant_guards_pat_lhs, r=giraf…

    …fate
    
    [`redundant_guards`]: lint if the pattern is on the left side
    
    A tiny improvement to the `redundant_guards` lint. There's no associated issue for this, just noticed it while going through the code.
    Right now it warns on `Some(x) if x == 2` and suggests `Some(2)`, but it didn't do that for `Some(x) if 2 == x` (i.e. when the local is on the right side and the pattern on the left side).
    
    changelog: [`redundant_guards`]: also lint if the pattern is on the left side
    bors committed Sep 20, 2023
    Configuration menu
    Copy the full SHA
    c556695 View commit details
    Browse the repository at this point in the history

Commits on Sep 21, 2023

  1. Configuration menu
    Copy the full SHA
    2ea6ac5 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    238dc28 View commit details
    Browse the repository at this point in the history
  3. Rollup merge of rust-lang#115972 - RalfJung:const-consistency, r=oli-obk

    rename mir::Constant -> mir::ConstOperand, mir::ConstKind -> mir::Const
    
    Also, be more consistent with the `to/eval_bits` methods... we had some that take a type and some that take a size, and then sometimes the one that takes a type is called `bits_for_ty`.
    
    Turns out that `ty::Const`/`mir::ConstKind` carry their type with them, so we don't need to even pass the type to those `eval_bits` functions at all.
    
    However this is not properly consistent yet: in `ty` we have most of the methods on `ty::Const`, but in `mir` we have them on `mir::ConstKind`. And indeed those two types are the ones that correspond to each other. So `mir::ConstantKind` should actually be renamed to `mir::Const`. But what to do with `mir::Constant`? It carries around a span, that's really more like a constant operand that appears as a MIR operand... it's more suited for `syntax.rs` than `consts.rs`, but the bigger question is, which name should it get if we want to align the `mir` and `ty` types? `ConstOperand`? `ConstOp`? `Literal`? It's not a literal but it has a field called `literal` so it would at least be consistently wrong-ish...
    
    ``@oli-obk`` any ideas?
    GuillaumeGomez committed Sep 21, 2023
    Configuration menu
    Copy the full SHA
    12815e9 View commit details
    Browse the repository at this point in the history
  4. Auto merge of rust-lang#11518 - mojave2:issue-11420, r=Alexendoo

    fix FP with needless_raw_string_hashes
    
    changelog: Fix [`needless_raw_string_hashes`]: Continue the lint checking of raw string when `needless_raw_strings` is allowed.
    
    fix rust-lang#11420
    bors committed Sep 21, 2023
    Configuration menu
    Copy the full SHA
    4d143d7 View commit details
    Browse the repository at this point in the history
  5. Auto merge of rust-lang#11544 - Alexendoo:hir-ty-to-ty, r=Jarcho

    Remove most usage of `hir_ty_to_ty`
    
    Removes the usages where there's a suitable query or the type was already available elsewhere. The remaining cases would all require more involved changes
    
    changelog: none
    
    r? `@Jarcho`
    bors committed Sep 21, 2023
    Configuration menu
    Copy the full SHA
    33f084e View commit details
    Browse the repository at this point in the history
  6. Configuration menu
    Copy the full SHA
    823bcb4 View commit details
    Browse the repository at this point in the history
  7. Configuration menu
    Copy the full SHA
    1fac304 View commit details
    Browse the repository at this point in the history

Commits on Sep 22, 2023

  1. Configuration menu
    Copy the full SHA
    74573fb View commit details
    Browse the repository at this point in the history
  2. Auto merge of rust-lang#114776 - fee1-dead-contrib:enable-effects-in-…

    …libcore, r=oli-obk
    
    Enable effects for libcore
    
    ~~r? `@oli-obk~~`
    
    forgot you are on vacation, oops
    bors committed Sep 22, 2023
    Configuration menu
    Copy the full SHA
    84917c8 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    5ee167e View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    85801f5 View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    f3a27d2 View commit details
    Browse the repository at this point in the history
  6. Auto merge of rust-lang#115696 - RalfJung:closure-ty-print, r=oli-obk

    adjust how closure/generator types are printed
    
    I saw `&[closure@$DIR/issue-20862.rs:2:5]` and I thought it is a slice type, because that's usually what `&[_]` is... it took me a while to realize that this is just a confusing printer and actually there's no slice. Let's use something that cannot be mistaken for a regular type.
    bors committed Sep 22, 2023
    Configuration menu
    Copy the full SHA
    835d7d9 View commit details
    Browse the repository at this point in the history
  7. added tests

    Meczka committed Sep 22, 2023
    Configuration menu
    Copy the full SHA
    ab51f66 View commit details
    Browse the repository at this point in the history
  8. Fix large_futures example

    The value used in the large_futures example was not large enough to
    trigger the lint given the default threshold.
    
    The example also contained more code than necessary.
    
    This PR changes the value size from 1kB to 16kB and reduces the example
    in size.
    mickvangelderen committed Sep 22, 2023
    Configuration menu
    Copy the full SHA
    7e46fb9 View commit details
    Browse the repository at this point in the history
  9. Auto merge of rust-lang#11551 - Meczka:fix-fp-needless-pass-by-ref-mu…

    …t, r=xFrednet
    
    fixed fp caused by moving &mut reference inside of a closure
    
    changelog: [`needless_pass_by_ref mut`]: fixes false positive caused by not covering mutable references passed to a closure inside of a fuction
    fixes rust-lang#11545
    bors committed Sep 22, 2023
    Configuration menu
    Copy the full SHA
    50139e6 View commit details
    Browse the repository at this point in the history
  10. Auto merge of rust-lang#11553 - mickvangelderen:fix-large-futures-exa…

    …mple, r=xFrednet
    
    Fix large_futures example
    
    The value used in the large_futures example was not large enough to trigger the lint given the default threshold. The example also contained more code than necessary. This PR changes the value size from 1kB to 16kB and reduces the example in size.
    
    changelog: [`large_futures`]: Fix and simplify example
    bors committed Sep 22, 2023
    Configuration menu
    Copy the full SHA
    d732cce View commit details
    Browse the repository at this point in the history

Commits on Sep 23, 2023

  1. Auto merge of rust-lang#116052 - oli-obk:ceci_nest_pas_une_query, r=W…

    …affleLapkin
    
    Add a way to decouple the implementation and the declaration of a TyCtxt method.
    
    properly addresses rust-lang#115819
    
    accepted MCP: rust-lang/compiler-team#395
    bors committed Sep 23, 2023
    Configuration menu
    Copy the full SHA
    3da69c7 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    0a2d39d View commit details
    Browse the repository at this point in the history
  3. Bless clippy.

    cjgillot committed Sep 23, 2023
    Configuration menu
    Copy the full SHA
    19e160f View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    e2669b2 View commit details
    Browse the repository at this point in the history

Commits on Sep 24, 2023

  1. add missing configuration tests

    y21 committed Sep 24, 2023
    Configuration menu
    Copy the full SHA
    6ce61d5 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    6e80db9 View commit details
    Browse the repository at this point in the history
  3. Auto merge of rust-lang#11560 - y21:ui-toml-tests, r=Alexendoo

    Add missing tests for configuration options
    
    I noticed that a lot of lints didn't have test(s) for their configuration. This leads to issues like rust-lang#11481 where the lint just does nothing with it.
    
    This PR adds tests for *almost*[^1] all of the lints with a configuration that didn't have a test in ui-toml.
    The tests that I wrote here are usually two cases: one for where it's right above or under the limit set by the config where it shouldn't lint and another one for right above where it should.
    
    changelog: none
    
    [^1]: allow-one-hash-in-raw-strings is ignored by needless_raw_string_hashes
    bors committed Sep 24, 2023
    Configuration menu
    Copy the full SHA
    94fc431 View commit details
    Browse the repository at this point in the history
  4. add ui-toml test

    jonboh committed Sep 24, 2023
    Configuration menu
    Copy the full SHA
    b3e262a View commit details
    Browse the repository at this point in the history
  5. use first instead of get(0)

    Co-authored-by: Timo <30553356+y21@users.noreply.github.com>
    jonboh and y21 committed Sep 24, 2023
    Configuration menu
    Copy the full SHA
    0433e45 View commit details
    Browse the repository at this point in the history
  6. Auto merge of rust-lang#11552 - jonboh:ice_threshold_0_enum_variants,…

    … r=y21
    
    prevent ice when threshold is 0 and enum has no variants
    
    changelog: [`enum_variant_names`]: prevent ice when threshold is 0 and enum has no variants
    
    r? `@y21`
    
    Fixes the same ice issue raised during review of rust-lang/rust-clippy#11496
    bors committed Sep 24, 2023
    Configuration menu
    Copy the full SHA
    aa137a7 View commit details
    Browse the repository at this point in the history

Commits on Sep 25, 2023

  1. Configuration menu
    Copy the full SHA
    81fe8dc View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    5eb7604 View commit details
    Browse the repository at this point in the history
  3. Fix dogfood fallout

    flip1995 committed Sep 25, 2023
    Configuration menu
    Copy the full SHA
    903add0 View commit details
    Browse the repository at this point in the history
  4. Auto merge of rust-lang#11563 - flip1995:rustup, r=flip1995

    Rustup
    
    r? `@ghost`
    
    changelog: none
    bors committed Sep 25, 2023
    Configuration menu
    Copy the full SHA
    7671c28 View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    3112e37 View commit details
    Browse the repository at this point in the history
  6. Update Cargo.lock

    flip1995 committed Sep 25, 2023
    Configuration menu
    Copy the full SHA
    6d331b7 View commit details
    Browse the repository at this point in the history