Commit graph

5709 commits

Author SHA1 Message Date
bors
8fc0a738e3 Auto merge of #3869 - taiki-e:use_self, r=flip1995
Fix `use_self` false positive on nested functions

Related to https://github.com/rust-lang/rust-clippy/pull/3640

The current `use_self` warns the following code.

```rust
#![warn(clippy::use_self)]
struct Foo {}
impl Foo {
    fn bar() {
        fn baz() -> Foo { //^ warning: unnecessary structure name repetition
            Foo {} //^ warning: unnecessary structure name repetition
         }
    }
}
```
2019-03-12 12:09:56 +00:00
bors
6e2b8fa8ca Auto merge of #3872 - phansch:some_feature_cleanup, r=oli-obk
Remove some unused features and `error-pattern`s

None
2019-03-12 09:34:04 +00:00
bors
3d31c2157a Auto merge of #3794 - mikerite:fix-3739, r=phansch
Fix `boxed_local` suggestion

Don't warn about an argument that is moved into a closure.

ExprUseVisitor doesn't walk into nested bodies so use a new
visitor that collects the variables that are moved into closures.

Fixes #3739
2019-03-12 07:43:14 +00:00
Philipp Hansch
c730de955e
Remove some unused features and error-patterns 2019-03-12 08:15:50 +01:00
bors
75bfa29533 Auto merge of #3871 - taiki-e:needless_continue, r=phansch
Fix `needless_continue` false positive

If the `continue` has a label, check it matches the label of the loop.

Fixes https://github.com/rust-lang/rust-clippy/issues/2329
2019-03-12 07:04:44 +00:00
bors
b586d76b43 Auto merge of #3865 - phansch:run_more_doc_tests, r=flip1995
Run more doc tests

This executes some more doc tests that were ignored before.
2019-03-12 06:22:00 +00:00
Michael Wright
6937d5581a Merge branch 'master' into fix-3739 2019-03-12 08:13:44 +02:00
bors
94a8d9cbcd Auto merge of #3868 - taiki-e:needless_pass_by_value, r=phansch
Filter out proc_macro and proc_macro_attribute

Related to https://github.com/rust-lang/rust-clippy/pull/1617

Fixes https://github.com/rust-lang/rust-clippy/issues/3067 (this issue has already been closed, but in fact the false positive in `#[proc_macro]` and `#[proc_macro_attribute]` has not been fixed yet)
2019-03-12 06:01:00 +00:00
Philipp Hansch
9ca34e37fa
Run more doc tests
This executes some more doc tests that were ignored before.
2019-03-12 06:53:25 +01:00
Taiki Endo
1bc7da2fec Fix needless_continue false positive 2019-03-12 03:40:30 +09:00
Taiki Endo
187ce4c5ab Fix use_self false positive on nested functions 2019-03-11 23:24:49 +09:00
Taiki Endo
4896b259eb Filter out proc_macro and proc_macro_attribute 2019-03-11 20:45:57 +09:00
bors
1cdac4a9c7 Auto merge of #3767 - alexreg:cosmetic-2, r=flip1995
Various cosmetic improvements

Related to the larger effort of https://github.com/rust-lang/rust/pull/58036.
2019-03-10 23:21:48 +00:00
flip1995
72aeaa891b
Fix/Ignore doc tests 2019-03-10 23:01:56 +01:00
flip1995
44c46d2059
Run rustfmt 2019-03-10 22:12:26 +01:00
flip1995
3282955238
Update tests 2019-03-10 22:07:10 +01:00
Alexander Regueiro
a7c0800938 Reblessed test outputs. 2019-03-10 18:13:15 +00:00
Alexander Regueiro
d2b85323ad Addressed points raised in review. 2019-03-10 18:06:28 +00:00
Alexander Regueiro
d43966a176 Various cosmetic improvements. 2019-03-10 18:06:28 +00:00
bors
016d92d6ed Auto merge of #3733 - Zoxc:rustc-interface, r=oli-obk
Use the new rustc interface

Shows the changes required to compile with https://github.com/rust-lang/rust/pull/56732
2019-03-10 14:26:31 +00:00
John Kåre Alsaker
1388f2488e rustfmt 2019-03-10 12:00:17 +01:00
John Kåre Alsaker
0d4a19c0d1 Use the new rustc interface 2019-03-10 11:10:05 +01:00
bors
9308df7507 Auto merge of #3863 - rust-lang:get_unwrap, r=oli-obk
Move get_unwrap to restriction

fixes #3862

r? @oli-obk
2019-03-10 08:52:24 +00:00
Manish Goregaokar
038ec7f5d8 Move get_unwrap to restriction
fixes #3862
2019-03-09 13:48:06 -08:00
bors
920112d723 Auto merge of #3824 - phansch:adding_lints, r=phansch
Add lint writing documentation

[Rendered](https://github.com/phansch/rust-clippy/blob/adding_lints/doc/adding_lints.md)

This adds a new documentation page that explains how to write Clippy
lints. It guides the reader through creating a `foo` function lint.

I plan to iterate a bit more on the prose of some sections, but I think the
general structure is fine now, so I'm looking forward to feedback =)

One thing I'm not sure about: I felt like this is too big for CONTRIBUTING.md
so I put it into a new `doc/` directory. I can imagine having more
documentation in the future, so we might even want to create a book using
mdbook instead? Or should everything go into CONTRIBUTING.md?

Further things left to do:

- [x] Link from CONTRIBUTING.md
- [x] Remove things covered in this guide from CONTRIBUTING.md
- [x] Section about `clippy::author` attribute
- [x] Run `remark-lint` on CI over the `doc` directory and fix things
2019-03-09 15:05:38 +00:00
bors
ccfbfb8097 Auto merge of #3860 - phansch:refactor_out_opt_def_id, r=flip1995
Refactor: Remove utils::opt_def_id

This removes some indirection. Probably this method was uplifted to
rustc at some point?
2019-03-09 12:05:41 +00:00
bors
8213d252ae Auto merge of #3861 - flip1995:rollup, r=flip1995
Rollup of 3 pull requests

Successful merges:

 - #3851 (Refactor: Extract `trait_ref_of_method` function)
 - #3852 (Refactor: Cleanup one part of assign_ops lint)
 - #3857 (Document match_path, improve match_qpath docs)

Failed merges:

r? @ghost
2019-03-09 11:41:26 +00:00
Philipp Krones
c32135a87f
Rollup merge of #3857 - phansch:document_path_qpath, r=flip1995
Document match_path, improve match_qpath docs

Inching towards enabling `#[deny(missing_docs)]` in utils 📜
2019-03-09 12:24:44 +01:00
Philipp Krones
f69351e995
Rollup merge of #3852 - phansch:refactor_assign_ops, r=flip1995
Refactor: Cleanup one part of assign_ops lint

Removes a lot of indentation and separates lint emission from lint
logic. Only touches the `hir::ExprKind::AssignOp` part of the lint.
2019-03-09 12:24:43 +01:00
Philipp Krones
1902384d15
Rollup merge of #3851 - phansch:refactor_trait_stuff, r=flip1995
Refactor: Extract `trait_ref_of_method` function

This pattern was used in three places after #3844, so I think it's worth moving it into `utils/mod.rs` and documenting it.
2019-03-09 12:24:42 +01:00
bors
bd6b5a1a36 Auto merge of #3854 - ljedrz:rustc_58992, r=phansch
Align with rust-lang/rust/#58992

Some adjustments needed after the most recent round of HirIdification.
2019-03-08 17:10:52 +00:00
Philipp Hansch
9d97ed6faa
Refactor: Remove utils::opt_def_id
This removes some indirection. Probably this method was uplifted to
rustc at some point?
2019-03-08 14:14:41 +01:00
Philipp Hansch
f04acdd463
Document match_path, improve match_qpath docs 2019-03-08 09:50:20 +01:00
Philipp Hansch
9494f22f06
cargo fmt 2019-03-08 09:44:22 +01:00
Philipp Hansch
131b89b54e
fmt 2019-03-08 09:43:36 +01:00
Philipp Krones
837d675afd
Update clippy_lints/src/utils/mod.rs
Co-Authored-By: phansch <dev@phansch.net>
2019-03-08 09:40:12 +01:00
Philipp Hansch
65694cc6c8
Fix doctest 2019-03-08 09:10:41 +01:00
Philipp Hansch
5c9221f880
Refactor: Cleanup one part of assign_ops lint
Removes a lot of indentation and separates lint emission from lint
logic. Only touches the `hir::ExprKind::AssignOp` part of the lint.
2019-03-08 09:01:29 +01:00
Philipp Hansch
34685a5f60
Update comment location 2019-03-08 08:50:13 +01:00
bors
9702b3d2c0 Auto merge of #3856 - mikerite:clippy-dev-enchancement-1, r=phansch
Improve Clippy dev help

+ Print help if no subcommand is supplied
+ Make a short version of `update_lints` help for the subcommand listing
2019-03-08 07:36:32 +00:00
bors
90d4350055 Auto merge of #3855 - rchaser53:issue-3849, r=flip1995
Remove an unused binary file

related https://github.com/rust-lang/rust-clippy/pull/3853
I'm sorry.
2019-03-08 07:16:28 +00:00
Michael Wright
acd6d4d094 Improve Clippy dev help
+ Print help if no subcommand is supplied
+ Make a short version of `update_lints` help for the subcommand listing
2019-03-08 07:45:31 +02:00
rChaser53
fa2691b179
Remove an unused binary file 2019-03-08 08:14:29 +09:00
ljedrz
5d78250c75 align with rust-lang/rust/#58992 2019-03-07 21:51:05 +01:00
bors
77ba5045d7 Auto merge of #3853 - rchaser53:issue-3849, r=flip1995
fix missing a semicolon

related: https://github.com/rust-lang/rust-clippy/issues/3849
2019-03-07 15:02:53 +00:00
rchaser53
ae787d954e fix missing a semicolon 2019-03-07 23:26:47 +09:00
Philipp Hansch
e1d47cd5f1
Refactor: Extract trait_ref_of_method function 2019-03-07 08:17:43 +01:00
bors
0d8937299e Auto merge of #3850 - mikerite:rustfmt-tests, r=phansch
More test improvements
2019-03-07 07:05:35 +00:00
Michael Wright
7b948232ba Enable rustfix on unused_unit tests 2019-03-07 08:26:53 +02:00
Michael Wright
fbcf7eefb9 Add [rustfmt::skip] to unused_unit test 2019-03-07 08:13:59 +02:00