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

Merged
merged 57 commits into from
Jul 29, 2021
Merged

Update Clippy #87579

merged 57 commits into from
Jul 29, 2021

Commits on Jul 13, 2021

  1. No longer suggest inserting or appending an underscore

    changelog: [`similar_names`] lint no longer suggests to insert or add an underscore
    to "fix" too similar names
    th1000s committed Jul 13, 2021
    Configuration menu
    Copy the full SHA
    e8f57c3 View commit details
    Browse the repository at this point in the history

Commits on Jul 14, 2021

  1. Use diagnostic items for BinaryHeap, BTreeMap, BTreeSet, `HashM…

    …ap`, `HashSet`, `Borrow`, `Default`
    xFrednet committed Jul 14, 2021
    Configuration menu
    Copy the full SHA
    2ac2188 View commit details
    Browse the repository at this point in the history
  2. Use diagnostic items for Into, IntoIterator, LinkedList, `ptr::…

    …null`, `prt::null_mut`
    xFrednet committed Jul 14, 2021
    Configuration menu
    Copy the full SHA
    6030428 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    6ce6b29 View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    ecf85f4 View commit details
    Browse the repository at this point in the history

Commits on Jul 18, 2021

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

Commits on Jul 19, 2021

  1. Configuration menu
    Copy the full SHA
    884ef4c View commit details
    Browse the repository at this point in the history
  2. Auto merge of rust-lang#7221 - th1000s:keyword_, r=giraffate

    similar_names: No longer suggest inserting or appending an underscore
    
    changelog: [`similar_names`] lint no longer suggests to insert or add an underscore to "fix" too similar names
    bors committed Jul 19, 2021
    Configuration menu
    Copy the full SHA
    6103814 View commit details
    Browse the repository at this point in the history

Commits on Jul 20, 2021

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

Commits on Jul 21, 2021

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

Commits on Jul 22, 2021

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

Commits on Jul 23, 2021

  1. Configuration menu
    Copy the full SHA
    544c462 View commit details
    Browse the repository at this point in the history
  2. Clean up unnecessary unwraps

    F3real committed Jul 23, 2021
    Configuration menu
    Copy the full SHA
    045dbb5 View commit details
    Browse the repository at this point in the history
  3. update clippy ui test 'future_not_send.stderr' to match

    the new diagnostic messages
    chazkiker2 committed Jul 23, 2021
    Configuration menu
    Copy the full SHA
    1b8fc8f View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    ea97a5a View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    afe5962 View commit details
    Browse the repository at this point in the history

Commits on Jul 24, 2021

  1. Auto merge of rust-lang#7482 - xFrednet:7306-document-repeat-once-fp,…

    … r=giraffate
    
    Documented constant expression evaluation for `repeat_once`
    
    Documents the fact that the `repeat_once` lint evaluates constant expressions
    
    ---
    
    closes: rust-lang#7306
    
    changelog: none
    (I don't think it's worth a change log entry, as nothing has really changed)
    
    r? `@giraffate` as you've implemented the lint and were part of the discussion in the issue 🙃
    bors committed Jul 24, 2021
    Configuration menu
    Copy the full SHA
    ea69a9d View commit details
    Browse the repository at this point in the history

Commits on Jul 25, 2021

  1. Add generic arg infer

    JulianKnodt committed Jul 25, 2021
    Configuration menu
    Copy the full SHA
    00faed9 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    8286824 View commit details
    Browse the repository at this point in the history
  3. Introduce OwnerNode::Crate.

    cjgillot committed Jul 25, 2021
    Configuration menu
    Copy the full SHA
    5b914f6 View commit details
    Browse the repository at this point in the history
  4. Auto merge of rust-lang#83723 - cjgillot:ownernode, r=petrochenkov

    Store all HIR owners in the same container
    
    This replaces the previous storage in a BTreeMap for each of Item/ImplItem/TraitItem/ForeignItem.
    This should allow for a more compact storage.
    
    Based on rust-lang#83114
    bors committed Jul 25, 2021
    Configuration menu
    Copy the full SHA
    1270ed0 View commit details
    Browse the repository at this point in the history
  5. Explain flags missing in cargo check in --help

    This commit closes rust-lang#7389. As stated in the issue, `cargo clippy --help`
    provides explanation for some flags and states that the rest are same
    as in `cargo check --help`, even though some clippy specific flags
    exist.
    
    This commit extends the `cargo clippy --help` with two additional flags,
      - `cargo clippy --fix`
      - `cargo clippy --no-deps`
    
    If there are more flags which are not present in `cargo check --help`
    please bring these to my attention, I will include these aswell.
    For now, I noticed only the two flags mentioned above.
    nfejzic committed Jul 25, 2021
    Configuration menu
    Copy the full SHA
    f68629a View commit details
    Browse the repository at this point in the history
  6. Configuration menu
    Copy the full SHA
    d3492a0 View commit details
    Browse the repository at this point in the history

Commits on Jul 26, 2021

  1. Configuration menu
    Copy the full SHA
    89c8c3f View commit details
    Browse the repository at this point in the history
  2. Auto merge of rust-lang#7484 - camsteffen:author, r=flip1995

    Some `clippy::author` improvements
    
    changelog: none
    
    * Use `Debug` instead of re-implementing it for some things
    * Fix block trailing expression handing
    * Don't double print on stmt/expr with `#[clippy::author]` attribute
    bors committed Jul 26, 2021
    Configuration menu
    Copy the full SHA
    6d9036b View commit details
    Browse the repository at this point in the history
  3. Auto merge of rust-lang#7477 - F3real:needless_continue, r=flip1995

    Enhance needless continue to detect loop {continue;}
    
    Fixes rust-lang#7417
    
    changelog: Report [`needless_continue`] in `loop { continue; }` case
    bors committed Jul 26, 2021
    Configuration menu
    Copy the full SHA
    02d70f3 View commit details
    Browse the repository at this point in the history
  4. Auto merge of rust-lang#7485 - camsteffen:add-test-externs, r=flip1995

    Add to test third party crates list
    
    changelog: none
    bors committed Jul 26, 2021
    Configuration menu
    Copy the full SHA
    7d6946d View commit details
    Browse the repository at this point in the history
  5. Auto merge of rust-lang#7493 - xFrednet:7220-fix-new-without-default-…

    …impl-type, r=camsteffen
    
    Prefer a code snipped over formatting the self type (`new_without_default`)
    
    Fixes: rust-lang/rust-clippy#7220
    
    changelog: [`new_without_default`]: The `Default` impl block type doesn't use the full type path qualification
    
    Have a nice day to everyone reading this 🙃
    bors committed Jul 26, 2021
    Configuration menu
    Copy the full SHA
    3214de3 View commit details
    Browse the repository at this point in the history
  6. Include more information in --help

    `--no-deps` filled in with a little more information. Explain that
    `--fix` implies `--no-deps`.
    Explain that `--no-deps` is used with `cargo clippy --`, including
    one example.
    nfejzic committed Jul 26, 2021
    Configuration menu
    Copy the full SHA
    0e5802e View commit details
    Browse the repository at this point in the history
  7. Configuration menu
    Copy the full SHA
    3c517b3 View commit details
    Browse the repository at this point in the history
  8. Auto merge of rust-lang#7495 - camsteffen:extern-conflict, r=Manishearth

    Improve conflicting rlibs error again
    
    changelog: none
    
    Now you can do `rm <paste>` and 🐇💨
    
    ```text
    thread 'compile_test' panicked at '
    ----------------------------------------------------------------------
    ERROR: Found multiple rlibs for crates: `clippy_lints`, `clippy_utils`
    Try running `cargo clean` or remove the following files:
    
    target/debug/deps/libclippy_lints-9117c875159004e0.rlib \
    target/debug/deps/libclippy_lints-fe45157be7ff9444.rlib \
    target/debug/deps/libclippy_utils-5eba1e07a9846ed0.rlib \
    target/debug/deps/libclippy_utils-ccbc08fcf64de262.rlib
    
    For details on this error see rust-lang/rust-clippy#7343
    ----------------------------------------------------------------------
    ```
    bors committed Jul 26, 2021
    Configuration menu
    Copy the full SHA
    fd2b43d View commit details
    Browse the repository at this point in the history
  9. Configuration menu
    Copy the full SHA
    74379d4 View commit details
    Browse the repository at this point in the history

Commits on Jul 27, 2021

  1. Auto merge of rust-lang#7466 - xFrednet:5393-use-more-diagnostic-item…

    …s, r=flip1995
    
    Use diagnostic items where possible
    
    Clippy still uses a bunch of paths in places that could easily use already defined diagnostic items. This PR updates all references to such paths and also removes a bunch of them that are no longer needed after this cleanup.
    
    Some paths are also used to construct new paths and can therefore not be removed that easily. I've added a doc comment to those instances that recommends the use of the diagnostic item where possible.
    
    And that's it, cleaning crew signing off 🧹 🗑️
    
    ---
    
    changelog: none
    
    (only internal improvements)
    
    cc: rust-lang#5393
    bors committed Jul 27, 2021
    Configuration menu
    Copy the full SHA
    ceb7a86 View commit details
    Browse the repository at this point in the history
  2. Handle --no-deps flag same as --fix flag.

    As proposed in the pull request thread, there is some inconsistency in
    handling the `--no-deps` flag which requires `--` before it, and
    `--fix` flag which does not.
    In this commit the `--no-deps` flag does not need the `--` anymore.
    However, it can still be used that way: `cargo clipyy -- --no-deps`.
    nfejzic committed Jul 27, 2021
    Configuration menu
    Copy the full SHA
    f7af8bf View commit details
    Browse the repository at this point in the history
  3. Add primitive type support to disallowed_type lint

    Fix docs of disallowed_type
    
    Add ability to name primitive types without import path
    
    Move primitive resolution to clippy_utils path_to_res fn
    
    Refactor Res matching, fix naming and docs from review
    
    Use tcx.def_path_str when emitting the lint
    DevinR528 committed Jul 27, 2021
    Configuration menu
    Copy the full SHA
    a1bab3b View commit details
    Browse the repository at this point in the history
  4. Auto merge of rust-lang#7488 - DevinR528:bantype-fix, r=camsteffen

    Add primitive type support to disallowed_type lint
    
    Closes rust-lang#6845
    
    changelog: Enable the banning of primitive types in [`disallowed_type`]
    bors committed Jul 27, 2021
    Configuration menu
    Copy the full SHA
    43905d9 View commit details
    Browse the repository at this point in the history
  5. Auto merge of rust-lang#7492 - nfejzic:improve_help, r=Manishearth

    Explain flags missing in cargo check in --help
    
    This commit closes rust-lang#7389. As stated in the issue, `cargo clippy --help`
    provides explanation for some flags and states that the rest are same
    as in `cargo check --help`, even though some clippy specific flags
    exist.
    
    This commit extends the `cargo clippy --help` with two additional flags,
      - `cargo clippy --fix`
      - `cargo clippy --no-deps`
    
    If there are more flags which are not present in `cargo check --help`
    please bring these to my attention, I will include these aswell.
    For now, I noticed only the two flags mentioned above.
    
    changelog: `cargo clippy --help` now explains additional flags missing in `cargo check --help`.
    bors committed Jul 27, 2021
    Configuration menu
    Copy the full SHA
    ac0fd99 View commit details
    Browse the repository at this point in the history
  6. Auto merge of rust-lang#83484 - JulianKnodt:infer, r=oli-obk,lcnr

    Add hir::GenericArg::Infer
    
    In order to extend inference to consts, make an Infer type on hir::GenericArg.
    bors committed Jul 27, 2021
    Configuration menu
    Copy the full SHA
    ea988af View commit details
    Browse the repository at this point in the history
  7. Update tests

    jhpratt committed Jul 27, 2021
    Configuration menu
    Copy the full SHA
    5331fea View commit details
    Browse the repository at this point in the history

Commits on Jul 28, 2021

  1. Update deploy CI

    This updates all the deploy scripts and the deploy workflow.
    
    The deploy workflow now runs the metadata collector to collect the lint
    documentation. It also changes the files that are checked out in the
    deploy workflow from master and adds an explanation why we have to do
    this.
    flip1995 committed Jul 28, 2021
    Configuration menu
    Copy the full SHA
    6c5d199 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    fe25282 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    12c6161 View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    9bc5803 View commit details
    Browse the repository at this point in the history
  5. Adapting the lint list to Clippy's new metadata format

    Changes included:
        - Minimum adaption to the new `lints.json` format
        - Fixing filtering for the new `lints.json` format; hardcoding the
          lint groups in the index
        - Recreating the original doc styling for the new format
        - Fixed sytax highlighting for rust,ignore code blocks
        - Fixed markdown table extraction in the metadata collector and
          fixed lint level output
        - Adding the additional information row for lints
        - Changed the website title to Clippy's lint list
        - Flexing the website for mobile users
        - Added (?) references for lint levels and groups
        - Making deprecated lints look dead
        - Removed JS code block language extraction in favor of a rust
          implementation `rust-clippy#7352`
        - Added the suspicious lint group to the lint list
        - Remove trailing whitespaces from index.html
        - Fix code highlighting
        - Use default value if the docVersion is empty
    
    Co-authored-by: Philipp Krones <hello@philkrones.com>
    xFrednet and flip1995 committed Jul 28, 2021
    Configuration menu
    Copy the full SHA
    322a768 View commit details
    Browse the repository at this point in the history
  6. Configuration menu
    Copy the full SHA
    c951a3c View commit details
    Browse the repository at this point in the history
  7. Rollup merge of rust-lang#7279 - xFrednet:7172-adapt-website-to-new-f…

    …ormat, r=flip1995
    
    Adapting the lint list to Clippy's new metadata format
    
    This is close to the end of a long living project to rewrite the lint metadata collection for Clippy. Progress on this has been tracked in rust-lang#7172. This PR adds one of the last missing puzzle pieces, the actual display of all the changes that have been done in the background. A preview can be seen here: [Clippy's lint list](https://xfrednet.github.io/rust-clippy/master/index.html)
    
    The styling has been discussed on [zulip](https://rust-lang.zulipchat.com/#narrow/stream/257328-clippy/topic/Styling.20feedback.20for.20Clippy's.20lint.20list/near/239601067) but is still open to suggestion.
    
    Side note: It has been fun working on the website where we don't have unit tests and everything is just tested by playing around. However, it's good that this chaos is contained into this one part of Clippy. 🐛
    
    ---
    
    Closes: rust-lang#1303
    Closes: rust-lang#4310
    
    This actually closes fewer things than I thought it would...
    
    changelog: Reworked Clippy's [website](https://rust-lang.github.io/rust-clippy/master/index.html):
    changelog: * Added applicability information about lints
    changelog: * Added a link to jump to the specific lint implementation
    changelog: * Adapted some styling and improved loading time
    
    r? `@flip1995`
    flip1995 committed Jul 28, 2021
    Configuration menu
    Copy the full SHA
    ce46599 View commit details
    Browse the repository at this point in the history
  8. Rollup merge of rust-lang#7298 - flip1995:ci-switch-to-monster, r=xFr…

    …ednet,flip1995
    
    Switch CI to new metadata collection
    
    r? `@xFrednet`
    
    Things we have to keep in mind:
    
    - This removes the template files and the scripts used for deployment from the checkout. This was added in rust-lang#5517. I don't think we ever needed those there. Not sure though.
    - ~~As a result, we can't remove the python scripts yet. We have to wait until this hits a stable Clippy release.~~ I'll just break the next stable deploy and do it by hand once.
    - This should be merged together with rust-lang#7279. Me and `@xFrednet` will coordinate the switch
    - ...?
    
    I still have to try out some things:
    
    - [x] Is it worth caching? Yes
    - [x] ~~Is it worth to do a release build?~~ Nope
    - [x] Does it actually work? With a few changes, yes
    - [ ] ...?
    
    changelog: Clippy now uses a lint to generate its documentation 🎉
    flip1995 committed Jul 28, 2021
    Configuration menu
    Copy the full SHA
    bcdf147 View commit details
    Browse the repository at this point in the history
  9. Rollup merge of rust-lang#7420 - xFrednet:7172-update-lint-documentat…

    …ion, r=flip1995
    
    Update lint documentation to use markdown headlines
    
    This PR updates all lint documentation to use markdown headlines. It additionally removed the *Known problems* section for lints without any problems. I've double-checked all automatic replacements, but a second pair of eyes is definitely appreciated!
    
    I wasn't sure when you wanted to switch to the new metadata collection tomorrow, I therefore prepared this PR today. And that's it this is a standalone PR to keep the other related PRs reviewable.
    
    changelog:  none
    
    r? `@flip1995`
    
    cc: rust-lang#7172
    
    Note: This should be merged with the other metadata collection related PRs.
    flip1995 committed Jul 28, 2021
    Configuration menu
    Copy the full SHA
    464c85c View commit details
    Browse the repository at this point in the history
  10. Auto merge of rust-lang#7502 - flip1995:rollup-y3ho3w0, r=flip1995

    Rollup of 3 pull requests
    
    Successful merges:
    
     - rust-lang#7279 (Adapting the lint list to Clippy's new metadata format)
     - rust-lang#7298 (Switch CI to new metadata collection)
     - rust-lang#7420 (Update lint documentation to use markdown headlines)
    
    Failed merges:
    
    r? `@ghost`
    `@rustbot` modify labels: rollup
    
    changelog: rollup
    bors committed Jul 28, 2021
    Configuration menu
    Copy the full SHA
    92ca25b View commit details
    Browse the repository at this point in the history

Commits on Jul 29, 2021

  1. Configuration menu
    Copy the full SHA
    490beda View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    7ed7b29 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    80116f9 View commit details
    Browse the repository at this point in the history
  4. Auto merge of rust-lang#7503 - flip1995:rustup, r=flip1995

    Rustup
    
    r? `@ghost`
    
    changelog: none
    bors committed Jul 29, 2021
    Configuration menu
    Copy the full SHA
    766f09f View commit details
    Browse the repository at this point in the history
  5. Rename two lints to comply with our lint naming convention

    self_named_constructor -> self_named_constructors
    append_instead_of_extend -> extend_with_drain
    flip1995 committed Jul 29, 2021
    Configuration menu
    Copy the full SHA
    54e5391 View commit details
    Browse the repository at this point in the history
  6. Auto merge of rust-lang#7504 - flip1995:rename-lints, r=flip1995

    Rename two lints to comply with our lint naming convention
    
    self_named_constructor -> self_named_constructors
    append_instead_of_extend -> extend_with_drain
    
    We don't need to `register_renamed` those lints, since I'll backport them to beta, so the old names won't hit stable.
    
    changelog: none
    (I'll adapt the changelog before merging rust-lang#7498)
    bors committed Jul 29, 2021
    Configuration menu
    Copy the full SHA
    0cce3f6 View commit details
    Browse the repository at this point in the history
  7. Configuration menu
    Copy the full SHA
    72d655b View commit details
    Browse the repository at this point in the history
  8. Configuration menu
    Copy the full SHA
    8570a36 View commit details
    Browse the repository at this point in the history