Commit graph

6656 commits

Author SHA1 Message Date
Philipp Hansch
31cf2f2f35
Change float_cmp Applicability to HasPlaceholders
The suggestion includes an 'errors' placeholder currently, so it's not
`MachineApplicable`
2019-08-28 07:23:23 +02:00
Philipp Hansch
8a161d71f8
Add run-rustfix for rename test
I removed the `Bar` static and `Foo` impl because they are not needed
for what's tested here as far as I can tell.
2019-08-28 07:23:23 +02:00
Philipp Hansch
dea92fada5
Add run-rustfix for outer_expn_data 2019-08-28 07:23:23 +02:00
Philipp Hansch
a3418933c6
Add run-rustfix for useless_attribute test 2019-08-28 07:23:23 +02:00
Philipp Hansch
b6e87c6ae3
Add run-rustfix for int_plus_one test 2019-08-28 07:23:23 +02:00
Philipp Hansch
cb341c8090
Add run-rustfix for assign_ops test 2019-08-28 07:23:23 +02:00
bors
949b347f65 Auto merge of #4444 - phansch:split_up_cmp_owned2, r=flip1995
Split up cmp_owned tests, add run-rustfix

Some of the cmp_owned tests emitted non-machine-applicable suggestions,
so I moved them to `tests/ui/cmp_owned/without_suggestion.rs` and added
`// run-rustfix` to the other half.

changelog: none

cc #3630
2019-08-26 14:32:12 +00:00
bors
fea888f2ec Auto merge of #4445 - phansch:fix_unused_unit_sugg, r=flip1995
Fix unused_unit false positive

changelog: Fix `unused_unit` false positive

For some reason the `expr` of `stmt.node` didn't contain the expansion information, but the `stmt.span` does.

Fixes #4076
2019-08-26 13:29:01 +00:00
Philipp Hansch
6d425a60a7
Use correct path in comment
Co-Authored-By: Philipp Krones <hello@philkrones.com>
2019-08-26 15:28:35 +02:00
bors
f760088820 Auto merge of #4430 - lzutao:defid_trait_alias, r=flip1995
Account for trait alias when looking for defid

I hit the crash on the `expect` call when running clippy on rustc libcore.
Hopefully this will fix it.
changelog: none
2019-08-26 12:46:00 +00:00
Lzu Tao
c222e7eca7
Add regression test for looking for trait defid in nocore 2019-08-26 14:45:28 +02:00
bors
ba6681300e Auto merge of #4436 - BO41:written_as, r=phansch
Add some "could be written as" examples

fixes #4405
changelog: none
2019-08-26 11:11:57 +00:00
bors
b8e5e6f3c2 Auto merge of #4421 - lzutao:unsep_literal, r=flip1995
Cleaner code for unsep literals

Continuing discussion in https://github.com/rust-lang/rust-clippy/pull/4401#issuecomment-522498754
changelog: none
r? @flip1995
2019-08-26 10:32:24 +00:00
bors
7f15607e9a Auto merge of #4451 - hvenev:non-exec, r=flip1995
Mark rust source file as non-executable.

It would be nice if you can backport this to beta as well.

changelog: none
2019-08-26 09:53:34 +00:00
bors
d089032331 Auto merge of #4431 - phansch:more_rustfix, r=flip1995
Add 3 more run-rustfix headers

changelog: none

cc #3630
2019-08-26 09:15:20 +00:00
Lzu Tao
c1a4b26406 Cleaner code for unsep literals 2019-08-26 16:11:43 +07:00
flip1995
0fc8eaf294
Remove empty *.std{err,out} files 2019-08-26 10:22:34 +02:00
Hristo Venev
2a009b0ebf Mark rust source file as non-executable. 2019-08-25 17:49:45 +00:00
Lzu Tao
dac2509bac Account for trait alias when looking for defid 2019-08-25 20:36:11 +07:00
bors
05f603e6ce Auto merge of #4447 - phansch:fix_build, r=matthiaskrgr
Rustup to https://github.com/rust-lang/rust/pull/63854

changelog: none
2019-08-25 06:25:35 +00:00
Philipp Hansch
818b2ccfc5
Rustup to https://github.com/rust-lang/rust/pull/63854 2019-08-25 08:06:32 +02:00
Philipp Hansch
957dedb11d
Fix unused_unit false positive
Fixes #4076
2019-08-24 22:09:02 +02:00
BO41
31a6ab47e1 Fix lint doc 2019-08-24 13:57:25 +02:00
Philipp Hansch
9a0b598b73
Split up cmp_owned tests, add run-rustfix
Some of the cmp_owned tests emitted non-machine-applicable suggestions,
so I moved them to `tests/ui/cmp_owned/without_suggestion.rs` and added
`// run-rustfix` to the other half.

cc #3630
2019-08-24 10:38:45 +02:00
bors
2bcb615594 Auto merge of #4443 - jeremystucki:methods-refactoring, r=phansch
Small refactoring of methods/mod.rs

changelog: none
2019-08-24 07:45:29 +00:00
Jeremy Stucki
2da8288433
Refactor some minor things 2019-08-23 22:52:04 +02:00
Jeremy Stucki
907aebcf8b
Use more if-chains 2019-08-23 22:51:44 +02:00
Jeremy Stucki
4130dfba2e
Refactor 'lint_or_fun_call' 2019-08-23 22:31:22 +02:00
Jeremy Stucki
419c87fb35
Refactor 'check_unwrap_or_default' 2019-08-23 14:36:00 +02:00
Jeremy Stucki
1436fea271
Refactor 'check_impl_item' 2019-08-23 14:20:55 +02:00
bors
56f51b35e8 Auto merge of #4409 - jeremystucki:export, r=phansch
[Doc] Ignore lines starting with #

Resolves #4353

changelog: none
2019-08-23 11:51:50 +00:00
bors
a175ca4e8e Auto merge of #4438 - lzutao:author-litstr-missing, r=phansch
Add missing field to LitKind::Str

changelog: none
2019-08-23 11:12:04 +00:00
Lzu Tao
5b367ed4a3 Add missing field to LitKind::Str 2019-08-23 18:02:13 +07:00
bors
7a11843853 Auto merge of #4439 - lzutao:fix-format, r=phansch
Re-factor format lint

cc #4432

changelog: none
2019-08-23 10:23:52 +00:00
Lzu Tao
ab335eacb4 Run update_lints for Unicode lint 2019-08-23 09:49:49 +00:00
Lzu Tao
f717a77ecc Re-add false positive check 2019-08-23 09:16:50 +00:00
Lzu Tao
ce2d2920ef Add raw string regression test for useless_format lint 2019-08-23 09:16:50 +00:00
Lzu Tao
09d302a786 Re-factor useless_format lint 2019-08-23 09:16:50 +00:00
Philipp Hansch
6e4aa666b3
Merge pull request #4440 from lzutao/fix-unicode
Update Unicode lint tests
2019-08-23 09:39:11 +02:00
Lzu Tao
4134e608c5 Update Unicode lint tests 2019-08-23 05:42:45 +00:00
BO41
eebb7cd839 Add examples to some complexity lints 2019-08-22 15:41:07 +02:00
BO41
3f56cb5d8b Add example to a perf lint 2019-08-22 15:41:07 +02:00
BO41
43a2ba34e6 Add examples to some correctness lints 2019-08-22 15:41:07 +02:00
Philipp Hansch
55aa9d2767
Add run-rustfix for range_plus_minus_one tests 2019-08-22 07:47:30 +02:00
Philipp Hansch
18fb1d9d2f
Add run-rustfix for or_fun_call tests 2019-08-22 07:41:00 +02:00
Philipp Hansch
9bda1e2264
Add run-rustfix for short_circuit_statement test 2019-08-22 07:21:29 +02:00
bors
6d9ee9e5eb Auto merge of #4372 - phansch:changelog_update, r=flip1995
docs: Explain how to update the changelog

cc @Manishearth Is this more or less how you did it last time?

[Rendered](https://github.com/phansch/rust-clippy/blob/changelog_update/doc/changelog_update.md#changelog-update)

changelog: none
2019-08-21 08:46:10 +00:00
bors
57c67a29d2 Auto merge of #4352 - phansch:fix_redundant_pattern_matching, r=flip1995
Fix some suggestions for redundant_pattern_matching

.. and change the Applicability to `MaybeIncorrect`.

Fixes the problem displayed in https://github.com/rust-lang/rust-clippy/issues/4344#issuecomment-519206388.

We now append `{}` to the suggestion so that the conditional has the
correct syntax again.

(If we were to _remove_ the `if` instead, it would trigger the
`unused_must_use` warning for `#[must_use]` types.)

changelog: Fix some suggestions for `redundant_pattern_matching`
2019-08-21 08:15:36 +00:00
bors
45d24fd6bf Auto merge of #4425 - mikerite:4375, r=flip1995
Fix `temporary_cstring_as_ptr` false negative

Fixes #4375.

Changes the check to test when `.unwrap().as_ptr()` is called on any
`Result<CString, _>` as suggested by @flip1995
(https://github.com/rust-lang/rust-clippy/issues/4375#issuecomment-520724123).

changelog: Fix `temporary_cstring_as_ptr` false negative
2019-08-21 07:25:58 +00:00
Philipp Hansch
436d429d27
Add two more tests, allow 2 other lints. 2019-08-21 07:43:42 +02:00