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

Merged
merged 77 commits into from
Jun 4, 2021
Merged

Update Clippy #85954

merged 77 commits into from
Jun 4, 2021

Commits on May 20, 2021

  1. Configuration menu
    Copy the full SHA
    97705b7 View commit details
    Browse the repository at this point in the history
  2. Early return from LintPass registration when collecting metadata

    This speeds up the metadata collection by 2-2.5x on my machine. During
    metadata collection other lint passes don't have to be registered, only
    the lints themselves.
    flip1995 committed May 20, 2021
    Configuration menu
    Copy the full SHA
    7304829 View commit details
    Browse the repository at this point in the history
  3. Auto merge of rust-lang#7253 - flip1995:shrink-monster, r=xFrednet

    Early return from LintPass registration when collecting metadata
    
    This speeds up the metadata collection by 2-2.5x on my machine. During
    metadata collection other lint passes don't have to be registered, only
    the lints themselves.
    
    cc rust-lang#7172
    
    r? `@xFrednet`
    
    changelog: none
    bors committed May 20, 2021
    Configuration menu
    Copy the full SHA
    60826e7 View commit details
    Browse the repository at this point in the history
  4. Remove fix for rustc bug from needless_borrow

    The spans given for derived traits used to not indicate they were from a macro expansion.
    Jarcho committed May 20, 2021
    Configuration menu
    Copy the full SHA
    6e03a30 View commit details
    Browse the repository at this point in the history
  5. Improve needless_borrow lint

    Suggest changing usages of ref bindings to match the new type
    Split out some cases into new lint `ref_binding_to_reference`
    Jarcho committed May 20, 2021
    Configuration menu
    Copy the full SHA
    6d4dc35 View commit details
    Browse the repository at this point in the history
  6. Configuration menu
    Copy the full SHA
    2eafec1 View commit details
    Browse the repository at this point in the history
  7. Configuration menu
    Copy the full SHA
    e3a1ae7 View commit details
    Browse the repository at this point in the history
  8. Configuration menu
    Copy the full SHA
    31b97ea View commit details
    Browse the repository at this point in the history

Commits on May 21, 2021

  1. Auto merge of rust-lang#7258 - YohDeadfall:update-copyrights, r=Manis…

    …hearth
    
    Updated years in copyrigths
    
    This PR just updates years in copyrights, nothing more.
    
    changelog: none
    bors committed May 21, 2021
    Configuration menu
    Copy the full SHA
    853f593 View commit details
    Browse the repository at this point in the history
  2. Auto merge of rust-lang#7105 - Jarcho:needless_borrow_pat, r=camsteffen

    fix `needless_borrow` suggestion
    
    fixes: rust-lang#2610
    
    While I'm working on this, should needless_borrow be split into two? One lint for expressions and another for patterns. In expression it only lints when the compiler inserts a dereference, but for patterns it's whenever a double reference is created. I think at least the case where a double reference is needed should be split into a new lint as it's not 'needless', it can just be done without a ref binding.
    
    For illustration:
    
    ```rust
    fn foo(x: &&str) {}
    
    match Some("test") {
        // ref binding is useless here
        Some(ref x) => *x,
        _ => (),
    }
    
    match Some("test") {
        // ref binding is useless here
        Some(ref x) => x.len(),
        _ => (),
    }
    
    match Some("test") {
        // double reference is needed, but could be `Some(x) => foo(&x)`
        Some(ref x) => foo(x),
        _ => (),
    }
    ```
    
    changelog: Improve the suggestion for `needless_borrow` in patterns to change all usage sites as needed.
    changelog: Add lint `ref_binding_to_reference`
    bors committed May 21, 2021
    Configuration menu
    Copy the full SHA
    029c326 View commit details
    Browse the repository at this point in the history
  3. Move needless_borrow to style

    Jarcho committed May 21, 2021
    Configuration menu
    Copy the full SHA
    f355aeb View commit details
    Browse the repository at this point in the history
  4. Auto merge of rust-lang#7254 - Jarcho:needless_borrow_2, r=Manishearth

    Move `needless_borrow` to style
    
    fixes: rust-lang#3742
    
    rust-lang#7105 should be merged first to fix the false positive.
    
    changelog: move `needless_borrow` from `nursery` to `style`
    bors committed May 21, 2021
    Configuration menu
    Copy the full SHA
    f694f85 View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    60dd2b6 View commit details
    Browse the repository at this point in the history

Commits on May 22, 2021

  1. Configuration menu
    Copy the full SHA
    ae0d4da View commit details
    Browse the repository at this point in the history
  2. Auto merge of rust-lang#7263 - Jarcho:redundant_closure_macro, r=llogiq

    Fix `redundant_closure` for `vec![]` macro in a closure with arguments
    
    fixes: rust-lang#7224
    changelog: Fix `redundant_closure` for `vec![]` macro in a closure with arguments
    bors committed May 22, 2021
    Configuration menu
    Copy the full SHA
    8787186 View commit details
    Browse the repository at this point in the history
  3. Auto merge of rust-lang#7264 - yotamofek:from_iter_instead_collect_as…

    …_trait, r=llogiq
    
    Fix invalid syntax in `from_iter_instead_of_collect` suggestion
    
    First attempt at contributing, hopefully this is a good start and can be improved. :)
    
    fixes rust-lang#7259
    
    changelog: [`from_iter_instead_of_collect`] fix invalid suggestion involving "as Trait"
    bors committed May 22, 2021
    Configuration menu
    Copy the full SHA
    297e743 View commit details
    Browse the repository at this point in the history

Commits on May 24, 2021

  1. Auto merge of rust-lang#7255 - whatisaphone:feat/similar-names-wparam…

    …-lparam, r=giraffate
    
    Allow wparam and lparam in similar_names
    
    `wparam` and `lparam` are often used as generic parameter names in win32 (for example [WindowProc](https://docs.microsoft.com/en-us/previous-versions/windows/desktop/legacy/ms633573(v=vs.85))). This PR adds them to the similar_names exception list.
    
    changelog: [`similar_names`] don't treat wparam and lparam as similar
    bors committed May 24, 2021
    Configuration menu
    Copy the full SHA
    41bb092 View commit details
    Browse the repository at this point in the history
  2. Downgrade suspicious_op..._groupings to Nursery

    This addresses rust-lang#6722.
    Michael Wright committed May 24, 2021
    Configuration menu
    Copy the full SHA
    2f78d57 View commit details
    Browse the repository at this point in the history
  3. Auto merge of rust-lang#7266 - mikerite:20210524_sus_nursery, r=giraf…

    …fate
    
    Downgrade suspicious_op..._groupings to Nursery
    
    This addresses rust-lang#6722.
    
    changelog: Downgrade [`suspicious_lint_operations`] to Nursery
    bors committed May 24, 2021
    Configuration menu
    Copy the full SHA
    c25f4b4 View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    e027b6b View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    27ac647 View commit details
    Browse the repository at this point in the history
  6. Use FxHasher

    camsteffen committed May 24, 2021
    Configuration menu
    Copy the full SHA
    f21d909 View commit details
    Browse the repository at this point in the history
  7. Use UnhashMap

    camsteffen committed May 24, 2021
    Configuration menu
    Copy the full SHA
    24743b3 View commit details
    Browse the repository at this point in the history
  8. Configuration menu
    Copy the full SHA
    0ebd501 View commit details
    Browse the repository at this point in the history
  9. remove cfg(bootstrap)

    pietroalbini authored and Mark-Simulacrum committed May 24, 2021
    Configuration menu
    Copy the full SHA
    91aa821 View commit details
    Browse the repository at this point in the history
  10. Configuration menu
    Copy the full SHA
    9d61b4e View commit details
    Browse the repository at this point in the history
  11. Hash Symbol directly

    camsteffen committed May 24, 2021
    Configuration menu
    Copy the full SHA
    7f34057 View commit details
    Browse the repository at this point in the history
  12. Auto merge of rust-lang#7267 - camsteffen:sphash-improvements, r=Mani…

    …shearth
    
    Some SpanlessHash improvements
    
    changelog: none
    
    * Use `mem::discriminant().hash()` instead of `stable_hash` for simple enums and then use `FxHasher` instead of `StableHasher`. We don't use any StableHash features.
    * Use `UnHashMap` for maps keyed by spanless hash values.
    bors committed May 24, 2021
    Configuration menu
    Copy the full SHA
    a248648 View commit details
    Browse the repository at this point in the history
  13. Configuration menu
    Copy the full SHA
    1ac7e19 View commit details
    Browse the repository at this point in the history

Commits on May 25, 2021

  1. Configuration menu
    Copy the full SHA
    cadad20 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    527fb42 View commit details
    Browse the repository at this point in the history
  3. Fix same_item_push.rs

    mbartlett21 committed May 25, 2021
    Configuration menu
    Copy the full SHA
    6d73777 View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    9cad27f View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    0c017ea View commit details
    Browse the repository at this point in the history
  6. Run cargo fmt

    mbartlett21 committed May 25, 2021
    Configuration menu
    Copy the full SHA
    bcebea6 View commit details
    Browse the repository at this point in the history
  7. Auto merge of rust-lang#7268 - mbartlett21:update_semi, r=Manishearth

    Move `semicolon_if_nothing_returned` to `pedantic`
    
    This moves the `semicolon_if_nothing_returned` lint to `pedantic` category.
    I had done rust-lang#7148, but on the master branch, and Github doesn't seem to let me change that, so here's another PR
    
    changelog: Move [`semicolon_if_nothing_returned`] lint into `pedantic` category.
    bors committed May 25, 2021
    Configuration menu
    Copy the full SHA
    cd4abf9 View commit details
    Browse the repository at this point in the history
  8. Auto merge of rust-lang#7256 - xFrednet:7172-trick-cargos-caching-for…

    …-collection, r=flip1995
    
    Adding the ability to invalidate caches to force metadata collection
    
    This adds the discussed hack to touch `clippy_lints/src/lib.rs` to invalidate cargos cache and force metadata collection. I've decided to use the [`filetime`](https://github.com/alexcrichton/filetime) crate instead of the touch command to make is cross-platform and just cleaner in general. Looking at the maintainers I would say that it's a save crate to use xD.
    
    ---
    
    cc: rust-lang#7172 I know this ID without looking it up now... This is not good
    
    changelog: none
    
    r? `@flip1995`
    bors committed May 25, 2021
    Configuration menu
    Copy the full SHA
    6d50cff View commit details
    Browse the repository at this point in the history

Commits on May 26, 2021

  1. Add macro_use clippy_utils

    camsteffen committed May 26, 2021
    Configuration menu
    Copy the full SHA
    5cc6635 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    c21b965 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    2e2021b View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    d7f47f2 View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    ee79077 View commit details
    Browse the repository at this point in the history
  6. Configuration menu
    Copy the full SHA
    3d77a2b View commit details
    Browse the repository at this point in the history
  7. Configuration menu
    Copy the full SHA
    1ce581d View commit details
    Browse the repository at this point in the history
  8. Configuration menu
    Copy the full SHA
    55ccc7a View commit details
    Browse the repository at this point in the history
  9. Configuration menu
    Copy the full SHA
    c51472b View commit details
    Browse the repository at this point in the history
  10. Eat dogfood

    camsteffen committed May 26, 2021
    Configuration menu
    Copy the full SHA
    7dd356d View commit details
    Browse the repository at this point in the history
  11. Auto merge of rust-lang#7280 - camsteffen:macro-use, r=Manishearth

    Add macro_use clippy_utils
    
    changelog: none
    bors committed May 26, 2021
    Configuration menu
    Copy the full SHA
    f205dd1 View commit details
    Browse the repository at this point in the history

Commits on May 27, 2021

  1. Add deprecated lint tests

    camsteffen committed May 27, 2021
    Configuration menu
    Copy the full SHA
    3af9584 View commit details
    Browse the repository at this point in the history
  2. Fix config file lookup

    camsteffen committed May 27, 2021
    Configuration menu
    Copy the full SHA
    6eea598 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    f3e77a4 View commit details
    Browse the repository at this point in the history
  4. Auto merge of rust-lang#7187 - camsteffen:avoid-break-exported, r=fli…

    …p1995,phansch
    
    Add avoid_breaking_exported_api config option
    
    changelog: Add `avoid_breaking_exported_api` config option for [`enum_variant_names`], [`large_types_passed_by_value`], [`trivially_copy_pass_by_ref`], [`unnecessary_wraps`], [`upper_case_acronyms`] and [`wrong_self_convention`].
    
    changelog: Deprecates [`pub_enum_variant_names`] and [`wrong_pub_self_convention`] as the non-pub variants are now configurable.
    
    changelog: Fix various false negatives for `pub` items that are not exported from the crate.
    
    A couple changes to late passes in order to use `cx.access_levels.is_exported` rather than `item.vis.kind.is_pub`.
    
    I'm not sure how to better document the config option or lints that are (not) affected (see comments in rust-lang#6806). Suggestions are welcome. cc `@rust-lang/clippy`
    
    I added `/clippy.toml` to use the config internally and `/tests/clippy.toml` to maintain a default config in ui tests.
    
    Closes rust-lang#6806
    Closes rust-lang#4504
    bors committed May 27, 2021
    Configuration menu
    Copy the full SHA
    9c4651f View commit details
    Browse the repository at this point in the history
  5. Auto merge of rust-lang#7282 - camsteffen:lint-stmt-expr, r=flip1995

    Fix allow on some statement lints
    
    changelog: Fix `#[allow(..)]` over statements for [`needless_collect`], [`short_circuit_statement`] and [`unnecessary_operation`]
    
    Fixes rust-lang#7171
    Fixes rust-lang#7202
    bors committed May 27, 2021
    Configuration menu
    Copy the full SHA
    8066f83 View commit details
    Browse the repository at this point in the history
  6. Auto merge of rust-lang#7281 - camsteffen:has-doc-fp, r=flip1995

    Fix missing_docs_in_private_items false negative
    
    changelog: Fix [`missing_docs_in_private_items`] false negative when the item has any `#[name = "value"]` attribute
    
    Closes rust-lang#7247 (decided not to use the rustc method since it calls `Session::check_name`, which is for rustc only)
    bors committed May 27, 2021
    Configuration menu
    Copy the full SHA
    2fa9362 View commit details
    Browse the repository at this point in the history
  7. Configuration menu
    Copy the full SHA
    8d42288 View commit details
    Browse the repository at this point in the history
  8. Auto merge of rust-lang#7283 - flip1995:release-doc, r=giraffate

    Document to only push the created tag and not everything
    
    Inspired by https://stackoverflow.com/a/5195913
    
    changelog: none
    bors committed May 27, 2021
    Configuration menu
    Copy the full SHA
    5cb49bc View commit details
    Browse the repository at this point in the history
  9. Configuration menu
    Copy the full SHA
    d39a11c View commit details
    Browse the repository at this point in the history
  10. Auto merge of rust-lang#7284 - camsteffen:consts-reexport, r=flip1995

    Remove clippy_utils::consts re-export
    
    changelog: none
    
    We got a straggler.
    bors committed May 27, 2021
    Configuration menu
    Copy the full SHA
    16e347f View commit details
    Browse the repository at this point in the history
  11. Configuration menu
    Copy the full SHA
    6c54f61 View commit details
    Browse the repository at this point in the history
  12. Auto merge of rust-lang#7285 - camsteffen:mini-macro-move, r=flip1995

    Move mini-macro to tests/ui/auxilary
    
    changelog: none
    
    Merges `/mini-macro` into `/tests/ui/auxilary/proc_macro_derive.rs`.
    
    The mini-macro crate is an artifact of the distant past. A lot has changed (rust-lang#2284) and it doesn't make sense as a top-level crate anymore. Especially since we can use the auxilary folder to accompolish the same thing.
    bors committed May 27, 2021
    Configuration menu
    Copy the full SHA
    543a8a6 View commit details
    Browse the repository at this point in the history

Commits on May 28, 2021

  1. Configuration menu
    Copy the full SHA
    4ba6afd View commit details
    Browse the repository at this point in the history
  2. Auto merge of rust-lang#7287 - Jarcho:ice_7272, r=flip1995

    Fix ICE in `too_many_lines`
    
    fixes: rust-lang#7272
    fixes: rust-lang#7286
    
    rust-lang#7272 looks like it's caused by a bug in rust-c. The span it's giving for the closure is:
    
    ```rust
    $crate:: $lower($d arg) }
            }
        }
    }
    ```
    
    The correct span would be `$crate:: $lower($d arg)` without all the closing braces.
    
    rust-lang#7286 is definitely a clippy bug
    
    changelog: none
    bors committed May 28, 2021
    Configuration menu
    Copy the full SHA
    5cdba7d View commit details
    Browse the repository at this point in the history

Commits on May 30, 2021

  1. Add lint suspicious_splitn

    Jarcho committed May 30, 2021
    Configuration menu
    Copy the full SHA
    898b6a0 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    5fa08ea View commit details
    Browse the repository at this point in the history
  3. Auto merge of rust-lang#7292 - Jarcho:suspicious_splitn, r=flip1995

    Add lint `suspicious_splitn`
    
    fixes: rust-lang#7245
    changelog: Add lint `suspicious_splitn`
    bors committed May 30, 2021
    Configuration menu
    Copy the full SHA
    d1308ae View commit details
    Browse the repository at this point in the history

Commits on May 31, 2021

  1. Configuration menu
    Copy the full SHA
    58491d3 View commit details
    Browse the repository at this point in the history
  2. Auto merge of rust-lang#7294 - stevenengler:unsafe-ptr-deref-msg, r=M…

    …anishearth
    
    Improve message for `not_unsafe_ptr_arg_deref` lint
    
    changelog: Improved message for the ['not_unsafe_ptr_arg_deref'] lint
    
    Doesn't close any issue, but implements a suggestion from rust-lang/rust-clippy#3045 (comment).
    bors committed May 31, 2021
    Configuration menu
    Copy the full SHA
    860cb8f View commit details
    Browse the repository at this point in the history
  3. Add lint manual_str_repeat

    Jarcho committed May 31, 2021
    Configuration menu
    Copy the full SHA
    97311f0 View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    cfddf09 View commit details
    Browse the repository at this point in the history
  5. Remove util/cov.sh script

    This script hasn't been working and wasn't used for years.
    flip1995 committed May 31, 2021
    Configuration menu
    Copy the full SHA
    f49251a View commit details
    Browse the repository at this point in the history

Commits on Jun 1, 2021

  1. Auto merge of rust-lang#7265 - Jarcho:manual_str_repeat, r=giraffate

    Add lint `manual_str_repeat`
    
    fixes: rust-lang#7260
    
    There's a similar function for slices. Should this be renamed to include it, or should that be a separate lint? If we are going to have them as one lint a better name will be needed. `manual_repeat` isn't exactly clear as it's replacing a call to `iter::repeat`.
    
    changelog: Add new lint `manual_str_repeat`
    bors committed Jun 1, 2021
    Configuration menu
    Copy the full SHA
    ca570f9 View commit details
    Browse the repository at this point in the history
  2. Auto merge of rust-lang#7297 - flip1995:rm-cov, r=giraffate

    Remove util/cov.sh script
    
    This script hasn't been working and wasn't used for years.
    
    changelog: none
    bors committed Jun 1, 2021
    Configuration menu
    Copy the full SHA
    cf5f894 View commit details
    Browse the repository at this point in the history

Commits on Jun 3, 2021

  1. Configuration menu
    Copy the full SHA
    531bfc8 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    ab8bede View commit details
    Browse the repository at this point in the history
  3. Auto merge of rust-lang#7313 - flip1995:rustup, r=flip1995

    Rustup
    
    Empty rustup. No changes to Clippy in the Rust repo for the last 2 weeks 😮
    
    changelog: none
    bors committed Jun 3, 2021
    Configuration menu
    Copy the full SHA
    3ae8faf View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    39a1fdd View commit details
    Browse the repository at this point in the history
  5. Update Cargo.lock

    flip1995 committed Jun 3, 2021
    Configuration menu
    Copy the full SHA
    647f2b4 View commit details
    Browse the repository at this point in the history