Lzu Tao
59a35874c1
Use source_callsite() instead of recursive outer_expn_info()
2019-08-08 21:28:40 +07:00
Lzu Tao
90a7b60413
Use snippet_with_macro_callsite suggested by flip1995
2019-08-08 21:21:59 +07:00
Lzu Tao
0487b58f9a
Fix macro expansion in try_err lint
2019-08-08 20:22:52 +07:00
bors
7bd7d40789
Auto merge of #4350 - matthiaskrgr:readme_cargo_fix_clippy, r=phansch
...
README: mention experimental cargo fix clippy support
mention that cargo fix has experimental support for applying some clippy lint suggestions via "cargo fix -Z unstable-options --clippy"
[Rendered](https://github.com/matthiaskrgr/rust-clippy/tree/readme_cargo_fix_clippy#auto-applying-clippy-suggestions )
changelog: none
2019-08-07 20:25:08 +00:00
Matthias Krüger
39cdea6df4
Update README.md (fix typo)
...
Co-Authored-By: Philipp Hansch <dev@phansch.net>
2019-08-07 21:07:35 +02:00
Matthias Krüger
8dde4e5806
README: mention that cargo fix has experimental support for applying some clippy lint suggestions via "cargo fix -Z unstable-options --clippy"
2019-08-07 16:27:08 +02:00
bors
e76ef1db03
Auto merge of #4339 - phansch:rustfix_needless_bool, r=flip1995
...
Add run-rustfix for needless_bool lint
This splits up the needless_bool tests into `fixable.rs` and
`simple.rs`. `simple.rs` contains the code that triggers the lint
diagnostic without a suggestion.
changelog: none
cc #3630
2019-08-07 11:00:09 +00:00
bors
286d528a45
Auto merge of #4345 - phansch:enum_variants_fix, r=flip1995
...
Don't emit enum_variant_names if remainder starts with a numeric
changelog: Fix false positive in `pub_enum_variant_names` and `enum_variant_names`
As [per the reference](https://doc.rust-lang.org/reference/identifiers.html ), identifiers must start with a letter. So we don't suggest a better
variant naming in case the remainder would start with a numeric.
Fixes #739
2019-08-07 10:22:06 +00:00
bors
8fed08dfb1
Auto merge of #4346 - atouchet:links, r=flip1995
...
Update Readme
<!--
Thank you for making Clippy better!
We're collecting our changelog from pull request descriptions.
If your PR only updates to the latest nightly, you can leave the
`changelog` entry as `none`. Otherwise, please write a short comment
explaining your change.
If your PR fixes an issue, you can add "fixes #issue_number" into this
PR description. This way the issue will be automatically closed when
your PR is merged.
If you added a new lint, here's a checklist for things that will be
checked during review or continuous integration.
- [ ] Followed [lint naming conventions][lint_naming]
- [ ] Added passing UI tests (including committed `.stderr` file)
- [ ] `cargo test` passes locally
- [ ] Executed `util/dev update_lints`
- [ ] Added lint documentation
- [ ] Run `cargo fmt`
Note that you can skip the above if you are just opening a WIP PR in
order to get feedback.
Delete this line and everything above before opening your PR -->
changelog: none
2019-08-07 08:31:47 +00:00
bors
b041511b5f
Auto merge of #4340 - lzutao:rustup, r=oli-obk
...
Rustup https://github.com/rust-lang/rust/pull/59369
Unblock https://github.com/rust-lang/rust/pull/63280
changelog: none
2019-08-07 07:05:53 +00:00
Alex Touchet
4b2825cd3f
Update Readme
2019-08-06 13:09:26 -07:00
Philipp Hansch
0a988c6630
Don't emit enum_variant_names if remainder starts with a numeric
...
As [per the reference](https://doc.rust-lang.org/reference/identifiers.html ),
identifiers must start with a letter. So we don't suggest a better
variant naming in these cases.
Fixes #739
2019-08-06 20:45:36 +02:00
Lzu Tao
e4f8cd9672
Rustup https://github.com/rust-lang/rust/pull/59369
2019-08-06 19:20:41 +07:00
Philipp Hansch
39c8f84f3b
Add run-rustfix for needless_bool lint
...
This splits up the needless_bool tests into `fixable.rs` and
`simple.rs`. `simple.rs` contains the code that triggers the lint
diagnostic without a suggestion.
2019-08-05 22:10:56 +02:00
bors
ea26a95fc9
Auto merge of #4335 - phansch:fix_needless_bool_suggestion, r=flip1995
...
Fix needless_bool suggestion with if--else-if--else
changelog: Fix `needless_bool` suggestion with if--else-if--else
Closes #4334
2019-08-05 18:54:11 +00:00
Philipp Hansch
cdfb72a5e1
fmt
2019-08-05 20:53:24 +02:00
Philipp Hansch
4cfb0966a1
Fix needless_bool suggestion with if-else-if-else
...
Closes #4334
2019-08-05 20:52:38 +02:00
bors
a813c057d5
Auto merge of #4203 - Urriel:feat/333_calling_main, r=flip1995
...
Add recursion check on main function
Changes:
- Add MainRecursion lint to Clippy
- Check for no-std setup
fixes #333
changelog: Add `main_recursion` lint
2019-08-05 15:54:44 +00:00
flip1995
dabf599c90
Ignore no_std-test on windows and macos
2019-08-05 17:53:55 +02:00
flip1995
a922f800af
Run update_lints and fmt
2019-08-05 13:24:31 +02:00
Vincent Dal Maso
77b21b644f
Move expression check to LateLintPass
...
Changes:
- Move from EarlyLintPass
- Fix entrypoint check with function path def_id.
2019-08-05 13:23:30 +02:00
Vincent Dal Maso
4eab691db6
Add recursion check on main function
...
Changes:
- Add MainRecursion lint to clippy
- Check for no-std setup
fixes #333
2019-08-05 13:23:30 +02:00
bors
ca6a9beb31
Auto merge of #4338 - flip1995:rollup-9cm4jbr, r=flip1995
...
Rollup of 4 pull requests
Successful merges:
- #4329 (Doctests: Enable running doc tests for pedantic lints)
- #4330 (Doctests: Enable running doc tests for nursery lints)
- #4331 (Doctests: Enable running doc tests for restriction lints)
- #4332 (Split up cast.rs tests, run-rustfix for unnecessary_cast)
Failed merges:
r? @ghost
changelog: none
2019-08-05 09:44:45 +00:00
Philipp Krones
9259eeb689
Rollup merge of #4332 - phansch:rustfix_unnecessary_cast, r=flip1995
...
Split up cast.rs tests, run-rustfix for unnecessary_cast
This splits up the cast.rs tests and enables rustfix tests for the part
of the `unnecessary_cast` lint that emits `MachineApplicable`
suggestions.
changelog: none
cc #3630
2019-08-05 10:50:07 +02:00
Philipp Krones
93c3da223f
Rollup merge of #4331 - phansch:doctests_restriction, r=flip1995
...
Doctests: Enable running doc tests for restriction lints
changelog: Enabled remaining doc tests for lint documentation page
master: 202 passed; 0 failed; 122 ignored; 0 measured; 0 filtered out
this PR: 231 passed; 0 failed; 123 ignored; 0 measured; 0 filtered out
Closes #4319 (assuming this is merged after #4329 and #4330 )
2019-08-05 10:50:06 +02:00
Philipp Krones
f5db24a59f
Rollup merge of #4330 - phansch:doctests_nursery, r=flip1995
...
Doctests: Enable running doc tests for nursery lints
changelog: none
master: 202 passed; 0 failed; 122 ignored; 0 measured; 0 filtered out
this PR: 213 passed; 0 failed; 122 ignored; 0 measured; 0 filtered out
cc #4319
2019-08-05 10:50:04 +02:00
Philipp Krones
713ad964af
Rollup merge of #4329 - phansch:doctests_pedantic, r=flip1995
...
Doctests: Enable running doc tests for pedantic lints
changelog: none
master: 202 passed; 0 failed; 122 ignored; 0 measured; 0 filtered out
this PR: 254 passed; 0 failed; 131 ignored; 0 measured; 0 filtered out
cc #4319
2019-08-05 10:50:03 +02:00
bors
a90b3ba301
Auto merge of #4337 - flip1995:let_unit, r=phansch
...
Make let_unit lint suggestion auto applicable
changelog: Make `let_unit` lint suggestion auto applicable
2019-08-05 08:41:24 +00:00
bors
20021bb4c7
Auto merge of #4333 - phansch:rustfix_decimal_literal_representation, r=flip1995
...
Add run-rustfix for decimal_literal_representation lint
changelog: none
cc #3630
2019-08-05 08:00:39 +00:00
flip1995
385f4474da
Add tests for auto fixable let_unit suggestion
2019-08-05 09:31:08 +02:00
flip1995
c5ad0b075a
Make let_unit lint suggestion auto applicable
2019-08-05 09:31:08 +02:00
bors
495a571f09
Auto merge of #4336 - phansch:rustup, r=flip1995
...
Rustup to https://github.com/rust-lang/rust/pull/63213
changelog: none
2019-08-05 07:23:07 +00:00
Philipp Hansch
71a943820b
Rustup to https://github.com/rust-lang/rust/pull/63213
2019-08-05 07:30:01 +02:00
Philipp Hansch
a332febb04
Add run-rustfix for decimal_literal_representation lint
...
cc #3630
2019-08-04 10:21:52 +02:00
Philipp Hansch
2d84d0361d
Split up cast.rs tests, run-rustfix for unnecessary_cast
...
This splits up the cast.rs tests and enables rustfix tests for the part
of the `unnecessary_cast` lint that emits `MachineApplicable`
suggestions.
cc #3630
2019-08-04 08:24:23 +02:00
Philipp Hansch
b608e02e1c
Doctests: Enable running doc tests for restriction lints
2019-08-03 21:24:50 +02:00
Philipp Hansch
2f48effc92
Doctests: Enable running doc tests for nursery lints
2019-08-03 21:01:23 +02:00
Philipp Hansch
1dc9a5012e
Doctests: Enable running doc tests for pedantic lints
2019-08-03 20:36:38 +02:00
bors
5c1e30ab05
Auto merge of #4327 - phansch:doctests_perf, r=flip1995
...
Doctests: Enable running doc tests for perf lints
changelog: none
This should be possible to merge independently of #4325
cc #4319
2019-08-03 14:06:13 +00:00
bors
3dc91838e4
Auto merge of #4325 - phansch:doctests_complexity, r=flip1995
...
Doctests: Enable running doc tests for complexity lints
changelog: none
master: `113 passed; 0 failed; 91 ignored; 0 measured; 0 filtered out`
this PR: `181 passed; 0 failed; 110 ignored; 0 measured; 0 filtered out`
cc #4319
2019-08-03 13:24:07 +00:00
bors
a24c7046f2
Auto merge of #4328 - phansch:rustup, r=phansch
...
Rustup to latest rustc master
Broken due to:
* https://github.com/rust-lang/rust/pull/63180 (`Existential` -> `OpaqueTy`)
* https://github.com/rust-lang/rust/pull/63121 (New fields for `FormatSpec`)
changelog: none
2019-08-03 11:39:51 +00:00
Philipp Hansch
ff59f4ad21
Ignore missing rustfmt
2019-08-03 12:30:51 +02:00
Philipp Hansch
d61df4f609
Rustup to latest rustc master
...
Broken due to:
* https://github.com/rust-lang/rust/pull/63180 (`Existential` -> `OpaqueTy`)
* https://github.com/rust-lang/rust/pull/63121 (New fields for `FormatSpec`)
2019-08-03 08:44:32 +02:00
Philipp Hansch
eb68dc9a1a
Also enable doc tests for internal lints
...
Because there were fixed in the parent commit.
2019-08-03 08:12:53 +02:00
Philipp Hansch
c0cdfd296e
Doctests: Enable running doc tests for perf lints
...
This should be possible to merge independently of #4325
cc #4319
2019-08-03 08:08:00 +02:00
Philipp Hansch
abfa8a952c
Doctests: Fix all complexity lint docs
...
cc #4319
2019-08-02 18:16:35 +02:00
bors
d43ef7aa3f
Auto merge of #4322 - Y0hy0h:patch-1, r=phansch
...
Improve documentation on implicit_hasher lint
Provide an example of how to fix the implicit_hasher lint.
Fixes #3475 .
changelog: none
2019-08-01 18:58:11 +00:00
Y0hy0h
5decadd93e
Fix missing import
2019-08-01 17:54:22 +02:00
bors
18a7dce4da
Auto merge of #4314 - chansuke:add-negation-to-is_empty, r=flip1995
...
Add negation to `len_zero` lint to show more explicit message.
Fixes #4304 I have updated the `len_zero` to show the required negation in case of like the below case.
```
fn main() {
let v = vec![1];
if v.len() > 0 {
}
}
```
changelog: Clarify suggestion of `len_zero` lint.
2019-08-01 14:09:59 +00:00
chansuke
ccc3257c91
Update stderr
file
2019-08-01 22:20:08 +09:00