Commit graph

6462 commits

Author SHA1 Message Date
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
Philipp Hansch
de24a74b45
Add test for or_fun_call macro suggestion
Closes #1018
2019-04-24 08:11:20 +02:00
Philipp Hansch
0fbe49d8a6
UI test cleanup: Extract needless_range_loop tests 2019-04-24 08:01:16 +02:00
bors
92d703f974 Auto merge of #4021 - kraai:change-cast_lossless-warning, r=Manishearth
Change "if types change" to "if you later change the type"

Fixes #3964.

changelog: change wording of `cast_lossless` message
2019-04-24 05:27:17 +00:00
Matthew Kraai
9a43e09d77 Change "if types change" to "if you later change the type"
Fixes #3964.
2019-04-23 16:53:09 -07:00
bors
9897442f27 Auto merge of #4018 - rust-lang:or_fn_call_variants, r=oli-obk
Ignore non-const ctor expressions in or_fn_call

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

Should have been fixed by #919, however that focuses on const ctor expressions only, and `.or(Some(local))` isn't const.

This also automatically ignores things like `.or(Some(local.clone())` which we don't actually want to do; I need to figure out what to do here.

changelog: Fixed false positive in [`or_fn_call`] pertaining to enum variant constructors

r? @oli-obk @phansch
2019-04-23 18:24:10 +00:00
bors
65d60e95fb Auto merge of #4020 - rust-lang:rustup, r=phansch
Rustup to rustc 1.36.0-nightly (fe0a415b4 2019-04-23)

r? @oli-obk @phansch
2019-04-23 16:19:29 +00:00
Manish Goregaokar
f3455cda81 Rustup to rustc 1.36.0-nightly (fe0a415b4 2019-04-23) 2019-04-23 08:25:45 -07:00
Manish Goregaokar
b03cf3ff97 Add test 2019-04-23 08:01:42 -07:00
Manish Goregaokar
7e2043de2f Ignore all enum and struct constructors in lints about *or(call()) 2019-04-23 08:01:42 -07:00
bors
6ae46a8c4d Auto merge of #4017 - Xanewok:wip-disambiguate-extern, r=oli-obk
compiletest: Disambiguate extern crate deps shared with the compiler

Fixes #4015.

changelog: Handle deps shared with the compiler in the internal compiletest suite

Attempts to fix the multiple matching crates error using the `--extern dep=path` disambiguation. This only includes `serde` at the moment because it's the only problematic dep right now (is inside Rust sysroot and pulled via `extern crate` in the test suite).

I'm not exactly sure this is the right approach (FWIW it fixes the issue locally), please do tell if this should be done differently.
2019-04-23 08:37:44 +00:00