]>
git.lizzy.rs Git - rust.git/log
bors [Sun, 13 Jan 2019 11:21:24 +0000 (11:21 +0000)]
Auto merge of #3655 - manaskarekar:patch-1, r=flip1995
Update Readme for (arguably) better readability
Move final instruction to run clippy into a third step in the Readme so it's easier to spot at a quick glance.
Manas Karekar [Sun, 13 Jan 2019 01:24:52 +0000 (20:24 -0500)]
Update Readme
Move instruction to the correct step for installing Clippy.
Manas Karekar [Sun, 13 Jan 2019 00:42:36 +0000 (19:42 -0500)]
Update Readme for (arguably) better readability
Move final instruction to run clippy into a third step in the Readme so it's easier to spot at a quick glance.
bors [Sat, 12 Jan 2019 15:33:08 +0000 (15:33 +0000)]
Auto merge of #3654 - matthiaskrgr:rustup, r=phansch
rustup: the features if_while_or_patterns has been stabilized
Matthias Krüger [Sat, 12 Jan 2019 15:11:17 +0000 (16:11 +0100)]
rustup: the features if_while_or_patterns has been stabilized
bors [Fri, 11 Jan 2019 01:11:34 +0000 (01:11 +0000)]
Auto merge of #3646 - matthiaskrgr:travis, r=phansch
readme: update travis badge to reflect migration from travis-ci.org to travis-ci.com
bors [Wed, 9 Jan 2019 21:53:55 +0000 (21:53 +0000)]
Auto merge of #3645 - phansch:remove_copyright_headers, r=oli-obk
Remove all copyright license headers
Discussion previously happened in https://github.com/rust-lang/rust/pull/43498 and here: https://github.com/rust-lang/rust-clippy/pull/3642#issuecomment-
452251727
Matthias Krüger [Tue, 8 Jan 2019 23:50:32 +0000 (00:50 +0100)]
readme: update travis badge to reflect migration from travis-ci.org to travis-ci.com
Philipp Hansch [Mon, 7 Jan 2019 21:33:18 +0000 (22:33 +0100)]
Remove all copyright license headers
Discussion previously happened in https://github.com/rust-lang/rust/pull/43498
bors [Mon, 7 Jan 2019 18:54:28 +0000 (18:54 +0000)]
Auto merge of #3640 - detrumi:nested_use_self, r=flip1995
Restrict `use_self` on nested items
Fixes #3637
Fixes #3463
These changes make it so that nested items aren't visited any more by the `use_self` lint.
I think visiting nested items should be possible (so that it uses a different `item_path` for the nested item), but I'm not sure whether it's viable and what the best approach would be.
- Can `item_path` be changed to a new `Self` path before visiting the item, and then changing it back afterwards?
- Alternatively, could a new visitor be created, re-using `check_trait_method_impl_decl`?
bors [Mon, 7 Jan 2019 18:30:53 +0000 (18:30 +0000)]
Auto merge of #3600 - xfix:cast-ref-to-mut, r=flip1995
cast_ref_to_mut lint
I see this pattern way too often, and it's completely wrong. In fact, due to how common this incorrect pattern is, [the Rustonomicon specifically points this out](https://doc.rust-lang.org/nomicon/transmutes.html).
> - Transmuting an & to &mut is UB
> - Transmuting an & to &mut is always UB
> - No you can't do it
> - No you're not special
This is my first lint.
bors [Mon, 7 Jan 2019 17:50:48 +0000 (17:50 +0000)]
Auto merge of #3641 - hellow554:patch-1, r=flip1995
Add missing ` in default lint
Konrad Borowski [Mon, 7 Jan 2019 13:39:56 +0000 (14:39 +0100)]
Move cast_ref_to_mut list to correctness group
Wilco Kusee [Mon, 7 Jan 2019 13:38:01 +0000 (14:38 +0100)]
Rustftmt
Konrad Borowski [Sun, 30 Dec 2018 12:12:28 +0000 (13:12 +0100)]
Don't import ty::Ref in cast_ref_to_mut lint
Konrad Borowski [Sun, 30 Dec 2018 12:11:53 +0000 (13:11 +0100)]
Move a hint to an error message in cast_ref_to_mut lint
This matches mem::transmute::<&T, &mut T> lint in rustc.
Konrad Borowski [Sun, 30 Dec 2018 12:06:37 +0000 (13:06 +0100)]
Add a note to cast_ref_to_mut lint
Konrad Borowski [Sun, 30 Dec 2018 12:02:58 +0000 (13:02 +0100)]
Use ty::Ref instead of ty::TyKind::Ref
Konrad Borowski [Sat, 29 Dec 2018 18:25:27 +0000 (19:25 +0100)]
cast_ref_to_mut lint
Marcel Hellwig [Mon, 7 Jan 2019 13:32:32 +0000 (14:32 +0100)]
Add missing ` in default lint
Wilco Kusee [Mon, 7 Jan 2019 13:11:53 +0000 (14:11 +0100)]
Improve tests and exclude nested impls
bors [Mon, 7 Jan 2019 08:41:43 +0000 (08:41 +0000)]
Auto merge of #3638 - mikerite:fix-3625, r=oli-obk
Improve `get_unwrap` suggestion
Handle case where a reference is immediately dereferenced.
Fixes #3625
Michael Wright [Mon, 7 Jan 2019 04:22:39 +0000 (06:22 +0200)]
Update `unwrap_get` code review suggestions
Wilco Kusee [Sun, 6 Jan 2019 14:41:02 +0000 (15:41 +0100)]
Update known problems
Wilco Kusee [Sun, 6 Jan 2019 14:05:04 +0000 (15:05 +0100)]
Restrict use_self on nested items
Michael Wright [Sun, 6 Jan 2019 09:46:03 +0000 (11:46 +0200)]
Improve `get_unwrap` suggestion
Handle case where a reference is immediately dereferenced.
Fixes 3625
bors [Sat, 5 Jan 2019 14:04:31 +0000 (14:04 +0000)]
Auto merge of #3635 - matthiaskrgr:revert_random_state_3603, r=xfix
Revert the random_state lint.
Remove the random_state lint until it or rustc has been fixed to no longer crash with debug assertions (see #3628)
We can't update clippy in the rustc repo because of this which is blocking nightlies because toolstate is already broken.
fixes #3628
bors [Sat, 5 Jan 2019 12:14:30 +0000 (12:14 +0000)]
Auto merge of #3626 - phansch:rustfix_works, r=oli-obk
Add run-rustfix where it already works
This PR adds `// run-rustfix` headers to tests for `MachineApplicable` lints where
applying the suggestions works without any errors.
Matthias Krüger [Sat, 5 Jan 2019 09:20:37 +0000 (10:20 +0100)]
Revert "tests: used_underscore_binding_macro: disable random_state lint."
This reverts commit
2b80829fe0311fc5cdbc731fa0b67f103db4c004 .
Matthias Krüger [Sat, 5 Jan 2019 09:19:04 +0000 (10:19 +0100)]
Revert "Auto merge of #3603 - xfix:random-state-lint, r=phansch"
This reverts commit
0a6593cd1b12c06d4ff2f2ad0ccf20e77f1ec5f6 , reversing
changes made to
5277a1fb6c1be42ec0c57a6f60d82fc18a962259 .
This hopefully fixes #3628
bors [Sat, 5 Jan 2019 08:51:13 +0000 (08:51 +0000)]
Auto merge of #3627 - detrumi:use_self_local_macro, r=phansch
Trigger `use_self` lint in local macros
Closes #2098
The test currently only covers local macros. #2098 suggested this:
> You could add the macro in question into the `mini_macro` subcrate
But that doesn't work for a `macro_rules`:
```
error: cannot export macro_rules! macros from a `proc-macro` crate type currently
```
So I suggest leaving out the test for external macros, as using `in_external_macro` seems straigtforward enough. Alternatives would be to use to add an additional crate (overkill if you ask me), or test with a `proc-macro`.
bors [Sat, 5 Jan 2019 08:29:25 +0000 (08:29 +0000)]
Auto merge of #3610 - phansch:method_rs_cleanup, r=flip1995
UI test cleanup: Extract lint from methods.rs test
Extracts the `result_map_unwrap_or_else` lint into a separate test file.
This also extracts the `IteratorFalsePositives` struct and impl into
`auxiliary/option_helpers.rs`.
cc #2038
bors [Sat, 5 Jan 2019 08:02:50 +0000 (08:02 +0000)]
Auto merge of #3633 - matthiaskrgr:rustup, r=phansch
rustup (don't know the exact PR unfortunately)
Matthias Krüger [Sat, 5 Jan 2019 07:21:56 +0000 (08:21 +0100)]
rustup https://github.com/rust-lang/rust/pull/56837
Matthias Krüger [Sat, 5 Jan 2019 00:12:33 +0000 (01:12 +0100)]
rustup (don't know the exact PR unfortunately)
bors [Fri, 4 Jan 2019 18:05:17 +0000 (18:05 +0000)]
Auto merge of #3631 - phansch:add_itertools_to_integration_tests, r=phansch
Add itertools to integration tests
Mainly because it causes an ICE in https://github.com/rust-lang/rust/issues/57298
and it's a good library to test anyway.
bors [Fri, 4 Jan 2019 17:40:43 +0000 (17:40 +0000)]
Auto merge of #3629 - matthiaskrgr:crash_workaround, r=phansch
tests: used_underscore_binding_macro: disable random_state lint.
Trying to work around a crash (see https://github.com/rust-lang/rust-clippy/issues/3628) in
https://github.com/rust-lang/rust/pull/57303
Philipp Hansch [Fri, 4 Jan 2019 17:01:44 +0000 (18:01 +0100)]
Add itertools to integration tests
Matthias Krüger [Fri, 4 Jan 2019 16:18:19 +0000 (17:18 +0100)]
tests: used_underscore_binding_macro: disable random_state lint.
Trying to work around a crash (see https://github.com/rust-lang/rust-clippy/issues/3628) in
https://github.com/rust-lang/rust/pull/57303
bors [Fri, 4 Jan 2019 14:59:11 +0000 (14:59 +0000)]
Auto merge of #3601 - xfix:move-constant-write-lint, r=flip1995
Move constant write checks to temporary_assignment lint
They make more sense here
cc #3595
Wilco Kusee [Fri, 4 Jan 2019 10:31:28 +0000 (11:31 +0100)]
Trigger `use_self` lint in local macros
Philipp Hansch [Fri, 4 Jan 2019 10:22:38 +0000 (11:22 +0100)]
Add run-rustfix where it already passes
bors [Thu, 3 Jan 2019 22:29:09 +0000 (22:29 +0000)]
Auto merge of #3623 - phansch:rustup, r=flip1995
rustup: https://github.com/rust-lang/rust/pull/55517
None
Philipp Hansch [Thu, 3 Jan 2019 20:54:57 +0000 (21:54 +0100)]
rustup: https://github.com/rust-lang/rust/pull/55517
bors [Thu, 3 Jan 2019 19:49:07 +0000 (19:49 +0000)]
Auto merge of #3622 - m-cat:master, r=phansch
Add ui/for_kv_map test for false positive in #1279
Fixes #1279
bors [Thu, 3 Jan 2019 19:27:32 +0000 (19:27 +0000)]
Auto merge of #3621 - Zoxc:parallel, r=phansch
Make clippy work with parallel rustc
John Kåre Alsaker [Thu, 3 Jan 2019 17:17:43 +0000 (18:17 +0100)]
Make clippy work with parallel rustc
Marcin S [Thu, 3 Jan 2019 18:07:21 +0000 (19:07 +0100)]
Add ui/for_kv_map test for false positive in #1279
bors [Thu, 3 Jan 2019 15:08:47 +0000 (15:08 +0000)]
Auto merge of #3519 - phansch:brave_newer_ui_tests, r=flip1995
Integrate rustfix into Clippy test suite
Once the [PR to compiletest-rs](https://github.com/laumann/compiletest-rs/pull/151) is reviewed and merged this fixes #2376.
I will create a separate tracking issue for adding `run-rustfix` to all tests.
Philipp Hansch [Thu, 3 Jan 2019 14:42:59 +0000 (15:42 +0100)]
Update to latest compiletest-rs release
bors [Thu, 3 Jan 2019 11:23:57 +0000 (11:23 +0000)]
Auto merge of #3617 - matthiaskrgr:3462_test, r=phansch
add testcase for #3462
Matthias Krüger [Thu, 3 Jan 2019 10:08:05 +0000 (11:08 +0100)]
add testcase for #3462
bors [Thu, 3 Jan 2019 07:20:23 +0000 (07:20 +0000)]
Auto merge of #3615 - matthiaskrgr:rtuVbump, r=phansch
deps: bump rustc_tools_util version from 0.1.0 to 0.1.1 just in case...
I'm surprised there is no warning since the root cargo.toml specifies 0.1.0 but the subcrate toml actually states 0.1.1.
I should have noticed this in previous pull request but oh well...
Matthias Krüger [Thu, 3 Jan 2019 02:19:15 +0000 (03:19 +0100)]
deps: bump rustc_tools_util version from 0.1.0 to 0.1.1 just in case...
bors [Thu, 3 Jan 2019 02:00:46 +0000 (02:00 +0000)]
Auto merge of #3603 - xfix:random-state-lint, r=phansch
random_state lint
bors [Thu, 3 Jan 2019 01:06:53 +0000 (01:06 +0000)]
Auto merge of #3614 - matthiaskrgr:rustc_tool_utils, r=phansch
rustc_tool_utils: fix failure to create proper non-repo version string when used in crates on crates.io, bump version
bors [Thu, 3 Jan 2019 00:12:02 +0000 (00:12 +0000)]
Auto merge of #3607 - detrumi:limit_infinite_iter_to_known_types, r=phansch
Only trigger `infinite_iter` lint for infinitely allocating `collect()` calls
Fixes #3538
~Oh, I guess this should actually check other methods like `count` as well, not only `collect()`.~
Never mind, `collect` is the only of these functions that allocates a data structure.
Philipp Hansch [Wed, 2 Jan 2019 21:48:44 +0000 (22:48 +0100)]
Use compiletest's aux-build header instead of include macro
Matthias Krüger [Wed, 2 Jan 2019 19:12:15 +0000 (20:12 +0100)]
rustc_tool_utils: fix failure to create proper non-repo version string when used in crates on crates.io, bump version
bors [Wed, 2 Jan 2019 16:40:10 +0000 (16:40 +0000)]
Auto merge of #3609 - codeworm96:fix_test, r=phansch
Fix test for rust-lang/rust#57250
Part of rust-lang/rust#57250.
~~Do not merge. Waiting a nightly with that PR merged.~~
bors [Wed, 2 Jan 2019 13:20:38 +0000 (13:20 +0000)]
Auto merge of #3612 - phansch:copies_cleanup, r=flip1995
UI test cleanup: Extract ifs_same_cond tests
cc #2038
bors [Wed, 2 Jan 2019 12:12:09 +0000 (12:12 +0000)]
Auto merge of #3611 - phansch:some_for_loop_cleanup, r=flip1995
UI test cleanup: Extract for_kv_map lint tests
cc #2038
Philipp Hansch [Wed, 2 Jan 2019 07:15:32 +0000 (08:15 +0100)]
rustfmt
Philipp Hansch [Wed, 2 Jan 2019 06:59:48 +0000 (07:59 +0100)]
UI test cleanup: Extract ifs_same_cond tests
Philipp Hansch [Wed, 2 Jan 2019 06:27:47 +0000 (07:27 +0100)]
Extract IteratorFalsePositives into option_helpers.rs
This was previously duplicated in #3605
Philipp Hansch [Wed, 2 Jan 2019 06:42:04 +0000 (07:42 +0100)]
UI test cleanup: Extract for_kv_map lint tests
Philipp Hansch [Wed, 2 Jan 2019 06:23:00 +0000 (07:23 +0100)]
UI test cleanup: Extract lint from methods.rs test
Yuning Zhang [Wed, 2 Jan 2019 01:34:02 +0000 (20:34 -0500)]
Fix test for rust-lang/rust#57250
Wilco Kusee [Mon, 31 Dec 2018 11:06:08 +0000 (12:06 +0100)]
Limit infinite_iter collect() check to known types
bors [Mon, 31 Dec 2018 12:03:28 +0000 (12:03 +0000)]
Auto merge of #3608 - phansch:improve_util_docs, r=oli-obk
Some improvements to util documentation
None
Philipp Hansch [Mon, 31 Dec 2018 11:12:50 +0000 (12:12 +0100)]
Some improvements to util documentation
bors [Mon, 31 Dec 2018 10:22:06 +0000 (10:22 +0000)]
Auto merge of #3606 - detrumi:blacklisted_name_hashset, r=phansch
Use hashset in `blacklisted_name` lint
Wilco Kusee [Mon, 31 Dec 2018 09:44:27 +0000 (10:44 +0100)]
Use hashset for name blacklist
bors [Mon, 31 Dec 2018 09:25:18 +0000 (09:25 +0000)]
Auto merge of #3590 - jorpic:i3559-if_same_then_else, r=phansch
Fix if_same_then_else false positive
This fixes false positive in #3559.
The problem was that `SpanlessEq` does not check patterns in declarations. So this two blocks considered equal.
```rust
if true {
let (x, y) = foo();
} else {
let (y, x) = foo();
}
```
Not sure if the proposed change is safe as `SpanlessEq` is used extensively in other lints, but I tried hard to come up with counterexample and failed.
bors [Sun, 30 Dec 2018 17:46:01 +0000 (17:46 +0000)]
Auto merge of #3599 - xfix:use-hash-set-for-valid-idents, r=oli-obk
Use an FxHashSet for valid idents in documentation lint
bors [Sun, 30 Dec 2018 16:00:15 +0000 (16:00 +0000)]
Auto merge of #3605 - phansch:small_methods_ui_test_improvement, r=flip1995
UI test cleanup: Extract iter_skip_next from methods.rs
cc #2038
Konrad Borowski [Sun, 30 Dec 2018 13:29:43 +0000 (14:29 +0100)]
Reformat random_state tests
Philipp Hansch [Sun, 30 Dec 2018 11:41:37 +0000 (12:41 +0100)]
UI test cleanup: Extract iter_skip_next from methods.rs
cc #2038
Konrad Borowski [Sun, 30 Dec 2018 12:40:27 +0000 (13:40 +0100)]
Use node_id_to_type_opt instead of node_it_to_type in random_state
bors [Sun, 30 Dec 2018 11:45:38 +0000 (11:45 +0000)]
Auto merge of #3593 - mikerite:readme-syspath-2, r=phansch
Update README local run command to remove syspath
Since #3257 was reverted, including the sysroot in RUSTFLAGS gives the
error `Option 'sysroot' given more than once`
bors [Sun, 30 Dec 2018 11:12:55 +0000 (11:12 +0000)]
Auto merge of #3588 - detrumi:tuple_struct_use_self, r=phansch
`use_self` for tuple structs
Fixes #3498
Max Taldykin [Thu, 27 Dec 2018 17:11:25 +0000 (20:11 +0300)]
Check pattern equality while checking declaration equality
Konrad Borowski [Sun, 30 Dec 2018 10:43:20 +0000 (11:43 +0100)]
Merge branch 'master' of https://github.com/rust-lang/rust-clippy into random-state-lint
bors [Sun, 30 Dec 2018 10:40:36 +0000 (10:40 +0000)]
Auto merge of #3597 - xfix:match-ergonomics, r=phansch
Match ergonomics (lints from A to B)
bors [Sun, 30 Dec 2018 09:55:09 +0000 (09:55 +0000)]
Auto merge of #3602 - matthiaskrgr:rustup, r=phansch
rustup https://github.com/rust-lang/rust/pull/56225/
item.name -> item.ident.name
Wilco Kusee [Fri, 28 Dec 2018 19:49:19 +0000 (20:49 +0100)]
Update test output after rebase
Wilco Kusee [Fri, 28 Dec 2018 12:41:33 +0000 (13:41 +0100)]
Remove false negatives from known problems
Wilco Kusee [Thu, 27 Dec 2018 16:27:42 +0000 (17:27 +0100)]
Implement use_self for tuple structs
Wilco Kusee [Thu, 27 Dec 2018 08:54:19 +0000 (09:54 +0100)]
Document known problems
Konrad Borowski [Sun, 30 Dec 2018 01:43:56 +0000 (02:43 +0100)]
random_state lint
Matthias Krüger [Sun, 30 Dec 2018 00:09:24 +0000 (01:09 +0100)]
rustup https://github.com/rust-lang/rust/pull/56225/
item.name -> item.ident.name
Konrad Borowski [Sat, 29 Dec 2018 23:18:55 +0000 (00:18 +0100)]
Move constant write checks to temporary_assignment lint
They make more sense here
bors [Sat, 29 Dec 2018 19:04:11 +0000 (19:04 +0000)]
Auto merge of #3598 - xfix:apply-cargo-fix-edition-idioms, r=phansch
Apply cargo fix --edition-idioms fixes
bors [Sat, 29 Dec 2018 17:31:35 +0000 (17:31 +0000)]
Auto merge of #3558 - russelltg:new_without_default_merge, r=flip1995
Merge new_without_default_derive into new_without_default
Closes #3525, deprecating new_without_default_derive and moving both lints into new_without_default.
Konrad Borowski [Sat, 29 Dec 2018 17:07:10 +0000 (18:07 +0100)]
Use an FxHashSet for valid idents in documentation lint
Konrad Borowski [Sat, 29 Dec 2018 16:48:00 +0000 (17:48 +0100)]
Remove unnecessary `use` statements after `cargo fix`
Konrad Borowski [Sat, 29 Dec 2018 16:46:25 +0000 (17:46 +0100)]
Apply cargo fix --edition-idioms fixes
Konrad Borowski [Sat, 29 Dec 2018 16:34:56 +0000 (17:34 +0100)]
Use match ergonomics for booleans lint
Konrad Borowski [Sat, 29 Dec 2018 16:32:09 +0000 (17:32 +0100)]
Use match ergonomics for block_in_if_condition lint
Konrad Borowski [Sat, 29 Dec 2018 16:31:32 +0000 (17:31 +0100)]
Use match ergonomics for bit_mask lint