]> git.lizzy.rs Git - rust.git/log
rust.git
5 years agoRun update_lints.py script
flip1995 [Mon, 15 Oct 2018 13:18:26 +0000 (15:18 +0200)]
Run update_lints.py script

5 years agoAdd test for non-crate-level inner attributes
flip1995 [Tue, 18 Sep 2018 09:36:59 +0000 (11:36 +0200)]
Add test for non-crate-level inner attributes

5 years agoDiffer between inner and outer attributes
flip1995 [Tue, 18 Sep 2018 09:35:53 +0000 (11:35 +0200)]
Differ between inner and outer attributes

5 years agoAdd tests
flip1995 [Mon, 3 Sep 2018 13:34:33 +0000 (15:34 +0200)]
Add tests

5 years agoAdd cfg_attr(rustfmt) lint
flip1995 [Mon, 3 Sep 2018 13:34:12 +0000 (15:34 +0200)]
Add cfg_attr(rustfmt) lint

5 years agoMerge #3344
bors[bot] [Fri, 2 Nov 2018 15:08:38 +0000 (15:08 +0000)]
Merge #3344

3344: Added lints `into_iter_on_ref` and `into_iter_on_array`. r=phansch a=kennytm

Fixes #1565.

`into_iter_on_array` is a correctness lint against `into_iter()` on `[T; n]` and `PathBuf` (please provide a concise noun that covers both types 🙃).

`into_iter_on_ref` is a style lint against `into_iter()` on `&C` where `C` is `[T]`, `Vec<T>`, `BTreeSet<T>` etc.

Both suggests replacing the `into_iter()` with `iter()` or `iter_mut()`.

`into_iter_on_array` is a correctness lint since it is very likely the standard library would provide an `into_iter()` method for `[T; n]` (rust-lang/rust#25725) and existing type inference of `[a, b, c].into_iter()` will be broken. `PathBuf` is also placed under this lint since `PathBuf::into_iter` currently doesn't exist and it makes some sense to implement `IntoIterator` on it yielding `OsString`s.

Co-authored-by: kennytm <kennytm@gmail.com>
5 years agoAddressed comments.
kennytm [Tue, 23 Oct 2018 17:50:18 +0000 (01:50 +0800)]
Addressed comments.

5 years agoFix dogfood error.
kennytm [Mon, 22 Oct 2018 03:44:09 +0000 (11:44 +0800)]
Fix dogfood error.

5 years agoAdded lints `into_iter_on_ref` and `into_iter_on_array`. Fix #1565.
kennytm [Sat, 20 Oct 2018 20:03:38 +0000 (04:03 +0800)]
Added lints `into_iter_on_ref` and `into_iter_on_array`. Fix #1565.

5 years agoMerge #3161
bors[bot] [Fri, 2 Nov 2018 13:17:59 +0000 (13:17 +0000)]
Merge #3161

3161: New lint: Unknown clippy lints r=phansch a=flip1995

This is the Clippy version of the `rustc` lint `unknown_lints`. The behavior of this lint is pretty much the same.

Before this is merged a small change in the compiler needs to be done: `CheckLintNameResult` needs to be public. See rust-lang/rust#54106

Co-authored-by: flip1995 <9744647+flip1995@users.noreply.github.com>
Co-authored-by: flip1995 <hello@philkrones.com>
5 years agoAllow single_match_else
flip1995 [Fri, 2 Nov 2018 13:00:46 +0000 (14:00 +0100)]
Allow single_match_else

5 years agoUpdate stderr
flip1995 [Fri, 2 Nov 2018 11:58:16 +0000 (12:58 +0100)]
Update stderr

5 years agoAdd copyright statement©
flip1995 [Thu, 1 Nov 2018 20:02:15 +0000 (21:02 +0100)]
Add copyright statement©

5 years agoFix typos
flip1995 [Thu, 1 Nov 2018 19:37:13 +0000 (20:37 +0100)]
Fix typos

5 years agoFix dogfood error
flip1995 [Thu, 13 Sep 2018 08:54:02 +0000 (10:54 +0200)]
Fix dogfood error

5 years agoFix typo and indentation
flip1995 [Mon, 10 Sep 2018 15:52:44 +0000 (17:52 +0200)]
Fix typo and indentation

5 years agorun update_lints script
flip1995 [Mon, 10 Sep 2018 15:26:48 +0000 (17:26 +0200)]
run update_lints script

5 years agoAdd tests for unknwon_clippy_lints lint
flip1995 [Mon, 10 Sep 2018 15:21:50 +0000 (17:21 +0200)]
Add tests for unknwon_clippy_lints lint

5 years agoAdd new lint: unknwon_clippy_lintsg
flip1995 [Mon, 10 Sep 2018 15:09:15 +0000 (17:09 +0200)]
Add new lint: unknwon_clippy_lintsg

5 years agoMerge #3402
bors[bot] [Fri, 2 Nov 2018 11:30:03 +0000 (11:30 +0000)]
Merge #3402

3402: clippy: fix pedantic warnings and run clippy::pedantic lints on the codebase r=oli-obk a=matthiaskrgr

Turn on pedantic lints in dogfood and base tests.

needless_bool: fix clippy::items-after-statements
redundant_pattern_matching: fix clippy::similar-names
mods.rs: fix clippy::explicit-iter-loop
returns.rs: allow clippy::cast-possible-wrap

Fixes #3172

Co-authored-by: Matthias Krüger <matthias.krueger@famsik.de>
5 years agoclippy: fix pedantic warnings and run clippy::pedantic lints on the codebase.
Matthias Krüger [Fri, 2 Nov 2018 11:12:14 +0000 (12:12 +0100)]
clippy: fix pedantic warnings and run clippy::pedantic lints on the codebase.

Turn on pedantic lints in dogfood and base tests.

needless_bool: fix clippy::items-after-statements
redundant_pattern_matching: fix clippy::similar-names
mods.rs: fix clippy::explicit-iter-loop
returns.rs: allow clippy::cast-possible-wrap

Fixes #3172

5 years agoMerge #3387
bors[bot] [Fri, 2 Nov 2018 07:58:00 +0000 (07:58 +0000)]
Merge #3387

3387: Replace big if/else expression with match r=flip1995 a=mikerite

Co-authored-by: Michael Wright <mikerite@lavabit.com>
5 years agoMerge #3397 #3398
bors[bot] [Fri, 2 Nov 2018 07:34:38 +0000 (07:34 +0000)]
Merge #3397 #3398

3397: UI test cleanup: Extract expect_fun_call tests r=matthiaskrgr a=phansch

Note that the new stderr file does not include a `shadow-unrelated`
error, because the new UI test file does not use `#![warn(clippy::all)]`

cc #2038

3398: UI test cleanup: Extract match_overlapping_arm tests r=matthiaskrgr a=phansch

cc #2038

Co-authored-by: Philipp Hansch <dev@phansch.net>
5 years agoMerge #3388
bors[bot] [Fri, 2 Nov 2018 06:29:40 +0000 (06:29 +0000)]
Merge #3388

3388: RIIR update lints: Generate deprecated lints r=phansch a=phansch

The update script now also generates the 'register_removed' section in
`clippy_lints/src/lib.rs`.

Also, instead of using `let mut store ...`, I added a new identifier
line so that the replacement will continue to work in case `let mut
store ...` ever changes.

cc #2882

Co-authored-by: Philipp Hansch <dev@phansch.net>
5 years agoUI test cleanup: Extract match_overlapping_arm tests
Philipp Hansch [Tue, 30 Oct 2018 20:36:52 +0000 (21:36 +0100)]
UI test cleanup: Extract match_overlapping_arm tests

5 years agoUI test cleanup: Extract expect_fun_call tests
Philipp Hansch [Tue, 30 Oct 2018 20:21:23 +0000 (21:21 +0100)]
UI test cleanup: Extract expect_fun_call tests

Note that the new stderr file does not include a `shadow-unrelated`
error, because the new UI test file does not use `#![warn(clippy::all)]`

5 years agoMerge #3389
bors[bot] [Fri, 2 Nov 2018 05:49:49 +0000 (05:49 +0000)]
Merge #3389

3389: ci: when installing rust-toolchain-installer-master, install it in debug mode to save some time on ci. r=phansch a=matthiaskrgr

the compiletime optimizations probably take longer than the speedup we get when executing the optimized binary vs debug build.

Co-authored-by: Matthias Krüger <matthias.krueger@famsik.de>
5 years agoMerge pull request #3395 from phansch/add_missing_coc_file
Manish Goregaokar [Thu, 1 Nov 2018 21:24:36 +0000 (14:24 -0700)]
Merge pull request #3395 from phansch/add_missing_coc_file

Add missing code of conduct file

5 years agoMerge pull request #3394 from phansch/rustup
Manish Goregaokar [Thu, 1 Nov 2018 20:57:27 +0000 (13:57 -0700)]
Merge pull request #3394 from phansch/rustup

Fix clippy build failure on latest master

5 years agoAdd missing code of conduct file
Philipp Hansch [Thu, 1 Nov 2018 20:31:05 +0000 (21:31 +0100)]
Add missing code of conduct file

We are already using the Rust code of conduct, this just ticks off an
additional checkbox [here][community].

This version is taken from [rustfmt][rustfmt].

[community]: https://github.com/rust-lang-nursery/rust-clippy/community
[rustfmt]: https://github.com/rust-lang-nursery/rustfmt

5 years agoFix clippy build failure on latest master
Philipp Hansch [Thu, 1 Nov 2018 19:35:23 +0000 (20:35 +0100)]
Fix clippy build failure on latest master

5 years agoUse slice patterns instead of padding
Michael Wright [Thu, 1 Nov 2018 05:06:47 +0000 (07:06 +0200)]
Use slice patterns instead of padding

5 years agoMerge #3392
bors[bot] [Wed, 31 Oct 2018 21:08:34 +0000 (21:08 +0000)]
Merge #3392

3392: UI test cleanup: Extract for_loop_over_x tests r=matthiaskrgr a=phansch

cc #2038

Co-authored-by: Philipp Hansch <dev@phansch.net>
5 years agoFix dogfood and pedantic lints
Philipp Hansch [Wed, 31 Oct 2018 20:54:30 +0000 (21:54 +0100)]
Fix dogfood and pedantic lints

5 years agoMerge #3368
bors[bot] [Wed, 31 Oct 2018 10:21:51 +0000 (10:21 +0000)]
Merge #3368

3368: added downsides to "known problems" for get_unwrap lint r=flip1995 a=humean

As a beginner I found this lint to be confusing because I was not sure how the `Option` type disappeared as conceptually I know that my `.get()` and Index could fail. Initially I thought maybe the compiler or clippy was smart enough to understand that it was impossible for my `.get()` to fail in this particular case, but it was explained to me that using the Index syntax is just shorthand for directly unwrapping the value:

https://doc.rust-lang.org/src/std/collections/hash/map.rs.html#1547

For beginners or users trying to iterate quickly it seems common to litter your code with `unwrap` or `except` as placeholders for where some explicit error handling might need to take place. I think it should be warned that using Index is merely more concise, but doesn't at all reduce the risk of panics and might in fact cause you to miss handling them in a future refactor.

Co-authored-by: Michael Rutter <michael.john.rutter@gmail.com>
Co-authored-by: Michael Rutter <humean@users.noreply.github.com>
5 years agoci: when installing rust-toolchain-installer-master, install it in debug mode to...
Matthias Krüger [Wed, 31 Oct 2018 10:18:20 +0000 (11:18 +0100)]
ci: when installing rust-toolchain-installer-master, install it in debug mode to save some time in ci.

the compiletime optimizations probably take longer than the speedup we get when executing the optimized binary vs debug build.

5 years agoMerge #3378
bors[bot] [Wed, 31 Oct 2018 07:18:42 +0000 (07:18 +0000)]
Merge #3378

3378: Fix lint_without_lint_pass r=phansch a=mikerite

Co-authored-by: Michael Wright <mikerite@lavabit.com>
Co-authored-by: flip1995 <hello@philkrones.com>
5 years agoRIIR update lints: Generate deprecated lints
Philipp Hansch [Wed, 31 Oct 2018 07:03:50 +0000 (08:03 +0100)]
RIIR update lints: Generate deprecated lints

The update script now also generates the 'register_removed' section in
`clippy_lints/src/lib.rs`.

Also, instead of using `let mut store ...`, I added a new identifier
line so that the replacement will continue to work in case `let mut
store ...` ever changes.

5 years agoMerge #3370
bors[bot] [Wed, 31 Oct 2018 06:48:49 +0000 (06:48 +0000)]
Merge #3370

3370: bool_comparison triggers 3 times on same code r=phansch a=mrbuzz

Fix #3335

Co-authored-by: Giorgio Gambino <gambnio.giorgio@gmail.com>
5 years agoMerge #3386
bors[bot] [Wed, 31 Oct 2018 06:03:33 +0000 (06:03 +0000)]
Merge #3386

3386: docs: use_self: hightlight the "should be" code sample as rust code as well. r=phansch a=matthiaskrgr

Co-authored-by: Matthias Krüger <matthias.krueger@famsik.de>
5 years agoReplace big if/else expression with match
Michael Wright [Wed, 31 Oct 2018 04:26:29 +0000 (06:26 +0200)]
Replace big if/else expression with match

5 years agoMerge #3384
bors[bot] [Wed, 31 Oct 2018 01:29:36 +0000 (01:29 +0000)]
Merge #3384

3384: make ci use master rustc instead of nightly r=flip1995 a=matthiaskrgr

Co-authored-by: Matthias Krüger <matthias.krueger@famsik.de>
5 years agoRevert "travis: work around temporary test failure due to rustc crashing on hyper."
Matthias Krüger [Tue, 30 Oct 2018 14:58:35 +0000 (15:58 +0100)]
Revert "travis: work around temporary test failure due to rustc crashing on hyper."

This reverts commit 326270ad1221b54028f9d029881fa0b1fb742db9.

5 years agoRevert "appveyor: use rustc nightly instead of master"
Matthias Krüger [Tue, 30 Oct 2018 14:42:15 +0000 (15:42 +0100)]
Revert "appveyor: use rustc nightly instead of master"

This reverts commit 3f0161918871403b4e0547191a93f395b8bf5b35.

5 years agoRevert "Disable rust master toolchain build temporarily"
Matthias Krüger [Tue, 30 Oct 2018 14:41:59 +0000 (15:41 +0100)]
Revert "Disable rust master toolchain build temporarily"

This reverts commit 0d899562cd805bd4335d6ee8d88e2bf1f743f000.

5 years agodocs: use_self: hightlight the "should be" code sample as rust code as well.
Matthias Krüger [Wed, 31 Oct 2018 00:42:17 +0000 (01:42 +0100)]
docs: use_self: hightlight the "should be" code sample as rust code as well.

5 years agoUI test cleanup: Extract for_loop_over_x tests
Philipp Hansch [Tue, 30 Oct 2018 20:25:34 +0000 (21:25 +0100)]
UI test cleanup: Extract for_loop_over_x tests

5 years agoMerge pull request #3382 from rust-lang-nursery/rustup
Manish Goregaokar [Tue, 30 Oct 2018 04:23:18 +0000 (04:23 +0000)]
Merge pull request #3382 from rust-lang-nursery/rustup

Rustup to rustc 1.31.0-nightly (fb2446ad5 2018-10-30)

5 years agoRustup to rustc 1.31.0-nightly (fb2446ad5 2018-10-30)
Manish Goregaokar [Tue, 30 Oct 2018 04:06:37 +0000 (04:06 +0000)]
Rustup to rustc 1.31.0-nightly (fb2446ad5 2018-10-30)

5 years ago Fix #3335 rev2: bool_comparison triggers 3 times on same code
Giorgio Gambino [Mon, 29 Oct 2018 21:23:45 +0000 (22:23 +0100)]
 Fix #3335 rev2: bool_comparison triggers 3 times on same code

5 years agoUpdate .stderr file
flip1995 [Mon, 29 Oct 2018 19:55:52 +0000 (20:55 +0100)]
Update .stderr file

5 years agoRegister MISTYPED_LITERAL_SUFFIXES lint
flip1995 [Mon, 29 Oct 2018 19:54:21 +0000 (20:54 +0100)]
Register MISTYPED_LITERAL_SUFFIXES lint

5 years agoRewrite registered lint collection
flip1995 [Mon, 29 Oct 2018 19:37:47 +0000 (20:37 +0100)]
Rewrite registered lint collection

5 years agoFix lint_without_lint_pass
Michael Wright [Fri, 12 Oct 2018 06:09:04 +0000 (08:09 +0200)]
Fix lint_without_lint_pass

5 years agoMerge #3380
bors[bot] [Mon, 29 Oct 2018 11:45:03 +0000 (11:45 +0000)]
Merge #3380

3380: compiletest: clean rmeta data (from "cargo check") before running compiletest r=phansch a=matthiaskrgr

Fixes #2896
Fixes #2139

Co-authored-by: Matthias Krüger <matthias.krueger@famsik.de>
5 years agocompiletest: clean rmeta data (from "cargo check") before running compiletest.
Matthias Krüger [Mon, 29 Oct 2018 09:27:40 +0000 (10:27 +0100)]
compiletest: clean rmeta data (from "cargo check") before running compiletest.

Fixes #2896
Fixes #2139

5 years agoMerge #3379
bors[bot] [Mon, 29 Oct 2018 10:44:16 +0000 (10:44 +0000)]
Merge #3379

3379: dependencies: bump compiletest-rs from git to 0.3.16 r=phansch a=matthiaskrgr

Co-authored-by: Matthias Krüger <matthias.krueger@famsik.de>
5 years agodependencies: bump compiletest-rs from git to 0.3.16
Matthias Krüger [Mon, 29 Oct 2018 08:52:49 +0000 (09:52 +0100)]
dependencies: bump compiletest-rs from git to 0.3.16

5 years agoMerge #3373
bors[bot] [Sun, 28 Oct 2018 22:52:21 +0000 (22:52 +0000)]
Merge #3373

3373: UI test cleanup: Extract unnecessary_operation tests r=matthiaskrgr a=phansch

cc #2038

Co-authored-by: Philipp Hansch <dev@phansch.net>
5 years agoMerge #3372
bors[bot] [Sun, 28 Oct 2018 22:19:11 +0000 (22:19 +0000)]
Merge #3372

3372: UI test cleanup: Extract explicit_counter_loop tests r=matthiaskrgr a=phansch

cc #2038

Co-authored-by: Philipp Hansch <dev@phansch.net>
5 years agoUI test cleanup: Extract explicit_counter_loop tests
Philipp Hansch [Sat, 27 Oct 2018 17:16:43 +0000 (19:16 +0200)]
UI test cleanup: Extract explicit_counter_loop tests

5 years agoUI test cleanup: Extract unnecessary_operation tests
Philipp Hansch [Sat, 27 Oct 2018 17:31:47 +0000 (19:31 +0200)]
UI test cleanup: Extract unnecessary_operation tests

5 years agoMerge #3217 #3366
bors[bot] [Sun, 28 Oct 2018 17:13:34 +0000 (17:13 +0000)]
Merge #3217 #3366

3217: Fix string_lit_as_bytes lint for macros r=phansch a=yaahallo

Prior to this change, string_lit_as_bytes would trigger for constructs
like `include_str!("filename").as_bytes()` and would recommend fixing it
by rewriting as `binclude_str!("filename")`.

This change updates the lint to act as an EarlyLintPass lint. It then
differentiates between string literals and macros that have bytes
yielding alternatives.

Closes #3205

3366: Don't expand macros in some suggestions r=oli-obk a=phansch

Fixes #1148
Fixes #1628
Fixes #2455
Fixes #3023
Fixes #3333
Fixes #3360

Co-authored-by: Jane Lusby <jlusby42@gmail.com>
Co-authored-by: Philipp Hansch <dev@phansch.net>
5 years agoMerge #3364
bors[bot] [Sun, 28 Oct 2018 16:54:09 +0000 (16:54 +0000)]
Merge #3364

3364: simplify ci scripts r=phansch a=matthiaskrgr

This makes it easier to flip the switch on pedantic lints on the clippy codebase.

Co-authored-by: Matthias Krüger <matthias.krueger@famsik.de>
5 years agoMerge pull request #3371 from matthiaskrgr/temp_breakage_fix
Philipp Hansch [Sun, 28 Oct 2018 16:51:09 +0000 (17:51 +0100)]
Merge pull request #3371 from matthiaskrgr/temp_breakage_fix

merge various PRs to make CI green again

5 years agoappveyor: use rustc nightly instead of master
Matthias Krüger [Sun, 28 Oct 2018 16:14:39 +0000 (17:14 +0100)]
appveyor: use rustc nightly instead of master

5 years agoMerge branch 'compiletest' into temp_breakage_fix
Matthias Krüger [Sun, 28 Oct 2018 15:56:57 +0000 (16:56 +0100)]
Merge branch 'compiletest' into temp_breakage_fix

5 years agopin compiletest dependency to git version (12c980f47971b5ba6beb7cb2ffebf8b32f6766ea...
Matthias Krüger [Sun, 28 Oct 2018 15:52:38 +0000 (16:52 +0100)]
pin compiletest dependency to git version (12c980f47971b5ba6beb7cb2ffebf8b32f6766ea) while we are waiting for a new release

5 years agoMerge remote-tracking branch 'phansch/disable_master_build' into temp_breakage_fix
Matthias Krüger [Sun, 28 Oct 2018 15:55:33 +0000 (16:55 +0100)]
Merge remote-tracking branch 'phansch/disable_master_build' into temp_breakage_fix

5 years agoFix #3335 rev1: bool_comparison triggers 3 times on same code
Giorgio Gambino [Sun, 28 Oct 2018 15:28:17 +0000 (16:28 +0100)]
Fix #3335 rev1: bool_comparison triggers 3 times on same code

5 years agoFix #3335: bool_comparison triggers 3 times on same code
Giorgio Gambino [Sun, 28 Oct 2018 14:37:39 +0000 (15:37 +0100)]
Fix #3335: bool_comparison triggers 3 times on same code

5 years agorustup: fix build with rustc 1.31.0-nightly (cae6efc37 2018-10-27)
Matthias Krüger [Sun, 28 Oct 2018 11:50:32 +0000 (12:50 +0100)]
rustup: fix build with rustc 1.31.0-nightly (cae6efc37 2018-10-27)

5 years agomore consistent use of terminology; trait > syntax
Michael Rutter [Sun, 28 Oct 2018 12:31:02 +0000 (12:31 +0000)]
more consistent use of terminology; trait > syntax

5 years agoadded downsides to "known problems" for get_unwrap lint
Michael Rutter [Sun, 28 Oct 2018 08:12:47 +0000 (08:12 +0000)]
added downsides to "known problems" for get_unwrap lint

5 years agoDisable rust master toolchain build temporarily
Philipp Hansch [Sun, 28 Oct 2018 07:11:18 +0000 (08:11 +0100)]
Disable rust master toolchain build temporarily

5 years agoDon't expand macro in or_fun_call suggestion
Philipp Hansch [Sat, 27 Oct 2018 13:37:56 +0000 (15:37 +0200)]
Don't expand macro in or_fun_call suggestion

5 years agoDon't expand macro in single_match suggestion
Philipp Hansch [Sat, 27 Oct 2018 12:45:02 +0000 (14:45 +0200)]
Don't expand macro in single_match suggestion

5 years agoDon't expand macro in identity_conversion suggestion
Philipp Hansch [Sat, 27 Oct 2018 09:01:27 +0000 (11:01 +0200)]
Don't expand macro in identity_conversion suggestion

5 years agoslightly simplify integration tests
Matthias Krüger [Fri, 26 Oct 2018 18:00:49 +0000 (20:00 +0200)]
slightly simplify integration tests

5 years agosimplify ci base-tests
Matthias Krüger [Fri, 26 Oct 2018 17:58:50 +0000 (19:58 +0200)]
simplify ci base-tests

5 years agofix: correctly reconstruct raw strings
Jane Lusby [Fri, 26 Oct 2018 16:10:20 +0000 (09:10 -0700)]
fix: correctly reconstruct raw strings

5 years agofix: extra semicolon, only create callsite once
Jane Lusby [Wed, 24 Oct 2018 15:49:39 +0000 (11:49 -0400)]
fix: extra semicolon, only create callsite once

5 years agoFix string_lit_as_bytes lint for macros
Jane Lusby [Fri, 5 Oct 2018 16:06:05 +0000 (09:06 -0700)]
Fix string_lit_as_bytes lint for macros

Prior to this change, string_lit_as_bytes would trigger for constructs
like `include_str!("filename").as_bytes()` and would recommend fixing it
by rewriting as `binclude_str!("filename")`.

This change updates the lint to act as an EarlyLintPass lint. It then
differentiates between string literals and macros that have bytes
yielding alternatives.

Closes #3205

5 years agoMerge #3355
bors[bot] [Fri, 26 Oct 2018 10:36:43 +0000 (10:36 +0000)]
Merge #3355

3355: Lint to remove redundant `clone()`s r=oli-obk a=sinkuu

This PR adds lint `redundant_clone`. It suggests to remove redundant `clone()` that clones a owned value that will be dropped without any usage after that.

Real-world example: https://github.com/rust-lang/rust/compare/7b0735a..sinkuu:redundant_clone2

Co-authored-by: Shotaro Yamada <sinkuu@sinkuu.xyz>
5 years agoMerge #3359
bors[bot] [Fri, 26 Oct 2018 09:37:22 +0000 (09:37 +0000)]
Merge #3359

3359: ci: allow all branches except trying.tmp and staging.tmp to be built r=phansch a=matthiaskrgr

r? @flip1995

The problem was that with the current configuration, if I made a branch `feature1` and pushed it to travis to have it checked before making a PR, travis would skip it because it only built the 3 branches that were specified when setting up bors.

The change allows all branch names to be build by default again, except for travis.tmp.
The gh-pages branch is skipped as per travis-ci defaults: https://docs.travis-ci.com/user/customizing-the-build/#safelisting-or-blocklisting-branches

Co-authored-by: Matthias Krüger <matthias.krueger@famsik.de>
5 years agoMerge #3357
bors[bot] [Fri, 26 Oct 2018 08:48:12 +0000 (08:48 +0000)]
Merge #3357

3357: Check existential types in `use_self` r=oli-obk a=HMPerson1

Fixes #3231

Co-authored-by: HMPerson1 <hmperson1@gmail.com>
5 years agoMerge #3362
bors[bot] [Fri, 26 Oct 2018 08:01:48 +0000 (08:01 +0000)]
Merge #3362

3362: travis: work around temporary test failure due to rustc crashing on hyper r=phansch a=matthiaskrgr

Upstream ticket: https://github.com/rust-lang/rust/issues/55376

Co-authored-by: Matthias Krüger <matthias.krueger@famsik.de>
5 years agotravis: work around temporary test failure due to rustc crashing on hyper.
Matthias Krüger [Fri, 26 Oct 2018 07:57:20 +0000 (09:57 +0200)]
travis: work around temporary test failure due to rustc crashing on hyper.

Upstream ticket: https://github.com/rust-lang/rust/issues/55376

5 years agoci: allow all branches except trying.tmp and staging.tmp to be built
Matthias Krüger [Thu, 25 Oct 2018 18:14:39 +0000 (20:14 +0200)]
ci: allow all branches except trying.tmp and staging.tmp to be built

5 years agoMove in_macro check
Shotaro Yamada [Thu, 25 Oct 2018 18:07:29 +0000 (03:07 +0900)]
Move in_macro check

5 years agoUse BasicBlockData::terminator
Shotaro Yamada [Thu, 25 Oct 2018 16:27:28 +0000 (01:27 +0900)]
Use BasicBlockData::terminator

5 years agoRefactor
Shotaro Yamada [Thu, 25 Oct 2018 13:02:46 +0000 (22:02 +0900)]
Refactor

5 years agoUse lint_root
Shotaro Yamada [Thu, 25 Oct 2018 12:08:32 +0000 (21:08 +0900)]
Use lint_root

5 years agoImplement visit_basic_block_data
Shotaro Yamada [Thu, 25 Oct 2018 11:33:40 +0000 (20:33 +0900)]
Implement visit_basic_block_data

5 years agoupdate_references indexing_slicing
Shotaro Yamada [Thu, 25 Oct 2018 05:59:14 +0000 (14:59 +0900)]
update_references indexing_slicing

5 years agoRun update_lints
Shotaro Yamada [Wed, 24 Oct 2018 13:57:31 +0000 (22:57 +0900)]
Run update_lints

5 years agoAdd redundant_clone lint
Shotaro Yamada [Tue, 23 Oct 2018 07:01:45 +0000 (16:01 +0900)]
Add redundant_clone lint

5 years agoMerge #3358
bors[bot] [Thu, 25 Oct 2018 11:43:09 +0000 (11:43 +0000)]
Merge #3358

3358: Revert "new_ret_no_self: add sample from #3313 to Known Problems section." r=oli-obk a=matthiaskrgr

This reverts commit fd2f6dd3824b32af031d19830b6ccdc732dd3dfc.

Issue #3313 has been fixed.

Co-authored-by: Matthias Krüger <matthias.krueger@famsik.de>
5 years agoRevert "new_ret_no_self: add sample from #3313 to Known Problems section."
Matthias Krüger [Thu, 25 Oct 2018 11:37:50 +0000 (13:37 +0200)]
Revert "new_ret_no_self: add sample from #3313 to Known Problems section."

This reverts commit fd2f6dd3824b32af031d19830b6ccdc732dd3dfc.

Issue #3313 has been fixed.

5 years agoMerge #3331
bors[bot] [Thu, 25 Oct 2018 09:38:00 +0000 (09:38 +0000)]
Merge #3331

3331: Disable arithmetic lints in constant items r=oli-obk a=pengowen123

Currently this will not catch cases in associated constants. I'm not sure whether checking spans is the best way to solve this issue, but I don't think it will cause any problems.
Fixes #1858

Co-authored-by: Owen Sanchez <pengowen816@gmail.com>