Philipp Krones [Mon, 27 May 2019 11:09:17 +0000 (13:09 +0200)]
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 :)
Philipp Krones [Mon, 27 May 2019 11:09:16 +0000 (13:09 +0200)]
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.
bors [Mon, 27 May 2019 11:04:38 +0000 (11:04 +0000)]
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?
bors [Fri, 24 May 2019 06:24:12 +0000 (06:24 +0000)]
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.
bors [Sun, 19 May 2019 20:44:19 +0000 (20:44 +0000)]
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.
bors [Sun, 19 May 2019 11:13:40 +0000 (11:13 +0000)]
Auto merge of #4109 - Manishearth:backport-merge, r=phansch
Merge backport branches into master
Attempt 2 at https://github.com/rust-lang/rust-clippy/pull/4103
This does nothing to the code, however it keeps the backport branches in master history, so that deleting a branch won't accidentally break old rustc builds
bors [Sun, 19 May 2019 08:13:16 +0000 (08:13 +0000)]
Auto merge of #4100 - phansch:add_stderr_length_check, r=flip1995
Add a stderr file length check to clippy_dev
This adds a check to `clippy_dev` that enforces a maximum line count for
`stderr` files. CI will fail if the line count is exceeded. It's
currently set to `320` lines.
Ideally this would be implemented in `compiletest-rs` but there are
plans to move Rust's `compiletest` into the `compiletest-rs` repository
and I don't want to do the work in `compiletest` twice. However, I also
don't want to wait until the move is done, so I added the check to
`clippy_dev` until it makes sense to add it to compiletest-rs.
bors [Fri, 17 May 2019 23:47:49 +0000 (23:47 +0000)]
Auto merge of #4110 - rust-lang:symbolic_wasteland, r=oli-obk
Prevent symbocalypse
r? @Manishearth
This is strictly better, we can just not modify rustc and bump solely the clippy submodule and then implement diagnostic lang items without beta looming over us
Philipp Hansch [Thu, 16 May 2019 05:31:56 +0000 (07:31 +0200)]
Add a stderr file length check to clippy_dev
This adds a check to `clippy_dev` that enforces a maximum line count for
`stderr` files. CI will fail if the line count is exceeded. It's
currently set to `320` lines.
Ideally this would be implemented in `compiletest-rs` but there are
plans to move Rust's `compiletest` into the `compiletest-rs` repository
and I don't want to do the work in `compiletest` twice. However, I also
don't want to wait until the move is done, so I added the check to
`clippy_dev` until it makes sense to add it to compiletest-rs.
Vincent Dal Maso [Thu, 16 May 2019 09:27:45 +0000 (11:27 +0200)]
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 behaviour. It will lint each same arms found.