Commit Graph

5961 Commits

Author SHA1 Message Date
bors
8151a17422 Auto merge of #4049 - airt:fix-4033-search_is_some, r=flip1995
Fix #4033 search_is_some

Fixes #4033.

Suggest `any(|x| ..)` instead of `any(|&x| ..)` for `find(|&x| ..).is_some()` (Lint [search_is_some](https://rust-lang.github.io/rust-clippy/master/index.html#search_is_some))

FnDecl of `find`:

```rust
fn find<P>(&mut self, mut p: P) -> Option<Self::Item> where
    P: FnMut(&Self::Item) -> bool
```

FnDecl of `any`:

```rust
fn any<F>(&mut self, mut f: F) -> bool where
    F: FnMut(Self::Item) -> bool
```

If match on `|&_|` in closure of `find`, only use `|_|` in the suggestion.

PS. It's the first time that I have used the `hir` API, please correct me if there is any mistake 😺
2019-05-02 08:45:02 +00:00
bors
1cf5d7f04c Auto merge of #4035 - JoshMcguigan:useless_let_if_seq-3043, r=oli-obk
useless_let_if_seq handle interior mutability

fixes #3043

This passes all tests, including a new one specifically dealing with a type with interior mutability. The main thing I'm unsure of is whether the span I used in the call to `is_freeze` is the most appropriate span to use, or if it matters.
2019-05-02 07:03:28 +00:00
bors
2ed0b3bfa0 Auto merge of #4056 - matthiaskrgr:rustup__, r=Manishearth
more Use->DropTemps fixes

changelog: none
2019-05-01 21:07:44 +00:00
Matthias Krüger
f195680edb more Use->DropTemps fixes 2019-05-01 23:04:35 +02:00
Matthias Krüger
24e856f10a rustup https://github.com/rust-lang/rust/pull/60417/
cc https://github.com/rust-lang/rust/issues/60448
2019-05-01 22:18:16 +02:00
bors
990d6833b2 Auto merge of #4048 - matthiaskrgr:driver_version, r=phansch
clippy-driver: use rustc_tools_util to get version info.

changelog: make "clippy-driver -V" output the same information as "cargo clippy -V"
2019-05-01 18:42:58 +00:00
Matthias Krüger
6967cf59a4 clippy-driver: use rustc_tools_util to get version info.
This will add git hash information to `clippy-driver -V` output.
2019-05-01 10:43:16 +02:00
bors
5162ea5d0c Auto merge of #4051 - yaahallo:master, r=Manishearth
use clippy-preview instead of clippy in dogfood

changelog: switch dogfood tests to use cargo clippy-preview

closes #4050
2019-05-01 01:55:14 +00:00
Jane Lusby
0df6564d95 use clippy-preview instead of clippy in cargo 2019-04-30 18:29:25 -07:00
airt
d063516c85 check closure arguments before use it 2019-05-01 04:41:00 +08:00
airt
5d6a100f81 format code 2019-05-01 04:03:51 +08:00
bors
e56e325f85 Auto merge of #4039 - andrehjr:add-find-map-lints, r=flip1995
Add lints for find_map

changelog: adds lints for find_map and filter_map_next. Closes issue #3474

Hope I got everything correctly this time! Let me know if I missed something.
2019-04-30 20:00:33 +00:00
André Luis Leal Cardoso Junior
e428862c95 Update find(p).map(p) occurrences to use find_map(p) 2019-04-30 16:45:32 -03:00
André Luis Leal Cardoso Junior
b411391f8e Add lints for find_map 2019-04-30 16:45:28 -03:00
airt
c3fde34fd5 fix suggestion for search_is_some 2019-05-01 03:11:58 +08:00
airt
bd0b75f6c3 fix suggestion for search_is_some naively 2019-05-01 01:08:16 +08:00
airt
2d4d275519 change |&x| to |x| in stderr file 2019-05-01 01:06:15 +08:00
bors
86f73473c8 Auto merge of #4045 - matthiaskrgr:RTU, r=phansch
rustc_tools_util: try to handle case of not having CFG_RELEASE_CHANNEL better when getting compiler channel.

changelog: rustc_tools_util: try to handle case of not having CFG_RELEASE_CHANNEL better when getting compiler channel.
2019-04-30 07:20:58 +00:00
bors
d0ff1a585f Auto merge of #4047 - rust-lang:rustup, r=Centril
Rustup to rustc 1.36.0-nightly (f843ad60e 2019-04-30)

None
2019-04-30 05:34:55 +00:00
Manish Goregaokar
83519d3ca0 Rustup to rustc 1.36.0-nightly (f843ad60e 2019-04-30) 2019-04-29 22:31:39 -07:00
bors
f1eda09ea1 Auto merge of #4032 - phansch:add_tests, r=phansch
Add two more tests for redundant_closure

These two cases were fixed by #4008.

Closes #1439

changelog: none
2019-04-29 07:03:54 +00:00
bors
0a6f9416ab Auto merge of #4046 - rust-lang:rustup, r=phansch
Rustup to rustc 1.36.0-nightly (c7fcbfbf1 2019-04-29)

Updates to pass the lint introduced in https://github.com/rust-lang/rust/pull/60317

r? @oli-obk @mikerite
2019-04-29 05:43:23 +00:00
Manish Goregaokar
79f48d0573 Rustup to rustc 1.36.0-nightly (c7fcbfbf1 2019-04-29)
See https://github.com/rust-lang/rust/pull/60317
2019-04-28 22:42:16 -07:00
bors
9e07b3565d Auto merge of #4044 - matthiaskrgr:travis_sort_jobs, r=phansch
travis: sort integration test jobs so that the jobs taking the most time are run first

changelog: none
2019-04-28 21:34:09 +00:00
Matthias Krüger
8012b91198 rustc_tools_util: try to handle case of not having CFG_RELEASE_CHANNEL better when getting compiler channel. 2019-04-28 23:28:26 +02:00
Matthias Krüger
ee07fa82a4 travis: sort integration test jobs so that the jobs taking the most time are run first 2019-04-28 20:50:35 +02:00
bors
78d13e007f Auto merge of #4043 - rust-lang:map-clone-iter, r=matthiaskrgr
Suggest .copied() for map_clone on iterators too

fixes https://github.com/rust-lang/rust-clippy/issues/3958

changelog: Make `map_clone` suggest the newly-stable `Iterator::copied()` when applicable

r? @mikerite @matthiaskrgr
2019-04-28 18:39:00 +00:00
Manish Goregaokar
770de14505 Suggest .copied() for map_clone on iterators too 2019-04-28 11:14:39 -07:00
bors
fb61c21d9b Auto merge of #4042 - matthiaskrgr:toml_update, r=Manishearth
deps: bump toml from 0.4 to 0.5

changelog: none
2019-04-28 17:29:17 +00:00
Matthias Krüger
e01caad2a8 deps: bump toml from 0.4 to 0.5 2019-04-28 19:24:36 +02:00
bors
09a04226e4 Auto merge of #4040 - mikerite:fix-build-20190428, r=Manishearth
Fix breakage due to rust-lang/rust#60225

Wrote this up before I saw that Manish already started on a fix in #4038. It no doubt contains errors. Feel free to close.
2019-04-28 15:19:12 +00:00
Michael Wright
5ad79c2b3d Fix breakage due to rust-lang/rust#60225 2019-04-28 09:11:20 +02:00
Philipp Hansch
3f637cb369
Add two more tests for redundant_closure
These two cases were fixed by #4008.

Closes #1439

changelog: none
2019-04-26 06:48:27 +02:00
Josh Mcguigan
bb12d59551 cargo fmt 2019-04-25 19:41:23 -07:00
Josh Mcguigan
2bbe8be8d0 useless_let_if_seq handle interior mutability 2019-04-25 19:07:01 -07:00
bors
910d538ef1 Auto merge of #4008 - g-bartoszek:boxed-fnmut, r=phansch
Do not trigger redundant_closure for non-function types

fixes #3898

Added a check for the entity being called in the closure body to be a FnDef. This way lint does not trigger for ADTs (Box) but I'm not sure if it's correct and not too restrictive.

<!--
Thank you for making Clippy better!

We're collecting our changelog from pull request descriptions.
If your PR only updates to the latest nightly, you can leave the
`changelog` entry as `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.

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

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

changelog: Fix false positive in `redundant_closure` pertaining to non-function types
2019-04-25 18:13:47 +00:00
bors
6a0105e59f Auto merge of #4026 - cemiloten:working-on-#3981, r=flip1995
Attempt to fix #3981

Fixes #3981

Hi, hopefully this is correct, happy to have feedback.

changelog: Don't trigger `unnecessary_cast` inside a macro
2019-04-25 10:37:30 +00:00
cemil
8eae2d3707 Ignore unnecessary cast if inside macro 2019-04-25 12:06:20 +02:00
bors
8c0e038f6f Auto merge of #4029 - phansch:update_pulldown_cmark, r=oli-obk
Update pulldown_cmark to 0.5

We now no longer have to use our own wrapper around `Parser` and can use
the new `OffsetIter`.

changelog: none
2019-04-25 09:16:46 +00:00
bors
dbaa6f0a47 Auto merge of #4028 - phansch:skip_appveyor_on_pr_pushes, r=phansch
Only run AppVeyor on r+, try and the master branch

As it is right now, there is only one worker available in the `rust-lang-libs`
AppVeyor project and there are other repos as well that we share this worker
with. This has been a problem for us because we sometimes hit a bors timeout if there
are too many builds queued up.

To improve the situation, I think we could try to use AppVeyor a bit less
often. The average PR is not going to break windows related things anyway, so
it should be fine to run it on r+/try/master only.

changelog: none
2019-04-25 06:38:38 +00:00
bors
d84d3f8c66 Auto merge of #4030 - phansch:rustup190425, r=Manishearth
Rustup for https://github.com/rust-lang/rust/pull/59042

changelog: none
2019-04-25 05:33:37 +00:00
Philipp Hansch
1f5a3c6e52
Rustup for https://github.com/rust-lang/rust/pull/59042 2019-04-25 07:29:23 +02:00
Philipp Hansch
32e877ce13
Update pulldown_cmark to 0.5
We now no longer have to use our own wrapper around `Parser` and can use
the new `OffsetIter`.
2019-04-24 22:54:12 +02:00
bors
46af9c84f6 Auto merge of #4027 - kraai:remove-approx_constant-known-problems, r=phansch
Remove approx_constant known problems

Fixes #4025.

changelog: Remove `approx_constant`'s documentation's "Known problems" section.
2019-04-24 20:40:36 +00:00
Philipp Hansch
8d7a5fe126
Only run AppVeyor on r+, try and the master branch
As it is right now, there is only one worker available in the `rust-lang-libs`
AppVeyor project and there are other repos as well that we share this worker
with. This has been a problem for us because we sometimes hit a bors timeout if there
are too many builds queued up.

To improve the situation, I think we could try to use AppVeyor a bit less
often. The average PR is not going to break windows related things anyway, so
it should be fine to run it on r+/try/master only.
2019-04-24 20:25:59 +02:00
bors
111cf2a067 Auto merge of #4023 - phansch:add_test, r=flip1995
Add test for or_fun_call macro suggestion

changelog: none

Closes #1018
2019-04-24 17:16:59 +00:00
Matthew Kraai
5c7349d430 Remove approx_constant known problems
Fixes #4025.
2019-04-24 09:29:45 -07:00
bors
bcf0805614 Auto merge of #4022 - phansch:move_some_loop_tests, r=flip1995
UI test cleanup: Extract needless_range_loop tests

changelog: none
2019-04-24 08:29:33 +00:00
bors
253601a91c Auto merge of #4024 - kraai:suppress-let_and_return-if-let-has-attributes, r=flip1995
Suppress let_and_return if let has attributes

Fixes #3882.

changelog: suppress `let_and_return` if `let` has attributes
2019-04-24 07:29:35 +00:00
Matthew Kraai
c0479402e4 Suppress let_and_return if let has attributes
Fixes #3882.
2019-04-23 23:32:16 -07:00