]> git.lizzy.rs Git - rust.git/log
rust.git
3 years agoAuto merge of #6701 - camsteffen:collapsible-if, r=flip1995
bors [Sun, 14 Feb 2021 14:43:35 +0000 (14:43 +0000)]
Auto merge of #6701 - camsteffen:collapsible-if, r=flip1995

Fix collapsible_if with attributes

changelog: Fix collapsible_if FP with attributes

Fixes #6593

3 years agoAuto merge of #6697 - camsteffen:vec-init-push-fp, r=flip1995
bors [Sun, 14 Feb 2021 14:27:13 +0000 (14:27 +0000)]
Auto merge of #6697 - camsteffen:vec-init-push-fp, r=flip1995

Fix vec_init_then_push false positives

changelog: Fix vec_init_then_push false positives

Fixes #6615

3 years agoAuto merge of #6736 - Y-Nak:reproducer-for-use_self-ice, r=flip1995
bors [Sat, 13 Feb 2021 18:59:59 +0000 (18:59 +0000)]
Auto merge of #6736 - Y-Nak:reproducer-for-use_self-ice, r=flip1995

Add a minimal reproducer for the ICE in #6179

This PR is an auxiliary PR for #6179, just add a minimal reproducer for the ICE discussed in #6179.
See #6179 for more details.

changelog: none

3 years agoAdd minimal reproducer for ICE in #6179
Yoshitomo Nakanishi [Sat, 13 Feb 2021 13:12:59 +0000 (22:12 +0900)]
Add minimal reproducer for ICE in #6179

3 years agoAuto merge of #6735 - matthiaskrgr:lintcheck, r=flip1995
bors [Sat, 13 Feb 2021 16:03:07 +0000 (16:03 +0000)]
Auto merge of #6735 - matthiaskrgr:lintcheck, r=flip1995

lintcheck: accept env var to set crates.toml file

*Please write a short comment explaining your change (or "none" for internal only changes)*
changelog: lintcheck: accept  LINTCHECK_TOML env var to set list of crates to be checked.

3 years agoUse title case in clippy_dev README
Philipp Krones [Sat, 13 Feb 2021 15:55:01 +0000 (16:55 +0100)]
Use title case in clippy_dev README

3 years agoAuto merge of #6738 - xFrednet:0000-update-labels-in-template-files, r=flip1995
bors [Sat, 13 Feb 2021 15:51:14 +0000 (15:51 +0000)]
Auto merge of #6738 - xFrednet:0000-update-labels-in-template-files, r=flip1995

Update labels in template files

It seems like we forgot to update the GitHub templates when we decided to update the label names. This PR just adjusts the templates to use the new label names :)

Context: [Zulip discussion about renaming the labels](https://rust-lang.zulipchat.com/#narrow/stream/257328-clippy/topic/Label.20cleanup/near/224083870)

---

changelog: none

3 years agoUpdated labels in template files
xFrednet [Sat, 13 Feb 2021 15:45:34 +0000 (16:45 +0100)]
Updated labels in template files

For context: https://rust-lang.zulipchat.com/#narrow/stream/257328-clippy/topic/Label.20cleanup/near/224083870

3 years agolintcheck: explain sources.toml configuration
Matthias Krüger [Fri, 12 Feb 2021 23:50:13 +0000 (00:50 +0100)]
lintcheck: explain sources.toml configuration

3 years agolintcheck: env var LINTCHECK_TOML can be used to override toml file location (has...
Matthias Krüger [Fri, 12 Feb 2021 23:39:19 +0000 (00:39 +0100)]
lintcheck: env var LINTCHECK_TOML can be used to override toml file location (has precedence over --crates-toml flag)

3 years agoAuto merge of #6700 - daxpedda:panics-doc-unreachable, r=llogiq
bors [Fri, 12 Feb 2021 20:48:05 +0000 (20:48 +0000)]
Auto merge of #6700 - daxpedda:panics-doc-unreachable, r=llogiq

Fix missing_panics_doc warning on `unreachable!`.

Fixes #6699.

Are there any other test-cases I should cover?

changelog: [`missing_panics_doc`](https://rust-lang.github.io/rust-clippy/master/index.html#missing_panics_doc): No longer lints on [`unreachable!`](https://doc.rust-lang.org/std/macro.unreachable.html)

3 years agoAuto merge of #6179 - flip1995:rewrite_use_self, r=phansch
bors [Fri, 12 Feb 2021 06:09:07 +0000 (06:09 +0000)]
Auto merge of #6179 - flip1995:rewrite_use_self, r=phansch

Rework use_self impl based on ty::Ty comparison #3410 | Take 2

This builds on top of #5531

I already reviewed and approved the commits by `@montrivo.` So only the review of my commits should be necessary.

I would also appreciate your review `@montrivo,` since you are familiar with the challenges here.

Fixes #3410 and Fixes #4143 (same problem)
Fixes #2843
Fixes #3859
Fixes #4734 and fixes #6221
Fixes #4305
Fixes #5078 (even at expression level now 🎉)
Fixes #3881 and Fixes #4887 (same problem)
Fixes #3909

Not yet: #4140 (test added)

All the credit for the fixes goes to `@montrivo.` I only refactored and copy and pasted his code.

changelog: rewrite [`use_self`] lint and fix multiple (8) FPs. One to go.

3 years agoAuto merge of #6719 - flip1995:changelog, r=xFrednet,flip1995
bors [Thu, 11 Feb 2021 16:06:07 +0000 (16:06 +0000)]
Auto merge of #6719 - flip1995:changelog, r=xFrednet,flip1995

Update changelog for 1.51

~~Don't merge yet. This is the last step of the release process.~~ Release process for 1.50 is done, this can now be merged.

[Rendered](https://github.com/flip1995/rust-clippy/blob/changelog/CHANGELOG.md)

changelog: none

3 years agoUpdate changelog for 1.51
flip1995 [Thu, 11 Feb 2021 14:59:38 +0000 (15:59 +0100)]
Update changelog for 1.51

3 years agoAuto merge of #6720 - flip1995:backport_remerge, r=flip1995
bors [Thu, 11 Feb 2021 15:10:42 +0000 (15:10 +0000)]
Auto merge of #6720 - flip1995:backport_remerge, r=flip1995

Backport remerge

changelog: none

r? `@ghost`

3 years agoMerge remote-tracking branch 'upstream/beta' into backport_remerge
flip1995 [Thu, 11 Feb 2021 15:09:12 +0000 (16:09 +0100)]
Merge remote-tracking branch 'upstream/beta' into backport_remerge

3 years agoAuto merge of #6718 - flip1995:rustup, r=flip1995
bors [Thu, 11 Feb 2021 13:38:47 +0000 (13:38 +0000)]
Auto merge of #6718 - flip1995:rustup, r=flip1995

Rustup

r? `@ghost`

changelog: none

3 years agoBump nightly version -> 2021-02-11
flip1995 [Thu, 11 Feb 2021 13:37:13 +0000 (14:37 +0100)]
Bump nightly version -> 2021-02-11

3 years agoMerge remote-tracking branch 'upstream/master' into rustup
flip1995 [Thu, 11 Feb 2021 13:36:52 +0000 (14:36 +0100)]
Merge remote-tracking branch 'upstream/master' into rustup

3 years agoAuto merge of #6708 - matthiaskrgr:lintcheck, r=flip1995
bors [Thu, 11 Feb 2021 09:46:42 +0000 (09:46 +0000)]
Auto merge of #6708 - matthiaskrgr:lintcheck, r=flip1995

some more lintcheck changes

* Explain why tokei is commented out in the lintcheck sources.
* If we specify a custom sources.toml, don't override the preexisting lintcheck logs, but rather start a new log with the filename depending on the sources.toml name.
* Start adding a readme.md to clippy_dev and add some information on how to use the lintcheck subcommand.
* Add support for path/local sources (I needed this for the next item which is: )
* Collect ICEs that happen while clippy checks crates

changelog: more lintcheck changes

3 years agolintcheck: collect ICEs
Matthias Krüger [Wed, 10 Feb 2021 11:50:36 +0000 (12:50 +0100)]
lintcheck: collect ICEs

3 years agolintcheck: add support for path sources
Matthias Krüger [Wed, 10 Feb 2021 10:32:10 +0000 (11:32 +0100)]
lintcheck: add support for path sources

3 years agostart a clippy-dev readme and some rough info on how to use lintcheck
Matthias Krüger [Tue, 9 Feb 2021 15:58:39 +0000 (16:58 +0100)]
start a clippy-dev readme and some rough info on how to use lintcheck

3 years agolintcheck: make the log file be ${source-file}-logs.txt
Matthias Krüger [Tue, 9 Feb 2021 15:27:56 +0000 (16:27 +0100)]
lintcheck: make the log file be ${source-file}-logs.txt

this allows us to check multiple source.tomls and not worry about overriding our logfiles accidentally

3 years agolintcheck toml: explain why tokei is commented out
Matthias Krüger [Tue, 9 Feb 2021 15:10:07 +0000 (16:10 +0100)]
lintcheck toml: explain why tokei is commented out

3 years agoAuto merge of #6650 - daxpedda:cargo-common-metadata-publish, r=flip1995
bors [Thu, 11 Feb 2021 09:34:44 +0000 (09:34 +0000)]
Auto merge of #6650 - daxpedda:cargo-common-metadata-publish, r=flip1995

Fix cargo_common_metadata warning on `publish = false`.

I believe `cargo_common_metadata` shouldn't trigger when `publish = false`, not sure if everybody agrees.
Made some tests to handle all edge-cases.

Fixes #6649.

changelog: [`cargo_common_metadata`](https://rust-lang.github.io/rust-clippy/master/index.html#cargo_common_metadata): No longer lints if [`publish = false`](https://doc.rust-lang.org/cargo/reference/manifest.html#the-publish-field) is defined in the manifest

3 years agoAdd test for checking a combination of unreachable and panic.
daxpedda [Wed, 10 Feb 2021 19:55:31 +0000 (20:55 +0100)]
Add test for checking a combination of unreachable and panic.

3 years agoAuto merge of #6657 - ThibsG:FromIterParens, r=llogiq
bors [Wed, 10 Feb 2021 19:37:27 +0000 (19:37 +0000)]
Auto merge of #6657 - ThibsG:FromIterParens, r=llogiq

Fix suggestions that need parens in `from_iter_instead_of_collect` lint

Fixes broken suggestions that need parens (i.e.: range)

Fixes: #6648
changelog: none

3 years agoAuto merge of #6714 - alpaca-tc:fixed_tiny_typo, r=flip1995
bors [Wed, 10 Feb 2021 15:56:05 +0000 (15:56 +0000)]
Auto merge of #6714 - alpaca-tc:fixed_tiny_typo, r=flip1995

Fix typo

changelog: none

3 years agoFix typo
alpaca-tc [Wed, 10 Feb 2021 15:45:28 +0000 (00:45 +0900)]
Fix typo

3 years agoAuto merge of #6695 - TaKO8Ki:add-bytes-nth, r=phansch
bors [Wed, 10 Feb 2021 13:54:33 +0000 (13:54 +0000)]
Auto merge of #6695 - TaKO8Ki:add-bytes-nth, r=phansch

New lint: `bytes_nth`

This pull request adds a new lint named `bytes_nth`.

---
closes: https://github.com/rust-lang/rust-clippy/issues/6391

changelog: Added a new lint: `bytes_nth`

3 years agoAuto merge of #6687 - ehuss:stabilize-wrapper, r=flip1995
bors [Wed, 10 Feb 2021 13:27:53 +0000 (13:27 +0000)]
Auto merge of #6687 - ehuss:stabilize-wrapper, r=flip1995

Stabilize workspace wrapper.

This fixes it so that `cargo clippy` doesn't share the same cache artifacts as `cargo check`. The Cargo side was stabilized a while ago (https://github.com/rust-lang/cargo/pull/8976), so this should be ready to go. I'm not aware of any blockers or concerns.

Closes #4612

---

changelog: `cargo clippy` no longer shares the same build cache as `cargo check`.

3 years agoUse TyS::same_type
Cameron Steffen [Wed, 10 Feb 2021 01:42:32 +0000 (19:42 -0600)]
Use TyS::same_type

3 years agoMove "types to lint" to the item stack
Cameron Steffen [Wed, 10 Feb 2021 01:39:38 +0000 (19:39 -0600)]
Move "types to lint" to the item stack

3 years agoFix qpath_res call
Cameron Steffen [Wed, 10 Feb 2021 01:38:40 +0000 (19:38 -0600)]
Fix qpath_res call

3 years agoDon't trigger use_self in macros
flip1995 [Sun, 17 Jan 2021 18:09:24 +0000 (19:09 +0100)]
Don't trigger use_self in macros

3 years agoUpdate test files
flip1995 [Fri, 16 Oct 2020 11:26:02 +0000 (13:26 +0200)]
Update test files

3 years agoRewrite use_self lint one more time
flip1995 [Fri, 16 Oct 2020 11:25:38 +0000 (13:25 +0200)]
Rewrite use_self lint one more time

This rewrite gets rid of complicated visitors, by using the lint infrastructure as much as possible

3 years agouse_self - fix issue with `hir_ty_to_ty`
Tim Nielens [Fri, 9 Oct 2020 22:26:12 +0000 (00:26 +0200)]
use_self - fix issue with `hir_ty_to_ty`

3 years agorework use_self impl based on ty::Ty comparison
Tim Nielens [Sun, 26 Apr 2020 00:48:02 +0000 (02:48 +0200)]
rework use_self impl based on ty::Ty comparison

3 years agoadd some test cases
Takayuki Maeda [Wed, 10 Feb 2021 07:15:29 +0000 (16:15 +0900)]
add some test cases

3 years agoUpdate clippy_lints/src/methods/bytes_nth.rs
Takayuki Maeda [Wed, 10 Feb 2021 06:49:07 +0000 (15:49 +0900)]
Update clippy_lints/src/methods/bytes_nth.rs

Co-authored-by: Phil Hansch <dev@phansch.net>
3 years agoAuto merge of #6698 - camsteffen:path-to-local, r=phansch
bors [Wed, 10 Feb 2021 06:17:37 +0000 (06:17 +0000)]
Auto merge of #6698 - camsteffen:path-to-local, r=phansch

More path-to-local fixes

changelog: Fix some detections of variable usage in closures

3 years agoAuto merge of #6709 - rust-lang:flip1995-patch-1, r=matthiaskrgr
bors [Tue, 9 Feb 2021 16:50:35 +0000 (16:50 +0000)]
Auto merge of #6709 - rust-lang:flip1995-patch-1, r=matthiaskrgr

Remove rustfmt from rust-toolchain file

We use latest nightly rustfmt in our tests anyway

r? `@matthiaskrgr`

changelog: none

3 years agoRemove rustfmt from rust-toolchain file
Philipp Krones [Tue, 9 Feb 2021 16:44:36 +0000 (17:44 +0100)]
Remove rustfmt from rust-toolchain file

We use latest nightly rustfmt in our tests anyway

3 years agoAdd better turbofish extractor
ThibsG [Tue, 9 Feb 2021 16:38:16 +0000 (17:38 +0100)]
Add better turbofish extractor

3 years agoAuto merge of #6704 - rust-lang:flip1995-patch-1, r=phansch
bors [Tue, 9 Feb 2021 15:47:30 +0000 (15:47 +0000)]
Auto merge of #6704 - rust-lang:flip1995-patch-1, r=phansch

Rename "good first issue" back to "good-first-issue"

changelog: none

3 years agoRename "good first issue" back to "good-first-issue"
Philipp Krones [Tue, 9 Feb 2021 09:29:00 +0000 (10:29 +0100)]
Rename "good first issue" back to "good-first-issue"

3 years agoRename HIR UnOp variants
Ömer Sinan Ağacan [Tue, 9 Feb 2021 08:15:53 +0000 (11:15 +0300)]
Rename HIR UnOp variants

This renames the variants in HIR UnOp from

    enum UnOp {
        UnDeref,
        UnNot,
        UnNeg,
    }

to

    enum UnOp {
        Deref,
        Not,
        Neg,
    }

Motivations:

- This is more consistent with the rest of the code base where most enum
  variants don't have a prefix.

- These variants are never used without the `UnOp` prefix so the extra
  `Un` prefix doesn't help with readability. E.g. we don't have any
  `UnDeref`s in the code, we only have `UnOp::UnDeref`.

- MIR `UnOp` type variants don't have a prefix so this is more
  consistent with MIR types.

- "un" prefix reads like "inverse" or "reverse", so as a beginner in
  rustc code base when I see "UnDeref" what comes to my mind is
  something like "&*" instead of just "*".

3 years agoFix collapsible_if false positive with attributes
Cameron Steffen [Mon, 8 Feb 2021 17:00:30 +0000 (11:00 -0600)]
Fix collapsible_if false positive with attributes

3 years agoSimplify if_chain
Cameron Steffen [Mon, 8 Feb 2021 16:51:40 +0000 (10:51 -0600)]
Simplify if_chain

3 years agoFix missing_panics_doc warning on `unreachable!`.
daxpedda [Mon, 8 Feb 2021 16:25:10 +0000 (17:25 +0100)]
Fix missing_panics_doc warning on `unreachable!`.

3 years agoUse path_to_local_id
Cameron Steffen [Mon, 8 Feb 2021 15:50:13 +0000 (09:50 -0600)]
Use path_to_local_id

3 years agoRefactor out UnusedSelfVisitor
Cameron Steffen [Wed, 3 Feb 2021 17:45:16 +0000 (11:45 -0600)]
Refactor out UnusedSelfVisitor

3 years agoEnhance LocalUsedVisitor to check closure bodies
Cameron Steffen [Wed, 3 Feb 2021 17:35:16 +0000 (11:35 -0600)]
Enhance LocalUsedVisitor to check closure bodies

3 years agoFix vec_init_then_push FP
Cameron Steffen [Fri, 5 Feb 2021 22:28:13 +0000 (16:28 -0600)]
Fix vec_init_then_push FP

3 years agoUse id instead of name
Cameron Steffen [Fri, 5 Feb 2021 22:27:23 +0000 (16:27 -0600)]
Use id instead of name

3 years agoAuto merge of #6696 - dtolnay-contrib:regex, r=Manishearth
bors [Mon, 8 Feb 2021 06:02:29 +0000 (06:02 +0000)]
Auto merge of #6696 - dtolnay-contrib:regex, r=Manishearth

Downgrade trivial_regex to nursery

See #6690. I think there is still value in a trivial_regex lint, but only if clippy can tell that the regex is only ever constructed and applied to a single input.

```rust
let regex = Regex::new("trivial_regex")?;
println!("{}", regex.is_match(s));
// `regex` never used again
```

---

changelog: remove `trivial_regex` from default set of enabled lints

3 years agoDowngrade trivial_regex to nursery
David Tolnay [Mon, 8 Feb 2021 00:54:09 +0000 (16:54 -0800)]
Downgrade trivial_regex to nursery

3 years agoAuto merge of #6694 - matthiaskrgr:lintcheck-cfg, r=Manishearth
bors [Sun, 7 Feb 2021 19:04:00 +0000 (19:04 +0000)]
Auto merge of #6694 - matthiaskrgr:lintcheck-cfg, r=Manishearth

lintcheck: add a cmdline option --crates-toml <TOML PATH> to override crate sources file to use.

Fixes #6691

changelog: lintcheck: add --crates-toml  cmdline option to override default crates.toml file.

3 years agoadd a new lint `bytes_nth`
Takayuki Maeda [Sun, 7 Feb 2021 16:34:59 +0000 (01:34 +0900)]
add a new lint `bytes_nth`

3 years agolintcheck: add a cmdline option --crates-toml <TOML PATH> to override crate sources...
Matthias Krüger [Sun, 7 Feb 2021 15:12:21 +0000 (16:12 +0100)]
lintcheck: add a cmdline option --crates-toml <TOML PATH> to override crate sources file to use.

Fixes #6691

3 years agoAuto merge of #6686 - matthiaskrgr:lintcheck_git, r=flip1995
bors [Sun, 7 Feb 2021 13:25:00 +0000 (13:25 +0000)]
Auto merge of #6686 - matthiaskrgr:lintcheck_git, r=flip1995

lintcheck: support git sources

This adds support for git sources in `cargo dev-lintcheck`

You can add a git source to `clippy_dev/lintcheck_crates.toml` by having a `git_url` and a `git_hash` key instead of the `versions` array.
The repo will the be cloned and checked out to the requested commit before checking it with clippy.

Fixes https://github.com/rust-lang/rust-clippy/issues/6642

changelog: lintcheck: support git sources

3 years agoAuto merge of #6674 - phlip9:disallowed_functions, r=llogiq
bors [Sun, 7 Feb 2021 11:15:44 +0000 (11:15 +0000)]
Auto merge of #6674 - phlip9:disallowed_functions, r=llogiq

disallowed_methods: Support functions in addition to methods

## Context:

Hey all! I have a particular use case where I'd like to ban certain functions in a code base I work on. For example, I want to ban `Instant::now()` (among others) as we have a time service for mocking time in deterministic simulation tests. Obviously, it doesn't make sense to include a lint like this for all clippy users. Imagine my excitement when I spotted the new `disallowed_methods` lint in clippy--perfect! Unfortunately, after playing around with it for a bit, I was frustrated to realize that it didn't support functions like `Instant::now()`, so I've added support for them in this PR.

It might also make sense to rename the lint from `disallowed_methods` -> `disallowed_functions`, though I've held off from including that rename in this change, since I'm unsure of clippy's breaking change policy.

## Change

Support functions in addition to methods. In other words, support:

`disallowed_methods = ["alloc::vec::Vec::new"]` (a function) in addition to
`disallowed_methods = ["alloc::vec::Vec::leak"]` (a method).

Improve the documentation to clarify that users must specify the full qualified path for each disallowed function, which can be confusing for reexports. Include an example `clippy.toml`.

Simplify the actual lint pass so we can reuse `utils::fn_def_id`.

changelog: disallowed_method: Now supports functions in addition to methods

3 years agoAuto merge of #6685 - magurotuna:filter_map_identity, r=phansch
bors [Sun, 7 Feb 2021 09:55:32 +0000 (09:55 +0000)]
Auto merge of #6685 - magurotuna:filter_map_identity, r=phansch

Add new lint `filter_map_identity`

<!--
Thank you for making Clippy better!

We're collecting our changelog from pull request descriptions.
If your PR only includes internal changes, you can just write
`changelog: none`. Otherwise, please write a short comment
explaining your change.

If your PR fixes an issue, you can add "fixes #issue_number" into this
PR description. This way the issue will be automatically closed when
your PR is merged.

If you added a new lint, here's a checklist for things that will be
checked during review or continuous integration.

- \[x] Followed [lint naming conventions][lint_naming]
- \[x] Added passing UI tests (including committed `.stderr` file)
- \[x] `cargo test` passes locally
- \[x] Executed `cargo dev update_lints`
- \[x] Added lint documentation
- \[x] Run `cargo dev fmt`

[lint_naming]: https://rust-lang.github.io/rfcs/0344-conventions-galore.html#lints

Note that you can skip the above if you are just opening a WIP PR in
order to get feedback.

Delete this line and everything above before opening your PR.
-->

This commit adds a new lint named filter_map_identity.
This lint is the same as `flat_map_identity` except that it checks for the usage of `filter_map`.

---

Closes #6643

changelog: Added a new lint: `filter_map_identity`

3 years agoAuto merge of #6681 - 1c3t3a:1c3t3a-issue-6467, r=xFrednet,flip1995,phansch
bors [Sun, 7 Feb 2021 08:53:52 +0000 (08:53 +0000)]
Auto merge of #6681 - 1c3t3a:1c3t3a-issue-6467, r=xFrednet,flip1995,phansch

Adds a new lint that checks if there is a semicolon on the last block statement if it returns nothing

changelog: Added a new lint: `SEMICOLON_IF_NOTHING_RETURNED`
fixes #6467
Adds the `SEMICOLON_IF_NOTHING_RETURNED` lint and therefore closes #6467.

3 years agoAuto merge of #6660 - camsteffen:path-to-local, r=llogiq
bors [Sun, 7 Feb 2021 08:40:41 +0000 (08:40 +0000)]
Auto merge of #6660 - camsteffen:path-to-local, r=llogiq

Cleanup path-to-local checks

changelog: none

It seemed like too much ceremony going on to check if an expression matches a variable. So I created two util functions `path_to_local(Expr) -> Option<HirId>` and `path_to_local_id(Expr, HirId) -> bool` to make this easier, and used them wherever applicable.

I changed logic in a few places to use `HirId` instead of `Symbol` where it was easy to do so. I believe this is more correct and may even fix some bugs.

I also removed some calls to `qpath_res`. This is not needed if you are only looking for a `Res::Local`.

As a note, I wanted to name the util functions in a way that encourages understanding of the HIR.

3 years agoAuto merge of #6688 - rust-lang:triagebot_update, r=phansch
bors [Sun, 7 Feb 2021 08:24:50 +0000 (08:24 +0000)]
Auto merge of #6688 - rust-lang:triagebot_update, r=phansch

Update triagebot.toml to new label names

changelog: none

3 years agoAuto merge of #6682 - camsteffen:let-underscore-ref, r=llogiq
bors [Sun, 7 Feb 2021 08:13:42 +0000 (08:13 +0000)]
Auto merge of #6682 - camsteffen:let-underscore-ref, r=llogiq

Fix let_underscore_drop FP

changelog: Fix let_underscore_drop false positives and negatives

Fixes #6633

3 years agoUpdate triagebot.toml to new label names
Philipp Krones [Sat, 6 Feb 2021 22:56:08 +0000 (23:56 +0100)]
Update triagebot.toml to new label names

3 years agoEat dogfood
Cameron Steffen [Fri, 5 Feb 2021 20:55:09 +0000 (14:55 -0600)]
Eat dogfood

3 years agoFixed suggestion in macro invocations
Bastian Kersting [Sat, 6 Feb 2021 19:05:51 +0000 (20:05 +0100)]
Fixed suggestion in macro invocations

3 years agoStabilize workspace wrapper.
Eric Huss [Sat, 6 Feb 2021 18:38:27 +0000 (10:38 -0800)]
Stabilize workspace wrapper.

3 years agolintcheck: avoid dbg!() calls
Matthias Krüger [Sat, 6 Feb 2021 18:12:28 +0000 (19:12 +0100)]
lintcheck: avoid dbg!() calls

3 years agoConfused about my own explanation.
daxpedda [Sat, 6 Feb 2021 17:29:07 +0000 (18:29 +0100)]
Confused about my own explanation.

3 years agoDocument condition.
daxpedda [Sat, 6 Feb 2021 17:24:08 +0000 (18:24 +0100)]
Document condition.

3 years agoFux `toml_unknown_key` test.
daxpedda [Sat, 6 Feb 2021 17:21:03 +0000 (18:21 +0100)]
Fux `toml_unknown_key` test.

3 years agoPick up `clippy.toml` in `ui-cargo` tests.
daxpedda [Sat, 6 Feb 2021 16:57:31 +0000 (17:57 +0100)]
Pick up `clippy.toml` in `ui-cargo` tests.

3 years agoAdd back `publish = false` to the old test.
daxpedda [Sat, 6 Feb 2021 16:52:41 +0000 (17:52 +0100)]
Add back `publish = false` to the old test.

3 years agoAdd test for `publish = true`.
daxpedda [Sat, 6 Feb 2021 16:38:30 +0000 (17:38 +0100)]
Add test for `publish = true`.

3 years agoChange clippy configuration option.
daxpedda [Sat, 6 Feb 2021 16:38:14 +0000 (17:38 +0100)]
Change clippy configuration option.

3 years agoHide clippy configuration option.
daxpedda [Sat, 6 Feb 2021 15:51:51 +0000 (16:51 +0100)]
Hide clippy configuration option.

Co-authored-by: Philipp Krones <hello@philkrones.com>
3 years agoImplement `_cargo_ignore_publish`.
daxpedda [Wed, 3 Feb 2021 18:19:30 +0000 (19:19 +0100)]
Implement `_cargo_ignore_publish`.

3 years agoTest names were flipped.
daxpedda [Wed, 3 Feb 2021 17:01:18 +0000 (18:01 +0100)]
Test names were flipped.

3 years agoFix cargo_common_metadata warning on `publish = false`.
daxpedda [Fri, 29 Jan 2021 13:03:26 +0000 (14:03 +0100)]
Fix cargo_common_metadata warning on `publish = false`.

3 years agoChanged lint level to `restriction`
Bastian Kersting [Sat, 6 Feb 2021 16:06:06 +0000 (17:06 +0100)]
Changed lint level to `restriction`

3 years agoRollup merge of #81680 - camsteffen:primty, r=oli-obk
Jonas Schievink [Sat, 6 Feb 2021 16:01:45 +0000 (17:01 +0100)]
Rollup merge of #81680 - camsteffen:primty, r=oli-obk

Refactor `PrimitiveTypeTable` for Clippy

I removed `PrimitiveTypeTable` and added `PrimTy::ALL` and `PrimTy::from_name` in its place. This allows Clippy to use `PrimTy::from_name` for the `builtin_type_shadow` lint, and a `const` list of primitive types is deleted from Clippy code (the goal). All changes should be a little faster, if anything.

3 years agoSwitched to `snippet_with_macro_callsite`
Bastian Kersting [Sat, 6 Feb 2021 15:56:18 +0000 (16:56 +0100)]
Switched to `snippet_with_macro_callsite`

3 years agoRevert "Fixed for loop problem, corrected all occurences that got linted"
Bastian Kersting [Sat, 6 Feb 2021 15:44:57 +0000 (16:44 +0100)]
Revert "Fixed for loop problem, corrected all occurences that got linted"

This reverts commit 6626295fbc747d04f1a8d14f19ee48c789b90e50.

3 years agoAuto merge of #6684 - matthiaskrgr:versiontest_dont_break_upstream, r=flip1995
bors [Sat, 6 Feb 2021 13:38:36 +0000 (13:38 +0000)]
Auto merge of #6684 - matthiaskrgr:versiontest_dont_break_upstream, r=flip1995

tests: ignore check_that_clippy_has_the_same_major_version_as_rustc()inside the rustc repo

Do not check if clippy version matches rustc version when runnning tests inside the rustc repo.
This makes sure that upstream rustc maintainers do not have to deal with our test failing/mismatching versions
when the rustc version bump is happening.
cc #6683

We already do the "don't run inside the rustc-repo" workaround for the dogfood test:
https://github.com/rust-lang/rust-clippy/blob/a507c27660d05f37307369d30bee9e82ce3a11e1/tests/dogfood.rs#L16

changelog: None

3 years agoFixed for loop problem, corrected all occurences that got linted
Bastian Kersting [Sat, 6 Feb 2021 13:07:49 +0000 (14:07 +0100)]
Fixed for loop problem, corrected all occurences that got linted

3 years agolintcheck: cleanup, fix --only for git crates, better error msgs
Matthias Krüger [Sat, 6 Feb 2021 11:04:31 +0000 (12:04 +0100)]
lintcheck: cleanup, fix --only for git crates, better error msgs

3 years agolintcheck: add git source as an example and update logs
Matthias Krüger [Sat, 6 Feb 2021 10:36:06 +0000 (11:36 +0100)]
lintcheck: add git source as an example and update logs

3 years agoimplement the download_and_extract() step for git sources
Matthias Krüger [Sat, 6 Feb 2021 11:02:42 +0000 (12:02 +0100)]
implement the download_and_extract() step for git sources

3 years agolintcheck: make TomlCrate also accept git-data from lintcheck_crates.toml
Matthias Krüger [Fri, 5 Feb 2021 22:13:59 +0000 (23:13 +0100)]
lintcheck: make TomlCrate also accept git-data from lintcheck_crates.toml

3 years agolintcheck: update logs
Matthias Krüger [Sat, 6 Feb 2021 10:59:34 +0000 (11:59 +0100)]
lintcheck: update logs

3 years agoUse flatten instead of filter_map
Yusuke Tanaka [Sat, 6 Feb 2021 09:06:58 +0000 (18:06 +0900)]
Use flatten instead of filter_map

3 years agoAdd new lint `filter_map_identity`
Yusuke Tanaka [Wed, 3 Feb 2021 14:24:06 +0000 (23:24 +0900)]
Add new lint `filter_map_identity`

This commit adds a new lint named `filter_map_identity`. This lint is
the same as `flat_map_identity` except that it checks for `filter_map`.

Closes #6643

3 years agotests: ignore check_that_clippy_has_the_same_major_version_as_rustc() inside the...
Matthias Krüger [Fri, 5 Feb 2021 23:56:54 +0000 (00:56 +0100)]
tests: ignore check_that_clippy_has_the_same_major_version_as_rustc() inside the rustc repo.

Do not check if clippy version matches rustc version when runnning tests inside the rustc repo.
This makes sure that upstream rustc maintainers do not have to deal with our test failing/mismatching versions
when the rustc version bump is happening.
cc #6683

3 years agoBump clippy version
Mark Rousskov [Fri, 5 Feb 2021 23:29:05 +0000 (18:29 -0500)]
Bump clippy version