]> git.lizzy.rs Git - rust.git/log
rust.git
2 years agofix line numbers
Matthias Geier [Wed, 11 Aug 2021 18:42:01 +0000 (20:42 +0200)]
fix line numbers

2 years agorustfmt
Matthias Geier [Wed, 11 Aug 2021 18:35:48 +0000 (20:35 +0200)]
rustfmt

2 years agoAdd test for similar names "iter" and "item"
Matthias Geier [Wed, 11 Aug 2021 18:32:26 +0000 (20:32 +0200)]
Add test for similar names "iter" and "item"

2 years agosimilar_names: allow "iter" and "item"
Matthias Geier [Sat, 7 Aug 2021 16:11:49 +0000 (18:11 +0200)]
similar_names: allow "iter" and "item"

2 years agoAuto merge of #7536 - LeSeulArtichaut:redundant-allocation-doc, r=giraffate
bors [Sat, 7 Aug 2021 13:19:06 +0000 (13:19 +0000)]
Auto merge of #7536 - LeSeulArtichaut:redundant-allocation-doc, r=giraffate

Add missing backtick in docs for `redundant_allocation`

changelog: none

2 years agoAuto merge of #7534 - LeSeulArtichaut:7517-closure-too-many-lines, r=flip1995
bors [Sat, 7 Aug 2021 13:05:53 +0000 (13:05 +0000)]
Auto merge of #7534 - LeSeulArtichaut:7517-closure-too-many-lines, r=flip1995

Don't emit `too_many_lines` for closures

changelog: don't emit the [`too_many_lines`] lint inside closures to avoir duplicated diagnostics.

Fixes #7517.

2 years agoAuto merge of #7533 - Valentine-Mario:vec_extend_to_append, r=xFrednet
bors [Sat, 7 Aug 2021 12:54:13 +0000 (12:54 +0000)]
Auto merge of #7533 - Valentine-Mario:vec_extend_to_append, r=xFrednet

fix bug on mutable ref

fixes: #7524

This PR is related to issue #7524
changelog:  [`extend_with_drain`] Improve code suggestion for mutable and immutable references

2 years agoAdd missing backtick in docs for `redundant_allocation`
LeSeulArtichaut [Thu, 5 Aug 2021 17:06:35 +0000 (19:06 +0200)]
Add missing backtick in docs for `redundant_allocation`

2 years agofixed bug that had to deal with mut and non mut suggestion
valentine-mario [Thu, 5 Aug 2021 15:15:44 +0000 (16:15 +0100)]
fixed bug that had to deal with mut and non mut suggestion

2 years agoDon't emit `too_many_lines` for closures
LeSeulArtichaut [Thu, 5 Aug 2021 13:38:57 +0000 (15:38 +0200)]
Don't emit `too_many_lines` for closures

2 years agoAuto merge of #7528 - matthiaskrgr:nedlbrw, r=Manishearth
bors [Wed, 4 Aug 2021 09:17:10 +0000 (09:17 +0000)]
Auto merge of #7528 - matthiaskrgr:nedlbrw, r=Manishearth

needless_borrow: try to make lint example a bit more illustrating

changelog: none

2 years agoAuto merge of #7529 - giraffate:update_node_version, r=flip1995,llogiq
bors [Wed, 4 Aug 2021 09:02:48 +0000 (09:02 +0000)]
Auto merge of #7529 - giraffate:update_node_version, r=flip1995,llogiq

Use node v12.x in CI

In https://github.com/rust-lang/rust-clippy/pull/7528#issuecomment-892281632, remark-cli version has been updated recently and it requires to use ESM module: https://github.com/remarkjs/remark/releases/tag/14.0.0. Node version in CI was v10.24.1, it seems to be old.

changelog: none

2 years agoAddress warnings for remark check
Takayuki Nakata [Wed, 4 Aug 2021 07:22:15 +0000 (16:22 +0900)]
Address warnings for remark check

2 years agoUse node v12.x in CI
Takayuki Nakata [Wed, 4 Aug 2021 01:27:05 +0000 (10:27 +0900)]
Use node v12.x in CI

2 years agoneedless_borrow: try to make lint example a bit more illustrating
Matthias Krüger [Tue, 3 Aug 2021 22:21:25 +0000 (00:21 +0200)]
needless_borrow: try to make lint example a bit more illustrating

2 years agoAuto merge of #7525 - xFrednet:7172-update-define-conf-macro, r=flip1995
bors [Mon, 2 Aug 2021 20:09:11 +0000 (20:09 +0000)]
Auto merge of #7525 - xFrednet:7172-update-define-conf-macro, r=flip1995

Updated `define_Conf!` to support multi-line doc comments

Updated the `define_Conf!` macro to support multi-line doc comments for readability. This also enables configuration documentation to have multiple paragraphs.

I've also added the `metadata-collector-lint` feature to the CI build and testing tasks. (I would think that we want this, now that we officially switched over)

---

Now a small informal explanation what this PR changes (just for fun):

* *Once upon a time there was a monster. It was handsome, supportive and happy to dig through the best source code it has ever seen. Spanning over hundreds of lines and reading over complete crates, it was purely marvels!*

    *However, there was one region in its territory that wasn't clean and well formatted like the rest. That was the mighty `define_Conf` macro. The monster would have cleaned it up a long time ago but, the previous ruler of this kingdom a powerful Python script was prohibiting it. But now that the old king was slain in the great battle of rust-1.54.0, everything was possible again. Our lovely monster was now able to grab its cleaning equipment and get some nice formatting into the now unprotected area.*

    *Said and done! Let this day go down in history!*

(I'll be the first to admit, that I'm a bit lost today. And I'm also procrastinating on some other discussions where I have some catching up to do... Oh, well, this was fun)

---

changelog: none

r? `@flip1995`

2 years agoAdded the `metadata-collector-lint` feature to the CI
xFrednet [Mon, 2 Aug 2021 15:55:21 +0000 (17:55 +0200)]
Added the `metadata-collector-lint` feature to the CI

2 years agoUpdated `define_Conf!` to support multi-line doc comments
xFrednet [Mon, 2 Aug 2021 15:25:58 +0000 (17:25 +0200)]
Updated `define_Conf!` to support multi-line doc comments

2 years agoAuto merge of #7522 - dswij:map-flatten-result, r=llogiq
bors [Mon, 2 Aug 2021 07:27:09 +0000 (07:27 +0000)]
Auto merge of #7522 - dswij:map-flatten-result, r=llogiq

Cover `Result` on `map_flatten` lint

Closes #7496

changelog: `[map_flatten]` handles `Result` type

2 years agoAuto merge of #7519 - Jarcho:rustfmt_fix, r=giraffate
bors [Mon, 2 Aug 2021 00:56:54 +0000 (00:56 +0000)]
Auto merge of #7519 - Jarcho:rustfmt_fix, r=giraffate

Workaround rust-lang/rustfmt#4477 - relative paths in `path` attribute

See rust-lang/rustfmt#4477
changelog: None

2 years agoHandle `Result` on `map_flatten` lint
Dharma Saputra Wijaya [Sun, 1 Aug 2021 09:47:29 +0000 (17:47 +0800)]
Handle `Result` on `map_flatten` lint

Adds a check on `.map(..).flatten()` on `Result` type that follows the
behaviour on `Option` type.

2 years agoAuto merge of #7520 - Jarcho:while_let_7510, r=Manishearth
bors [Sat, 31 Jul 2021 15:15:41 +0000 (15:15 +0000)]
Auto merge of #7520 - Jarcho:while_let_7510, r=Manishearth

Fix `while_let_on_iterator` - #7510

fixes: #7510
changelog: Suggest re-borrowing mutable references in `while_let_on_iterator`

2 years agoFix `while_let_on_iterator`
Jason Newcomb [Sat, 31 Jul 2021 13:32:54 +0000 (09:32 -0400)]
Fix `while_let_on_iterator`
When the iterator is one field within a local correctly check for usages of the field

2 years agoFix `while_let_on_iterator`
Jason Newcomb [Sat, 31 Jul 2021 02:59:20 +0000 (22:59 -0400)]
Fix `while_let_on_iterator`
Reborrow mutable references rather then take a reference to them.

2 years agoWorkaround rust-lang/rustfmt#4477 - relative paths in `path` attribute
Jason Newcomb [Sat, 31 Jul 2021 03:43:04 +0000 (23:43 -0400)]
Workaround rust-lang/rustfmt#4477 - relative paths in `path` attribute

2 years agoAuto merge of #7509 - xFrednet:patch-1, r=flip1995
bors [Thu, 29 Jul 2021 14:44:46 +0000 (14:44 +0000)]
Auto merge of #7509 - xFrednet:patch-1, r=flip1995

Updated config value name in change log for 1.54

Hey, I've noticed that the change log for 1.54 references the avoid_breaking_exported_api configuration with its Rust name, not the name it actually has in the config file. This should fix it for everyone, as the blog post references our change log on the master branch. Just a very small PR xD

changelog: none

(This is the change log xD)

r? `@flip1995`

2 years agoUpdated config value name in changelog for 1.54
Fridtjof Stoldt [Thu, 29 Jul 2021 14:26:26 +0000 (16:26 +0200)]
Updated config value name in changelog for 1.54

2 years agoAuto merge of #7507 - LeSeulArtichaut:patch-1, r=flip1995
bors [Thu, 29 Jul 2021 12:41:52 +0000 (12:41 +0000)]
Auto merge of #7507 - LeSeulArtichaut:patch-1, r=flip1995

Remove `or_patterns` feature gate in example

changelog: removed `or_patterns` feature gate in the code example for the [`unnested_or_patterns`] lint

2 years agoRemove `or_patterns` feature gate in example
Léo Lanteri Thauvin [Thu, 29 Jul 2021 12:23:12 +0000 (14:23 +0200)]
Remove `or_patterns` feature gate in example

2 years agoAuto merge of #7498 - xFrednet:changelog-1-55, r=flip1995
bors [Thu, 29 Jul 2021 12:03:04 +0000 (12:03 +0000)]
Auto merge of #7498 - xFrednet:changelog-1-55, r=flip1995

Updated changelog for 1.55

This has again been a bit of work, but I'm happy to notice that my English is still improving, and I'm getting faster at these things. That's a very nice side effect of contributing and getting feedback on reviews :blush:

Moving on, there were a few things that I was unsure about:
* The PR rust-lang/rust#86717 changes an old entry in the change log, is this worth mentioning? I've left it out for now.
* The stabilization of `cargo clippy --fix` is quite awesome and important IMO. It sadly gets a bit lost in the *Other* entry, as it's the last one. Do we maybe want to move it somewhere else or change the headline order for this release?
* I've listed the introduction of the new `suspicious` group under the *Moves and Deprecations* section. Is this alright, or should it be moved to the *Other* section as well?
* Last but definitely not least, some fun! I've used the :tada: emoji in the `cargo clippy --fix` entry, is this okay?

Sorry for the bombardment of questions xD

---

The PR already includes the entries for the new metadata collection and website updates. These are not merged yet, but should probably be to make this correct. This might also require the commit hashes to be updated (Not sure on this, though). It would actually be super fitting to get this into this release as we also stabilize `--fix`. TODOs:
* [x] Merge metadata collection PRs:
  1. #7279
  2. #7298
  3. #7420 (Hope to not get any merge conflicts)

---

[Rendered :newspaper:](https://github.com/xFrednet/rust-clippy/blob/changelog-1-55/CHANGELOG.md)

r? `@flip1995`

changelog: none

2 years agoUpdated changelog for 1.55
xFrednet [Tue, 27 Jul 2021 22:44:24 +0000 (00:44 +0200)]
Updated changelog for 1.55

Co-authored-by: Philipp Krones <hello@philkrones.com>
Co-authored-by: Takayuki Nakata <f.seasons017@gmail.com>
2 years agoAuto merge of #7504 - flip1995:rename-lints, r=flip1995
bors [Thu, 29 Jul 2021 10:14:31 +0000 (10:14 +0000)]
Auto merge of #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 #7498)

2 years agoRename two lints to comply with our lint naming convention
flip1995 [Thu, 29 Jul 2021 10:10:18 +0000 (12:10 +0200)]
Rename two lints to comply with our lint naming convention

self_named_constructor -> self_named_constructors
append_instead_of_extend -> extend_with_drain

2 years agoAuto merge of #7503 - flip1995:rustup, r=flip1995
bors [Thu, 29 Jul 2021 09:35:13 +0000 (09:35 +0000)]
Auto merge of #7503 - flip1995:rustup, r=flip1995

Rustup

r? `@ghost`

changelog: none

2 years agoBump Clippy Version -> 0.1.56
flip1995 [Thu, 29 Jul 2021 09:15:11 +0000 (11:15 +0200)]
Bump Clippy Version -> 0.1.56

2 years agoBump nightly version -> 2021-07-29
flip1995 [Thu, 29 Jul 2021 09:14:53 +0000 (11:14 +0200)]
Bump nightly version -> 2021-07-29

2 years agoMerge remote-tracking branch 'upstream/master' into rustup
flip1995 [Thu, 29 Jul 2021 09:14:25 +0000 (11:14 +0200)]
Merge remote-tracking branch 'upstream/master' into rustup

2 years agoAuto merge of #7502 - flip1995:rollup-y3ho3w0, r=flip1995
bors [Wed, 28 Jul 2021 13:15:43 +0000 (13:15 +0000)]
Auto merge of #7502 - flip1995:rollup-y3ho3w0, r=flip1995

Rollup of 3 pull requests

Successful merges:

 - #7279 (Adapting the lint list to Clippy's new metadata format)
 - #7298 (Switch CI to new metadata collection)
 - #7420 (Update lint documentation to use markdown headlines)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup

changelog: rollup

2 years agoRollup merge of #7420 - xFrednet:7172-update-lint-documentation, r=flip1995
Philipp Krones [Wed, 28 Jul 2021 13:06:27 +0000 (15:06 +0200)]
Rollup merge of #7420 - xFrednet:7172-update-lint-documentation, 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: #7172

Note: This should be merged with the other metadata collection related PRs.

2 years agoRollup merge of #7298 - flip1995:ci-switch-to-monster, r=xFrednet,flip1995
Philipp Krones [Wed, 28 Jul 2021 13:06:26 +0000 (15:06 +0200)]
Rollup merge of #7298 - flip1995:ci-switch-to-monster, r=xFrednet,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 #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 #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 :tada:

2 years agoRollup merge of #7279 - xFrednet:7172-adapt-website-to-new-format, r=flip1995
Philipp Krones [Wed, 28 Jul 2021 13:06:26 +0000 (15:06 +0200)]
Rollup merge of #7279 - xFrednet:7172-adapt-website-to-new-format, 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 #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. :bug:

---

Closes: #1303
Closes: #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`

2 years agoRun cargo collect-metadata in cargo dev serve
flip1995 [Wed, 28 Jul 2021 13:05:11 +0000 (15:05 +0200)]
Run cargo collect-metadata in cargo dev serve

2 years agoAdapting the lint list to Clippy's new metadata format
xFrednet [Tue, 18 May 2021 22:08:31 +0000 (00:08 +0200)]
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>
2 years agoFix last occurence of **What it does:**
flip1995 [Wed, 28 Jul 2021 11:51:16 +0000 (13:51 +0200)]
Fix last occurence of **What it does:**

2 years agoUpdate lint documentation to use markdown headlines
xFrednet [Fri, 2 Jul 2021 18:37:11 +0000 (20:37 +0200)]
Update lint documentation to use markdown headlines

2 years agoRemove old python lint doc generation scripts
flip1995 [Wed, 28 Jul 2021 12:15:34 +0000 (14:15 +0200)]
Remove old python lint doc generation scripts

2 years agoUpdate deploy CI
flip1995 [Mon, 31 May 2021 15:46:20 +0000 (17:46 +0200)]
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.

2 years agoUpdate tests
Jacob Pratt [Thu, 3 Jun 2021 07:31:27 +0000 (03:31 -0400)]
Update tests

2 years agoAuto merge of #83484 - JulianKnodt:infer, r=oli-obk,lcnr
bors [Tue, 27 Jul 2021 16:24:45 +0000 (16:24 +0000)]
Auto merge of #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.

2 years agoAuto merge of #7492 - nfejzic:improve_help, r=Manishearth
bors [Tue, 27 Jul 2021 14:39:08 +0000 (14:39 +0000)]
Auto merge of #7492 - nfejzic:improve_help, r=Manishearth

Explain flags missing in cargo check in --help

This commit closes #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`.

2 years agoAuto merge of #7488 - DevinR528:bantype-fix, r=camsteffen
bors [Tue, 27 Jul 2021 14:27:11 +0000 (14:27 +0000)]
Auto merge of #7488 - DevinR528:bantype-fix, r=camsteffen

Add primitive type support to disallowed_type lint

Closes #6845

changelog: Enable the banning of primitive types in [`disallowed_type`]

2 years agoAdd primitive type support to disallowed_type lint
Devin Ragotzy [Thu, 22 Jul 2021 12:40:24 +0000 (08:40 -0400)]
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

2 years agoHandle `--no-deps` flag same as `--fix` flag.
Nadir Fejzic [Tue, 27 Jul 2021 09:13:42 +0000 (11:13 +0200)]
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`.

2 years agoAuto merge of #7466 - xFrednet:5393-use-more-diagnostic-items, r=flip1995
bors [Tue, 27 Jul 2021 08:19:23 +0000 (08:19 +0000)]
Auto merge of #7466 - xFrednet:5393-use-more-diagnostic-items, 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 :broom: :wastebasket:

---

changelog: none

(only internal improvements)

cc: #5393

2 years agoActually infer args in visitors
kadmin [Thu, 6 May 2021 15:33:44 +0000 (15:33 +0000)]
Actually infer args in visitors

2 years agoAuto merge of #7495 - camsteffen:extern-conflict, r=Manishearth
bors [Mon, 26 Jul 2021 16:56:05 +0000 (16:56 +0000)]
Auto merge of #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 https://github.com/rust-lang/rust-clippy/issues/7343
----------------------------------------------------------------------
```

2 years agoImprove conflicting rlibs error again
Cameron Steffen [Mon, 26 Jul 2021 15:32:26 +0000 (10:32 -0500)]
Improve conflicting rlibs error again

2 years agoInclude more information in --help
Nadir Fejzic [Mon, 26 Jul 2021 14:14:29 +0000 (16:14 +0200)]
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.

2 years agoAuto merge of #7493 - xFrednet:7220-fix-new-without-default-impl-type, r=camsteffen
bors [Mon, 26 Jul 2021 12:20:54 +0000 (12:20 +0000)]
Auto merge of #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 :upside_down_face:

2 years agoAuto merge of #7485 - camsteffen:add-test-externs, r=flip1995
bors [Mon, 26 Jul 2021 12:06:07 +0000 (12:06 +0000)]
Auto merge of #7485 - camsteffen:add-test-externs, r=flip1995

Add to test third party crates list

changelog: none

2 years agoAuto merge of #7477 - F3real:needless_continue, r=flip1995
bors [Mon, 26 Jul 2021 11:52:55 +0000 (11:52 +0000)]
Auto merge of #7477 - F3real:needless_continue, r=flip1995

Enhance needless continue to detect loop {continue;}

Fixes #7417

changelog: Report [`needless_continue`] in `loop { continue; }` case

2 years agoAuto merge of #7484 - camsteffen:author, r=flip1995
bors [Mon, 26 Jul 2021 11:41:46 +0000 (11:41 +0000)]
Auto merge of #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

2 years agoPrefer a code snipped over formatting the self type (`new_without_default`)
xFrednet [Sun, 25 Jul 2021 18:35:51 +0000 (20:35 +0200)]
Prefer a code snipped over formatting the self type (`new_without_default`)

2 years agoauthor: check block.expr: None
Cameron Steffen [Sun, 25 Jul 2021 21:35:35 +0000 (16:35 -0500)]
author: check block.expr: None

2 years agoExplain flags missing in cargo check in --help
Nadir Fejzic [Sun, 25 Jul 2021 12:41:35 +0000 (14:41 +0200)]
Explain flags missing in cargo check in --help

This commit closes #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.

2 years agoAuto merge of #83723 - cjgillot:ownernode, r=petrochenkov
bors [Sun, 25 Jul 2021 11:11:02 +0000 (11:11 +0000)]
Auto merge of #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 https://github.com/rust-lang/rust/pull/83114

2 years agoIntroduce OwnerNode::Crate.
Camille GILLOT [Sun, 25 Jul 2021 10:03:24 +0000 (12:03 +0200)]
Introduce OwnerNode::Crate.

2 years agoAdd inferred args to typeck
kadmin [Mon, 26 Apr 2021 18:19:23 +0000 (18:19 +0000)]
Add inferred args to typeck

2 years agoAdd generic arg infer
kadmin [Sat, 24 Apr 2021 21:41:57 +0000 (21:41 +0000)]
Add generic arg infer

2 years agoAuto merge of #7482 - xFrednet:7306-document-repeat-once-fp, r=giraffate
bors [Sat, 24 Jul 2021 14:15:32 +0000 (14:15 +0000)]
Auto merge of #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: #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 :upside_down_face:

2 years agoclippy::author improvements
Cameron Steffen [Fri, 23 Jul 2021 21:02:09 +0000 (16:02 -0500)]
clippy::author improvements

2 years agoAdd clippy_utils and if_chain to extern crate list
Cameron Steffen [Fri, 23 Jul 2021 22:00:00 +0000 (17:00 -0500)]
Add clippy_utils and if_chain to extern crate list

2 years agoupdate clippy ui test 'future_not_send.stderr' to match
chaz-kiker [Fri, 23 Jul 2021 17:30:52 +0000 (12:30 -0500)]
update clippy ui test 'future_not_send.stderr' to match
the new diagnostic messages

2 years agoClean up unnecessary unwraps
F3real [Fri, 23 Jul 2021 15:30:27 +0000 (17:30 +0200)]
Clean up unnecessary unwraps

2 years agoDocumented constant expression evaluation for `repeat_once`
xFrednet [Fri, 23 Jul 2021 15:02:45 +0000 (17:02 +0200)]
Documented constant expression evaluation for `repeat_once`

2 years agoLint on continue expression without semi-colon
F3real [Thu, 22 Jul 2021 20:21:34 +0000 (22:21 +0200)]
Lint on continue expression without semi-colon

2 years agoEmit needless_continue warning if loop ends on continue
F3real [Wed, 21 Jul 2021 21:15:29 +0000 (23:15 +0200)]
Emit needless_continue warning if loop ends on continue

2 years agoEnhance needless continue to detect loop {continue;}
F3real [Tue, 20 Jul 2021 15:29:03 +0000 (17:29 +0200)]
Enhance needless continue to detect loop {continue;}

2 years agoAuto merge of #7221 - th1000s:keyword_, r=giraffate
bors [Mon, 19 Jul 2021 14:18:59 +0000 (14:18 +0000)]
Auto merge of #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

2 years agoMerge commit '4c41a222ca5d1325fb4b6709395bd06e766cc042' into clippyup
flip1995 [Mon, 19 Jul 2021 09:52:05 +0000 (11:52 +0200)]
Merge commit '4c41a222ca5d1325fb4b6709395bd06e766cc042' into clippyup

2 years agoAuto merge of #7476 - flip1995:rustup, r=flip1995
bors [Mon, 19 Jul 2021 09:49:57 +0000 (09:49 +0000)]
Auto merge of #7476 - flip1995:rustup, r=flip1995

Rustup

r? `@ghost`

Out of cycle sync for 2 ICE fixes #7470 #7471 #7473

changelog: none

2 years agoBump nightly version -> 2021-07-19
flip1995 [Mon, 19 Jul 2021 09:49:03 +0000 (11:49 +0200)]
Bump nightly version -> 2021-07-19

2 years agoMerge remote-tracking branch 'upstream/master' into rustup
flip1995 [Mon, 19 Jul 2021 09:38:40 +0000 (11:38 +0200)]
Merge remote-tracking branch 'upstream/master' into rustup

2 years agoAuto merge of #7470 - DevinR528:fix-ice7447, r=flip1995
bors [Mon, 19 Jul 2021 09:22:34 +0000 (09:22 +0000)]
Auto merge of #7470 - DevinR528:fix-ice7447, r=flip1995

Add check if ty has_escaping_bound_vars in zero_sized_map_values lint

Fixes: #7447
changelog: fix ICE in [`zero_sized_map_values`]

2 years agoAuto merge of #7403 - Anthuang:redundant-method-names, r=Manishearth
bors [Mon, 19 Jul 2021 06:49:51 +0000 (06:49 +0000)]
Auto merge of #7403 - Anthuang:redundant-method-names, r=Manishearth

New lint: [`self_named_constructor`]

Adds the `self_named_constructor` lint for detecting when an implemented method has the same name as the type it is implemented for.

changelog: [`self_named_constructor`]

closes: #7142

2 years agoRun bless
Anthony Huang [Mon, 19 Jul 2021 05:21:06 +0000 (01:21 -0400)]
Run bless

3 years agoAuto merge of #7474 - camsteffen:binop, r=Manishearth
bors [Sun, 18 Jul 2021 15:52:49 +0000 (15:52 +0000)]
Auto merge of #7474 - camsteffen:binop, r=Manishearth

Use lang items for BinOp lints

changelog: none

3 years agofix(clippy): add missing allow(dyn_drop)
Michael Howell [Sun, 18 Jul 2021 14:57:03 +0000 (07:57 -0700)]
fix(clippy): add missing allow(dyn_drop)

3 years agoAuto merge of #7473 - Jarcho:ice_7340, r=Manishearth
bors [Sun, 18 Jul 2021 03:32:31 +0000 (03:32 +0000)]
Auto merge of #7473 - Jarcho:ice_7340, r=Manishearth

Fix ICE in `is_integer_const`

fixes: #7340
changelog: Fix ICE in `modulo_one` in const contexts

3 years agoFactor BinOp utils
Cameron Steffen [Fri, 16 Jul 2021 19:41:19 +0000 (14:41 -0500)]
Factor BinOp utils

3 years agoUse From to convert BinOpKind
Cameron Steffen [Mon, 28 Jun 2021 19:05:48 +0000 (14:05 -0500)]
Use From to convert BinOpKind

3 years agoFix ICE in `is_integer_const` when the expression is inside an `AnonConst` body
Jason Newcomb [Sat, 17 Jul 2021 23:01:19 +0000 (19:01 -0400)]
Fix ICE in `is_integer_const` when the expression is inside an `AnonConst` body

3 years agoAuto merge of #7471 - flip1995:ice-7410, r=giraffate
bors [Fri, 16 Jul 2021 14:26:08 +0000 (14:26 +0000)]
Auto merge of #7471 - flip1995:ice-7410, r=giraffate

Fix ICE in redundant_pattern_matching

Fixes #7410

changelog: Fix ICE in `redundant_pattern_matching` in `no_std` crates.

3 years agoAuto merge of #87140 - camsteffen:pat-slice-refs, r=oli-obk
bors [Fri, 16 Jul 2021 13:35:48 +0000 (13:35 +0000)]
Auto merge of #87140 - camsteffen:pat-slice-refs, r=oli-obk

Remove refs from Pat slices

Changes `PatKind::Or(&'hir [&'hir Pat<'hir>])` to `PatKind::Or(&'hir [Pat<'hir>])` and others. This is more consistent with `ExprKind`, saves a little memory, and is a little easier to use.

3 years agoFix ICE in redundant_pattern_matching
flip1995 [Fri, 16 Jul 2021 08:45:28 +0000 (10:45 +0200)]
Fix ICE in redundant_pattern_matching

3 years agoRollup merge of #87069 - sexxi-goose:copy_ref_always, r=nikomatsakis
Guillaume Gomez [Fri, 16 Jul 2021 08:08:05 +0000 (10:08 +0200)]
Rollup merge of #87069 - sexxi-goose:copy_ref_always, r=nikomatsakis

ExprUseVisitor: Treat ByValue use of Copy types as ImmBorrow

r? ```@nikomatsakis```

3 years agoAdd check if ty has_escaping_bound_vars in zero_sized_map_values lint
Devin Ragotzy [Thu, 15 Jul 2021 22:35:43 +0000 (18:35 -0400)]
Add check if ty has_escaping_bound_vars in zero_sized_map_values lint

3 years agoAuto merge of #7460 - camsteffen:run-from-source, r=Manishearth
bors [Thu, 15 Jul 2021 21:53:17 +0000 (21:53 +0000)]
Auto merge of #7460 - camsteffen:run-from-source, r=Manishearth

Add instructions to run from source

changelog: none

We often get messages on Zulip asking how to install and run Clippy from source. This adds instructions to the readme. I also added a note explaining that `cargo install --path . --force` is bad, which I just decided after some investigating. I use macOS. It would be nice to get some tests on other platforms to see if this is correct.

3 years agoRemove refs from pat slices
Cameron Steffen [Wed, 14 Jul 2021 21:17:04 +0000 (16:17 -0500)]
Remove refs from pat slices

3 years agoAdd instructions to run from source
Cameron Steffen [Tue, 13 Jul 2021 15:09:24 +0000 (10:09 -0500)]
Add instructions to run from source