]>
git.lizzy.rs Git - rust.git/log
Maxwell Anderson [Sun, 4 Nov 2018 17:39:54 +0000 (10:39 -0700)]
changed into_iter to iter and fixed a lint check
Michael Wright [Sun, 4 Nov 2018 08:48:24 +0000 (10:48 +0200)]
Fix `collapsible_if` error
Michael Wright [Sun, 4 Nov 2018 08:02:49 +0000 (10:02 +0200)]
Fix `possible_missing_comma` false positives
`possible_missing_comma` should only trigger when the binary operator has
unary equivalent. Otherwise, it's not possible to insert a comma without
breaking compilation. The operators identified were `+`, `&`, `*` and `-`.
This fixes the specific examples given in issues #3244 and #3396
but doesn't address the conflict this lint has with the style of starting
a line with a binary operator.
bors[bot] [Sat, 3 Nov 2018 19:11:35 +0000 (19:11 +0000)]
Merge #3399
3399: RIIR update lints: Generate modules section and lint group sections r=flip1995 a=phansch
This adds the last missing parts of the generating code.
cc #2882
Co-authored-by: Philipp Hansch <dev@phansch.net>
Philipp Hansch [Sat, 3 Nov 2018 19:06:48 +0000 (20:06 +0100)]
Merge pull request #3404 from matthiaskrgr/rustup
rustup https://github.com/rust-lang/rust/pull/55330/
Matthias Krüger [Sat, 3 Nov 2018 17:50:23 +0000 (18:50 +0100)]
rustup https://github.com/rust-lang/rust/pull/55330/
Philipp Hansch [Sat, 3 Nov 2018 17:48:39 +0000 (18:48 +0100)]
Fix typo
Philipp Hansch [Sat, 3 Nov 2018 11:59:40 +0000 (12:59 +0100)]
Improve clippy_dev help text
Philipp Hansch [Sat, 3 Nov 2018 11:59:13 +0000 (12:59 +0100)]
RIIR update lints: Generate lint group registrations
Philipp Hansch [Sat, 3 Nov 2018 09:58:45 +0000 (10:58 +0100)]
Test clippy_dev on CI and fix test
bors[bot] [Sat, 3 Nov 2018 08:34:13 +0000 (08:34 +0000)]
Merge #3400
3400: Fix a false-positive of needless_borrow r=phansch a=sinkuu
Co-authored-by: Shotaro Yamada <sinkuu@sinkuu.xyz>
bors[bot] [Sat, 3 Nov 2018 08:12:10 +0000 (08:12 +0000)]
Merge #3123
3123: Lint #[cfg_attr(rustfmt, rustfmt_skip)] and suggest #[rustfmt::skip] r=phansch a=flip1995
Closes #3121
Co-authored-by: flip1995 <9744647+flip1995@users.noreply.github.com>
Co-authored-by: flip1995 <hello@philkrones.com>
Philipp Hansch [Thu, 1 Nov 2018 19:16:38 +0000 (20:16 +0100)]
RIIR update lints: Generate modules section
flip1995 [Fri, 2 Nov 2018 12:43:16 +0000 (13:43 +0100)]
Update stderr
flip1995 [Thu, 1 Nov 2018 19:17:04 +0000 (20:17 +0100)]
Rename test files
flip1995 [Thu, 1 Nov 2018 19:06:59 +0000 (20:06 +0100)]
Also lint cfg_attr(.., rustfmt::skip)
flip1995 [Thu, 1 Nov 2018 19:06:25 +0000 (20:06 +0100)]
Add tests from rustfmt::skip test file
flip1995 [Mon, 15 Oct 2018 13:18:26 +0000 (15:18 +0200)]
Run update_lints.py script
flip1995 [Tue, 18 Sep 2018 09:36:59 +0000 (11:36 +0200)]
Add test for non-crate-level inner attributes
flip1995 [Tue, 18 Sep 2018 09:35:53 +0000 (11:35 +0200)]
Differ between inner and outer attributes
flip1995 [Mon, 3 Sep 2018 13:34:33 +0000 (15:34 +0200)]
Add tests
flip1995 [Mon, 3 Sep 2018 13:34:12 +0000 (15:34 +0200)]
Add cfg_attr(rustfmt) lint
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>
kennytm [Tue, 23 Oct 2018 17:50:18 +0000 (01:50 +0800)]
Addressed comments.
kennytm [Mon, 22 Oct 2018 03:44:09 +0000 (11:44 +0800)]
Fix dogfood error.
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.
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>
flip1995 [Fri, 2 Nov 2018 13:00:46 +0000 (14:00 +0100)]
Allow single_match_else
flip1995 [Fri, 2 Nov 2018 11:58:16 +0000 (12:58 +0100)]
Update stderr
flip1995 [Thu, 1 Nov 2018 20:02:15 +0000 (21:02 +0100)]
Add copyright statement©
flip1995 [Thu, 1 Nov 2018 19:37:13 +0000 (20:37 +0100)]
Fix typos
flip1995 [Thu, 13 Sep 2018 08:54:02 +0000 (10:54 +0200)]
Fix dogfood error
flip1995 [Mon, 10 Sep 2018 15:52:44 +0000 (17:52 +0200)]
Fix typo and indentation
flip1995 [Mon, 10 Sep 2018 15:26:48 +0000 (17:26 +0200)]
run update_lints script
flip1995 [Mon, 10 Sep 2018 15:21:50 +0000 (17:21 +0200)]
Add tests for unknwon_clippy_lints lint
flip1995 [Mon, 10 Sep 2018 15:09:15 +0000 (17:09 +0200)]
Add new lint: unknwon_clippy_lintsg
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>
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
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>
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>
Shotaro Yamada [Fri, 2 Nov 2018 06:56:47 +0000 (15:56 +0900)]
Fix a false-positive of needless_borrow
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>
Philipp Hansch [Tue, 30 Oct 2018 20:36:52 +0000 (21:36 +0100)]
UI test cleanup: Extract match_overlapping_arm 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)]`
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>
Maxwell Anderson [Thu, 1 Nov 2018 21:43:40 +0000 (15:43 -0600)]
format code
Maxwell Anderson [Thu, 1 Nov 2018 21:26:38 +0000 (15:26 -0600)]
Merge remote-tracking branch 'upstream/master'
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
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
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
Philipp Hansch [Thu, 1 Nov 2018 19:35:23 +0000 (20:35 +0100)]
Fix clippy build failure on latest master
Maxwell Anderson [Thu, 1 Nov 2018 18:35:01 +0000 (12:35 -0600)]
fix comment spacing
Michael Wright [Thu, 1 Nov 2018 05:06:47 +0000 (07:06 +0200)]
Use slice patterns instead of padding
Maxwell Anderson [Thu, 1 Nov 2018 00:09:56 +0000 (18:09 -0600)]
change single char str to char
Maxwell Anderson [Wed, 31 Oct 2018 22:48:47 +0000 (16:48 -0600)]
Merge remote-tracking branch 'upstream/master'
Maxwell Anderson [Wed, 31 Oct 2018 22:48:24 +0000 (16:48 -0600)]
add lint to lintarray macro
Maxwell Anderson [Wed, 31 Oct 2018 22:39:12 +0000 (16:39 -0600)]
Revert "small fix"
This reverts commit
b1abc81a60e05bb2cf46850b977b7fa4ba34a6de .
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>
Philipp Hansch [Wed, 31 Oct 2018 20:54:30 +0000 (21:54 +0100)]
Fix dogfood and pedantic lints
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>
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.
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>
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.
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>
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>
Michael Wright [Wed, 31 Oct 2018 04:26:29 +0000 (06:26 +0200)]
Replace big if/else expression with match
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>
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 .
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 .
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 .
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.
Philipp Hansch [Tue, 30 Oct 2018 20:25:34 +0000 (21:25 +0100)]
UI test cleanup: Extract for_loop_over_x tests
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)
Manish Goregaokar [Tue, 30 Oct 2018 04:06:37 +0000 (04:06 +0000)]
Rustup to rustc 1.31.0-nightly (
fb2446ad5 2018-10-30)
Giorgio Gambino [Mon, 29 Oct 2018 21:23:45 +0000 (22:23 +0100)]
Fix #3335 rev2: bool_comparison triggers 3 times on same code
flip1995 [Mon, 29 Oct 2018 19:55:52 +0000 (20:55 +0100)]
Update .stderr file
flip1995 [Mon, 29 Oct 2018 19:54:21 +0000 (20:54 +0100)]
Register MISTYPED_LITERAL_SUFFIXES lint
flip1995 [Mon, 29 Oct 2018 19:37:47 +0000 (20:37 +0100)]
Rewrite registered lint collection
Michael Wright [Fri, 12 Oct 2018 06:09:04 +0000 (08:09 +0200)]
Fix lint_without_lint_pass
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>
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
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>
Matthias Krüger [Mon, 29 Oct 2018 08:52:49 +0000 (09:52 +0100)]
dependencies: bump compiletest-rs from git to 0.3.16
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>
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>
Philipp Hansch [Sat, 27 Oct 2018 17:16:43 +0000 (19:16 +0200)]
UI test cleanup: Extract explicit_counter_loop tests
Philipp Hansch [Sat, 27 Oct 2018 17:31:47 +0000 (19:31 +0200)]
UI test cleanup: Extract unnecessary_operation tests
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>
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>
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
Matthias Krüger [Sun, 28 Oct 2018 16:14:39 +0000 (17:14 +0100)]
appveyor: use rustc nightly instead of master
Matthias Krüger [Sun, 28 Oct 2018 15:56:57 +0000 (16:56 +0100)]
Merge branch 'compiletest' into temp_breakage_fix
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
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
Giorgio Gambino [Sun, 28 Oct 2018 15:28:17 +0000 (16:28 +0100)]
Fix #3335 rev1: 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
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)
Michael Rutter [Sun, 28 Oct 2018 12:31:02 +0000 (12:31 +0000)]
more consistent use of terminology; trait > syntax
Michael Rutter [Sun, 28 Oct 2018 08:12:47 +0000 (08:12 +0000)]
added downsides to "known problems" for get_unwrap lint
Philipp Hansch [Sun, 28 Oct 2018 07:11:18 +0000 (08:11 +0100)]
Disable rust master toolchain build temporarily