]> git.lizzy.rs Git - rust.git/log
rust.git
3 years agoChanged fn body suggestion msg
Pierre-Andre Gagnon [Thu, 18 Feb 2021 22:32:55 +0000 (17:32 -0500)]
Changed fn body suggestion msg

3 years agoAuto merge of #6763 - flip1995:fix_lintcheck, r=matthiaskrgr
bors [Thu, 18 Feb 2021 22:15:42 +0000 (22:15 +0000)]
Auto merge of #6763 - flip1995:fix_lintcheck, r=matthiaskrgr

Fix lintcheck by excluding checked crates from workspace

r? `@matthiaskrgr`  cc `@camsteffen`

So `exclude` doesn't work with glob patterns, but it turns out that it works with `starts_with`.

changelog: none

3 years agoFix lintcheck by excluding checked crates from workspace
flip1995 [Thu, 18 Feb 2021 22:07:19 +0000 (23:07 +0100)]
Fix lintcheck by excluding checked crates from workspace

3 years agoAuto merge of #6759 - Y-Nak:fix-fp-of-result_unit_err, r=llogiq
bors [Thu, 18 Feb 2021 21:39:29 +0000 (21:39 +0000)]
Auto merge of #6759 - Y-Nak:fix-fp-of-result_unit_err, r=llogiq

Fix FP of result_unit_err when using type aliases

fixes #6546

changelog: none

3 years agoRollup merge of #82215 - TaKO8Ki:replace-if-let-while-let, r=varkor
Dylan DPC [Thu, 18 Feb 2021 15:57:37 +0000 (16:57 +0100)]
Rollup merge of #82215 - TaKO8Ki:replace-if-let-while-let, r=varkor

Replace if-let and while-let with `if let` and `while let`

This pull request replaces if-let and while-let with `if let` and `while let`.

closes https://github.com/rust-lang/rust/issues/82205

3 years agoast: Keep expansion status for out-of-line module items
Vadim Petrochenkov [Tue, 16 Feb 2021 21:56:07 +0000 (00:56 +0300)]
ast: Keep expansion status for out-of-line module items

Also remove `ast::Mod` which is mostly redundant now

3 years agoFix FP of result_unit_err when using type aliases
Yoshitomo Nakanishi [Thu, 18 Feb 2021 09:35:25 +0000 (18:35 +0900)]
Fix FP of result_unit_err when using type aliases

3 years agoAuto merge of #81993 - flip1995:clippyup, r=Manishearth
bors [Wed, 17 Feb 2021 22:37:42 +0000 (22:37 +0000)]
Auto merge of #81993 - flip1995:clippyup, r=Manishearth

Update Clippy

Biweekly Clippy update

r? `@Manishearth`

3 years agoAdded detailled suggs for new case
Pierre-Andre Gagnon [Wed, 17 Feb 2021 21:41:50 +0000 (16:41 -0500)]
Added detailled suggs for new case

3 years agoFix match_same_arms with SpanlessEq changes
Cameron Steffen [Wed, 17 Feb 2021 16:02:22 +0000 (10:02 -0600)]
Fix match_same_arms with SpanlessEq changes

3 years agoMake expr_fallback FnMut
Cameron Steffen [Wed, 17 Feb 2021 15:35:55 +0000 (09:35 -0600)]
Make expr_fallback FnMut

3 years agoTeach SpanlessEq binding IDs
Cameron Steffen [Wed, 17 Feb 2021 15:34:35 +0000 (09:34 -0600)]
Teach SpanlessEq binding IDs

3 years agoAuto merge of #6750 - flip1995:lintcheck_options, r=matthiaskrgr
bors [Wed, 17 Feb 2021 12:53:31 +0000 (12:53 +0000)]
Auto merge of #6750 - flip1995:lintcheck_options, r=matthiaskrgr

Lintcheck and an options for command line options

Make it possible to add command line options to the clippy invocation of the lintcheck-tool

changelog: none

r? `@matthiaskrgr`

I found that this will be really helpful if we use a separate repository and want to maintain a all-lints-passing list of crates. See my early experimentation here: https://github.com/flip1995/clippy-lintcheck

```
git submodule update --init
cargo run -- --mode=all
```

Will run the lintcheck tool on all the specified crates in `config/` in that repository.

3 years agoreplace if-let and while-let with `if let` and `while let`
Takayuki Maeda [Wed, 17 Feb 2021 10:26:38 +0000 (19:26 +0900)]
replace if-let and while-let with `if let` and `while let`

3 years agolintcheck: Add a note that -Wclippy::all is enabled by default
flip1995 [Wed, 17 Feb 2021 07:34:23 +0000 (08:34 +0100)]
lintcheck: Add a note that -Wclippy::all is enabled by default

3 years agoReformat clippy_dev README
flip1995 [Tue, 16 Feb 2021 17:09:34 +0000 (18:09 +0100)]
Reformat clippy_dev README

3 years agoAuto merge of #6749 - camsteffen:test-all, r=Manishearth
bors [Tue, 16 Feb 2021 17:03:03 +0000 (17:03 +0000)]
Auto merge of #6749 - camsteffen:test-all, r=Manishearth

Test workspace at once

changelog: none

Follow-up to #6733

3 years agoTest workspace at once
Cameron Steffen [Tue, 16 Feb 2021 16:39:24 +0000 (10:39 -0600)]
Test workspace at once

3 years agoAdd workspace to manifest
Cameron Steffen [Fri, 12 Feb 2021 22:34:42 +0000 (16:34 -0600)]
Add workspace to manifest

3 years agolintcheck: Slight improvements to the error reporting
flip1995 [Tue, 16 Feb 2021 15:58:00 +0000 (16:58 +0100)]
lintcheck: Slight improvements to the error reporting

3 years agoAdd command line options option to lintcheck crates config
flip1995 [Tue, 16 Feb 2021 12:38:01 +0000 (13:38 +0100)]
Add command line options option to lintcheck crates config

3 years agoAuto merge of #6662 - Y-Nak:default-numeric-fallback, r=flip1995
bors [Tue, 16 Feb 2021 09:58:49 +0000 (09:58 +0000)]
Auto merge of #6662 - Y-Nak:default-numeric-fallback, r=flip1995

New lint: default_numeric_fallback

fixes #6064
r? `@flip1995`

As we discussed in [here](https://rust-lang.zulipchat.com/#narrow/stream/257328-clippy/topic/Issue.20.236064/near/224647188) and [here](https://rust-lang.zulipchat.com/#narrow/stream/257328-clippy/topic/Issue.20clippy.236064/near/224746333),   I start implementing this lint from the strictest version.
In this PR, I'll allow the below two cases to pass the lint to reduce FPs.

1. Appearances of unsuffixed numeric literals in `Local` if `Local` has a type annotation, for example:
```rust
// Good.
let x: i32 = 1;

// Also good.
let x: (i32, i32) = if cond {
   (1, 2)
} else {
   (2, 3)
};
```

2. Appearances of unsuffixed numeric literals in args of `Call` or `MethodCall`  if corresponding arguments of their signature have concrete types, for example:
```rust
fn foo_mono(x: i32) -> i32 {
    x
}

fn foo_poly<T>(t: T) -> t {
    t
}

// Good.
let x = foo_mono(13);

// Still bad.
let x: i32 = foo_poly(13);
```

changelog: Added restriction lint: `default_numeric_fallback`

3 years agoChange to span_lint_and_sugg from span_lint_and_help
Yoshitomo Nakanishi [Tue, 16 Feb 2021 09:07:09 +0000 (18:07 +0900)]
Change to span_lint_and_sugg from span_lint_and_help

3 years agoAuto merge of #6744 - matthiaskrgr:lintcheck, r=flip1995
bors [Tue, 16 Feb 2021 08:20:17 +0000 (08:20 +0000)]
Auto merge of #6744 - matthiaskrgr:lintcheck, r=flip1995

more lintcheck updates

* do some refactoring and renaming here and there
* add comments to functions
* fix bug where git repos would not get checked out to the proper commits (cmd was not actually run in repo directory :sweat_smile: )
* print warnings if we can't clone or check out a git repo
* filter out noise from cargo-metadata errors and lint messages that contained absolute file paths (these would change with every pinned-nightly bump, polluting the logs)

changelog: more lintcheck refactoring and fixes for git crates

3 years agoHandle struct ctor case
Yoshitomo Nakanishi [Tue, 16 Feb 2021 02:20:51 +0000 (11:20 +0900)]
Handle struct ctor case

3 years agolintcheck: update logs
Matthias Krüger [Mon, 15 Feb 2021 22:25:06 +0000 (23:25 +0100)]
lintcheck: update logs

3 years agolintcheck: filter out messages that come from cargo-metadata errors or contain absolu...
Matthias Krüger [Mon, 15 Feb 2021 22:13:41 +0000 (23:13 +0100)]
lintcheck: filter out messages that come from cargo-metadata errors or contain absolute paths to rustc source files

The latter is especially annoying because the paths would change every time we bumped the pinned nightly version.

3 years agolintcheck: print warnings if we can't check out or clone a git repo
Matthias Krüger [Mon, 15 Feb 2021 21:46:58 +0000 (22:46 +0100)]
lintcheck: print warnings if we can't check out or clone a git repo

3 years agolintcheck: fix bug in downloade_and_extract() for git sources: we need to execute...
Matthias Krüger [Mon, 15 Feb 2021 21:36:49 +0000 (22:36 +0100)]
lintcheck: fix bug in downloade_and_extract() for git sources: we need to execute "git checkout xy" inside the repo dir!

3 years agolintcheck: put some code into a gather_stats() function
Matthias Krüger [Sun, 14 Feb 2021 17:59:32 +0000 (18:59 +0100)]
lintcheck: put some code into a gather_stats() function

3 years agolintcheck: rename a few symbols, add documentation to functions
Matthias Krüger [Sun, 14 Feb 2021 17:51:53 +0000 (18:51 +0100)]
lintcheck: rename a few symbols, add documentation to functions

3 years agolintcheck: rename struct field
Matthias Krüger [Sun, 14 Feb 2021 17:37:08 +0000 (18:37 +0100)]
lintcheck: rename struct field

3 years agoAuto merge of #6743 - rust-lang:update-compiletest, r=Manishearth
bors [Mon, 15 Feb 2021 19:18:41 +0000 (19:18 +0000)]
Auto merge of #6743 - rust-lang:update-compiletest, r=Manishearth

Upgrade compiletest-rs to 0.6 and tester to 0.9

These updates allow us to specify multiple testnames for `TESTNAME` by
providing a comma separated list of testnames.

The new version of compiletest-rs also includes `bless` support, but is
not enabled with this PR.

cc #5394

changelog: none

3 years agoUpgrade compiletest-rs to 0.6 and tester to 0.9
Philipp Hansch [Mon, 15 Feb 2021 06:36:25 +0000 (07:36 +0100)]
Upgrade compiletest-rs to 0.6 and tester to 0.9

These updates allow us to specify multiple testnames for `TESTNAME`.

The new version of compiletest-rs also includes `bless` support, but is
not enabled with this PR.

3 years agoOnly store a LocalDefId in hir::ImplItem.
Camille GILLOT [Sat, 30 Jan 2021 22:25:03 +0000 (23:25 +0100)]
Only store a LocalDefId in hir::ImplItem.

3 years agoOnly store a LocalDefId in hir::TraitItem.
Camille GILLOT [Sat, 30 Jan 2021 19:46:50 +0000 (20:46 +0100)]
Only store a LocalDefId in hir::TraitItem.

3 years agoOnly store a LocalDefId in hir::Item.
Camille GILLOT [Sat, 30 Jan 2021 16:47:51 +0000 (17:47 +0100)]
Only store a LocalDefId in hir::Item.

Items are guaranteed to be HIR owner.

3 years agoUse ItemId as a strongly typed index.
Camille GILLOT [Sat, 30 Jan 2021 11:06:04 +0000 (12:06 +0100)]
Use ItemId as a strongly typed index.

3 years agoAdd more tests for default_numeric_fallback
Yoshitomo Nakanishi [Mon, 15 Feb 2021 14:33:27 +0000 (23:33 +0900)]
Add more tests for default_numeric_fallback

3 years agoAdd fn_sig_opt to get fn signature from HirId
Yoshitomo Nakanishi [Mon, 15 Feb 2021 13:40:28 +0000 (22:40 +0900)]
Add fn_sig_opt to get fn signature from HirId

3 years agoAdd some restrictions to default_numeric_fallback to avoid FNs
Yoshitomo Nakanishi [Mon, 15 Feb 2021 05:22:31 +0000 (14:22 +0900)]
Add some restrictions to default_numeric_fallback to avoid FNs

3 years agoAuto merge of #6741 - ThibsG:BlockInIfConditions1141, r=flip1995
bors [Sun, 14 Feb 2021 15:55:12 +0000 (15:55 +0000)]
Auto merge of #6741 - ThibsG:BlockInIfConditions1141, r=flip1995

Do not lint when the closure is called using an iterator

Fix FP when the closure is used in an iterator for `blocks_in_if_conditions` lint

FIxes: #1141

changelog: none

3 years agoDo not lint when the closure is called using an iterator
ThibsG [Sun, 14 Feb 2021 15:21:12 +0000 (16:21 +0100)]
Do not lint when the closure is called using an iterator

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 #81238 - RalfJung:copy-intrinsics, r=m-ou-se
bors [Sat, 13 Feb 2021 20:30:07 +0000 (20:30 +0000)]
Auto merge of #81238 - RalfJung:copy-intrinsics, r=m-ou-se

directly expose copy and copy_nonoverlapping intrinsics

This effectively un-does https://github.com/rust-lang/rust/pull/57997. That should help with `ptr::read` codegen in debug builds (and any other of these low-level functions that bottoms out at `copy`/`copy_nonoverlapping`), where the wrapper function will not get inlined. See the discussion in https://github.com/rust-lang/rust/pull/80290 and https://github.com/rust-lang/rust/issues/81163.

Cc `@bjorn3` `@therealprof`

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 agoFix clippy's path to the copy intrinsics.
Mara Bos [Sat, 13 Feb 2021 17:58:54 +0000 (18:58 +0100)]
Fix clippy's path to the copy intrinsics.

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 agoMade parens addition smarter and added tests with bless
boolean_coercion [Fri, 12 Feb 2021 22:33:08 +0000 (00:33 +0200)]
Made parens addition smarter and added tests with bless

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 agoFixed typos and updated to matches! where applicable
boolean_coercion [Fri, 12 Feb 2021 09:53:52 +0000 (11:53 +0200)]
Fixed typos and updated to matches! where applicable

3 years agoFixed doctests that shouldn't have been compiled
boolean_coercion [Thu, 11 Feb 2021 11:15:06 +0000 (13:15 +0200)]
Fixed doctests that shouldn't have been compiled

3 years agoRan bless and rustfmt
boolean_coercion [Thu, 11 Feb 2021 10:46:11 +0000 (12:46 +0200)]
Ran bless and rustfmt

3 years agoChanged applicability to MaybeIncorrect because of surrounding braces
boolean_coercion [Thu, 11 Feb 2021 10:42:20 +0000 (12:42 +0200)]
Changed applicability to MaybeIncorrect because of surrounding braces

3 years agofrom_str_radix_10 should be done
boolean_coercion [Thu, 11 Feb 2021 10:30:23 +0000 (12:30 +0200)]
from_str_radix_10 should be done

3 years agoImplemented majority of from_str_radix_10
boolean_coercion [Thu, 11 Feb 2021 00:30:37 +0000 (02:30 +0200)]
Implemented majority of from_str_radix_10

3 years agoAdded boilerplate
boolean_coercion [Wed, 10 Feb 2021 19:47:04 +0000 (21:47 +0200)]
Added boilerplate

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 agoMerge commit '70c0f90453701e7d6d9b99aaa1fc6a765937b736' into clippyup
flip1995 [Thu, 11 Feb 2021 14:04:38 +0000 (15:04 +0100)]
Merge commit '70c0f90453701e7d6d9b99aaa1fc6a765937b736' into clippyup

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