Commit Graph

6121 Commits

Author SHA1 Message Date
bors
d57845ffdf Auto merge of #4071 - matthiaskrgr:sizeof, r=flip1995
trivially_copy_pass_by_ref: print size of type and limit in the lint message

changelog: trivially_copy_pass_by_ref: print size of type and limit in the lint message
2019-05-28 07:56:04 +00:00
bors
e119ab402f Auto merge of #4150 - rust-lang:rustup, r=oli-obk
Rustup to rustc 1.36.0-nightly (fa40a111f 2019-05-27)

changelog: none
2019-05-27 19:59:33 +00:00
Oliver Scherer
73d1830812 Rustup to rustc 1.36.0-nightly (fa40a111f 2019-05-27) 2019-05-27 21:58:54 +02:00
bors
7b501f0f6a Auto merge of #4137 - euclio:let-return, r=oli-obk
tweak `let_and_return` diagnostic

changelog: `let_and_return`: label the unnecessary let binding and convert the note to a structured
suggestion
2019-05-27 13:04:14 +00:00
bors
eb0a2884d2 Auto merge of #4149 - flip1995:rollup-6knpdqb, r=flip1995
Rollup of 2 pull requests

Successful merges:

 - #4102 (Fix match_same_arms to fail late)
 - #4119 (Improve non ascii literal)

Failed merges:

r? @ghost
2019-05-27 11:33:29 +00:00
Philipp Krones
dce670c73c
Rollup merge of #4119 - BO41:non_ascii_literal, r=flip1995
Improve non ascii literal

This PR improves the example of the [non_ascii_literal](https://rust-lang.github.io/rust-clippy/master/index.html#non_ascii_literal) lint.
It also makes it auto-fixable.

Please review. This is my first PR to this project.
(Thanks @flip1995 for the help :)

changelog: none
fixes #4117
2019-05-27 13:09:17 +02:00
Philipp Krones
f0a767352b
Rollup merge of #4102 - Urriel:fix/4096_match_same_arms, r=flip1995
Fix match_same_arms to fail late

Changes:
- Add a function search_same_list which return a list of matched expressions
- Change the match_same_arms implementation behavior. It will lint each same arms found.

fixes #4096

changelog: none
2019-05-27 13:09:16 +02:00
bors
cf81a3b6d0 Auto merge of #3832 - HarrisonMc555:use_last, r=flip1995
Implement "Use last" lint

Closes #3673

This lint checks the use of `x.get(x.len() - 1)` and suggests `x.last()` (where `x` is a `Vec`).

There's at least one more thing that needs to happen here. I believe I am correctly checking most of the scenarios and avoiding false positives. However, if different `Vec`s are used for the `x.get` and `y.len`, then it will emit a false positive. In other words, I need to check to make sure the `Vec`s are the same.

Also, a lot of these commits were temporary and not helpful to the project history...am I supposed to squash on merge? If so, how do I do that?

changelog: New lint: `get_last_with_len`
2019-05-27 11:04:38 +00:00
bors
abe139c7ac Auto merge of #4148 - sanxiyn:typo, r=Manishearth
Fix typo in comment
2019-05-27 03:38:19 +00:00
Seo Sanghyeon
2c53a3f970 Fix typo in comment 2019-05-27 12:32:04 +09:00
bors
46e64911ad Auto merge of #4145 - rust-lang:rustup, r=oli-obk
Rustup to rustc 1.36.0-nightly (2268d9923 2019-05-26)

changelog: none
2019-05-26 15:36:38 +00:00
Oliver Scherer
637e656451 Rustfmt 2019-05-26 17:36:21 +02:00
Oliver Scherer
fd2ecfcc89 Rustup to rustc 1.36.0-nightly (2268d9923 2019-05-26) 2019-05-26 16:47:26 +02:00
bors
577ee79668 Auto merge of #4141 - phansch:rustup5, r=oli-obk
Rustup to https://github.com/rust-lang/rust/pull/61026

None
2019-05-25 07:50:39 +00:00
Philipp Hansch
a650659d63
Rustup to https://github.com/rust-lang/rust/pull/61026 2019-05-25 09:45:07 +02:00
Andy Russell
effea41fe4
tweak let_and_return diagnostic
Label the unnecessary let binding and convert the note to structured
suggestion.
2019-05-24 14:52:55 -04:00
bors
d519ed433e Auto merge of #4135 - matthiaskrgr:rustup_obsol, r=phansch
rustup https://github.com/rust-lang/rust/pull/60803/

changelog: none
2019-05-24 14:08:09 +00:00
Matthias Krüger
c67d2b121a rustup https://github.com/rust-lang/rust/pull/60803/ 2019-05-24 15:25:36 +02:00
bors
07b484c9bd Auto merge of #4134 - phansch:rustup4, r=Manishearth
Rustup to https://github.com/rust-lang/rust/pull/59545

Needed due to signature changes of `item_children` in [the PR](https://github.com/rust-lang/rust/pull/59545/files) (just grep for `item_children` to see the changes)

I'm not really sure where the .stderr changes came from.
2019-05-24 06:24:12 +00:00
Philipp Hansch
aca56727db
Rustup to https://github.com/rust-lang/rust/pull/59545 2019-05-24 08:19:51 +02:00
Matthias Krüger
5d58163f7d trivially_copy_pass_by_ref: print size of type and limit in the lint message 2019-05-23 23:48:20 +02:00
bors
345ac82934 Auto merge of #4132 - phansch:rollup-0vxoimc, r=phansch
Rollup of 2 pull requests

Successful merges:

 - #4129 (update if_chain to 1.0.0)
 - #4130 (bump rustc_tools_util to 0.2.0 )

Failed merges:

r? @ghost
2019-05-23 19:29:17 +00:00
Philipp Hansch
89962ae165
Rollup merge of #4130 - matthiaskrgr:rtu_2, r=phansch
bump rustc_tools_util to 0.2.0

I want to push a new version to crates.io.

changelog: release rustc_tool_utils 0.2.0
2019-05-23 21:28:50 +02:00
Philipp Hansch
7e9db162b5
Rollup merge of #4129 - matthiaskrgr:if_chain, r=phansch
update if_chain to 1.0.0
2019-05-23 21:28:49 +02:00
bors
c984f77097 Auto merge of #4131 - phansch:rustup2, r=phansch
Rustup to https://github.com/rust-lang/rust/pull/60965

https://github.com/rust-lang/rust/pull/60965
2019-05-23 18:23:39 +00:00
Philipp Hansch
a316179850
Rustup to https://github.com/rust-lang/rust/pull/60965 2019-05-23 20:19:00 +02:00
Matthias Krüger
68281ad0b2 clippy: bump rustc_tools util version to 0.2
rustc_tools_util: fix typo in docs (readme)
2019-05-23 17:40:54 +02:00
Matthias Krüger
c8443c1528 rustc_tool_utils: bump version to 0.2.0 2019-05-23 17:30:05 +02:00
Matthias Krüger
655aef7c6c update if_chain to 1.0.0 2019-05-23 17:23:59 +02:00
bors
9c85b02f78 Auto merge of #4128 - matthiaskrgr:test_update, r=phansch
tests: update needless_bool test stderr

I'm getting a test failure otherwise with rust master (f688ba6089).

changelog: none
2019-05-23 15:12:29 +00:00
Matthias Krüger
3d0795bb04 tests: update needless_bool test stderr
I'm getting a test failure otherwise with rust master (f688ba6089).
2019-05-23 17:03:59 +02:00
bors
39d1fea6d6 Auto merge of #4126 - phansch:rustup, r=Manishearth
Rustup to https://github.com/rust-lang/rust/pull/60740

https://github.com/rust-lang/rust/pull/60740

changelog: none
2019-05-23 05:43:15 +00:00
Philipp Hansch
edb698105f
cargo fmt
Roses are red
Violets are blue
`Add rustfmt to a pre-commit hook` is what I should do.
2019-05-23 07:24:53 +02:00
Philipp Hansch
635a2fa5df
Rustup to https://github.com/rust-lang/rust/pull/60740
changelog: none
2019-05-23 07:19:25 +02:00
bors
64c1d3bea7 Auto merge of #4120 - phansch:needless_lifetimes_async_test_cleanup, r=Manishearth
Lifetimes UI test cleanup

* Removes an unneeded `#![warn(clippy::extra_unused_lifetimes)]` from
  the `needless_lifetimes` test - the tests for those are in a different
  file.

* Renames `unused_lt.{rs,stderr}` to `extra_unused_lifetimes.{rs,stderr}`
* Renames `lifetimes.{rs,stderr}` to `needless_lifetimes.{rs,stderr}`
2019-05-22 10:44:39 +00:00
bors
a8eeb7cdb1 Auto merge of #4125 - Manishearth:rustup, r=oli-obk
Rustup to rustc 1.36.0-nightly (dbfe70dfc 2019-05-22)

not 100% sure of the Symbol stuff

r? @oli-obk
2019-05-22 08:37:27 +00:00
Oliver Scherer
833ef0036a Disable cargo integration test due to clippy ICE 2019-05-22 10:36:20 +02:00
Manish Goregaokar
a6cf35264f Rustup to rustc 1.36.0-nightly (dbfe70dfc 2019-05-22) 2019-05-21 21:58:27 -07:00
Vincent Dal Maso
40f36658f5 Fix breaking tests
Changes:
- Fix stderr breaking the tests
- Adding tests over the if arms
2019-05-21 13:08:19 +02:00
Vincent Dal Maso
fa9f744c2c Add the common case search
Changes:
- Refactor the common case search into a function.
- Fix the useless Option around the vec in the search_same_list.
2019-05-21 13:08:19 +02:00
Philipp Krones
42d849c185
Formatting inside if_chain! macro 2019-05-21 10:45:38 +02:00
Harrison McCullough
f32c2fcb7e Implement get_last_with_len lint 2019-05-20 18:01:21 -06:00
Philipp Hansch
3f382999ab
Lifetimes UI test cleanup
* Removes an unneeded `#![warn(clippy::extra_unused_lifetimes)]` from
  the `needless_lifetimes` test - the tests for those are in a different
  file.

* Renames `unused_lt.{rs,stderr}` to `extra_unused_lifetimes.{rs,stderr}`
* Renames `lifetimes.{rs,stderr}` to `needless_lifetimes.{rs,stderr}`
2019-05-20 19:19:49 +02:00
BO41
36c8aaba8f Fix tests and make other ascii lints auto-fixable 2019-05-20 16:02:50 +02:00
bors
2cc23a5b18 Auto merge of #4118 - rust-lang:revert, r=phansch
Revert "Turn off two tests broken due to #4108"

This reverts commit 568a3ecfc3 which is unnecessary after https://github.com/rust-lang/rust-clippy/pull/4115

changelog: none
2019-05-20 13:36:26 +00:00
BO41
859b329603 Make non_ascii_literal auto-fixable 2019-05-20 15:23:38 +02:00
BO41
874de889dc Improve verbosity of non_ascii_literal lint example 2019-05-20 15:08:53 +02:00
Oliver Scherer
efac2e5eff Revert "Turn off two tests broken due to #4108"
This reverts commit 568a3ecfc3.
2019-05-20 12:31:53 +02:00
bors
fd56381015 Auto merge of #4088 - pJunger:check1, r=oli-obk
Added lint for TryFrom for checked integer conversion.

works towards #3947

Added lint for try_from for checked integer conversion.
Should recognize simple & straight-forward checked integer conversions.
2019-05-20 09:31:09 +00:00
bors
cbae9ed873 Auto merge of #4115 - ehuss:fix-compiletest, r=Manishearth
Fix compile-test from forcing a rebuild.

If the `compile-test` test was run, then running a cargo build command immediately after caused everything to be rebuilt. This is because the `compile-test` test was deleting all `.rmeta` files in the target directory. Cargo recently switched to always generating `.rmeta` files (https://github.com/rust-lang/cargo/pull/6883), and when the files are deleted, it thinks it needs to be rebuilt.

I am not very familiar with compiletest or clippy, so please take a close look and test this out (with the most recent nightly). In particular, make sure it doesn't revert the fixes from #3380 (it seems to work for me). Also @oli-obk mentioned something related in https://github.com/rust-lang/rust/pull/60190#issuecomment-493617188, and I want to make sure that is addressed as well.

Fixes #4114
2019-05-19 20:44:19 +00:00