]> git.lizzy.rs Git - rust.git/log
rust.git
4 years agoRe-add false positive check
Lzu Tao [Fri, 23 Aug 2019 08:46:23 +0000 (15:46 +0700)]
Re-add false positive check

4 years agoAdd raw string regression test for useless_format lint
Lzu Tao [Fri, 23 Aug 2019 08:01:41 +0000 (08:01 +0000)]
Add raw string regression test for useless_format lint

4 years agoRe-factor useless_format lint
Lzu Tao [Fri, 23 Aug 2019 05:26:24 +0000 (12:26 +0700)]
Re-factor useless_format lint

4 years agoUpdate Unicode lint tests
Lzu Tao [Fri, 23 Aug 2019 05:42:45 +0000 (05:42 +0000)]
Update Unicode lint tests

4 years agoAuto merge of #4368 - RalfJung:invalid_ref, r=oli-obk
bors [Sun, 11 Aug 2019 09:08:22 +0000 (09:08 +0000)]
Auto merge of #4368 - RalfJung:invalid_ref, r=oli-obk

deprecate invalid_ref lint

This fixes the `invalid_ref` lint test to no longer fail when https://github.com/rust-lang/rust/pull/63346/ lands.  I also fixed the lint itself, because its wording made no sense: there is no "reference to zeroed/uninitialized memory" here.

changelog: none

4 years agoupdate_lints
Ralf Jung [Sun, 11 Aug 2019 09:02:25 +0000 (11:02 +0200)]
update_lints

4 years agodeprecate invalid_ref lint
Ralf Jung [Sun, 11 Aug 2019 07:30:20 +0000 (09:30 +0200)]
deprecate invalid_ref lint

4 years agoAuto merge of #4362 - lzutao:expect-on-cstring_as_ptr, r=flip1995
bors [Fri, 9 Aug 2019 09:22:02 +0000 (09:22 +0000)]
Auto merge of #4362 - lzutao:expect-on-cstring_as_ptr, r=flip1995

Fix lint_cstring_as_ptr for expect

Closes #4312
changelog: none

4 years agoAuto merge of #4361 - lzutao:fix-raw-string-on-single_char_pattern, r=phansch
bors [Fri, 9 Aug 2019 07:58:39 +0000 (07:58 +0000)]
Auto merge of #4361 - lzutao:fix-raw-string-on-single_char_pattern, r=phansch

Fix lint_single_char_pattern on raw string literal

Closes #4356
changelog: Handle raw string literal on `single_char_literal` lint.

4 years agoAdd more tests for raw string literal
Lzu Tao [Fri, 9 Aug 2019 03:45:49 +0000 (10:45 +0700)]
Add more tests for raw string literal

4 years agoAuto merge of #4360 - atouchet:patch-1, r=phansch
bors [Fri, 9 Aug 2019 06:07:00 +0000 (06:07 +0000)]
Auto merge of #4360 - atouchet:patch-1, r=phansch

Fix HTTPS in links

I accidentally missed these in my previous PR.

changelog: none

4 years agoFix lint_cstring_as_ptr for expect
Lzu Tao [Fri, 9 Aug 2019 05:33:07 +0000 (12:33 +0700)]
Fix lint_cstring_as_ptr for expect

4 years agoFix lint_single_char_pattern on raw string literal
Lzu Tao [Fri, 9 Aug 2019 03:45:49 +0000 (10:45 +0700)]
Fix lint_single_char_pattern on raw string literal

4 years agoFix HTTPS in links
Alex Touchet [Fri, 9 Aug 2019 02:59:22 +0000 (19:59 -0700)]
Fix HTTPS in links

4 years agoAuto merge of #4358 - lzutao:cleanup_implicit_return, r=flip1995
bors [Thu, 8 Aug 2019 16:36:44 +0000 (16:36 +0000)]
Auto merge of #4358 - lzutao:cleanup_implicit_return, r=flip1995

Use source_callsite() instead of recursive outer_expn_info()

changelog: none

4 years agoAuto merge of #4357 - lzutao:update-pr-template, r=flip1995
bors [Thu, 8 Aug 2019 15:56:09 +0000 (15:56 +0000)]
Auto merge of #4357 - lzutao:update-pr-template, r=flip1995

template: Update how to format source code with ./util/dev

changelog: none

4 years agoAuto merge of #4355 - lzutao:macro_expn_try_err, r=flip1995
bors [Thu, 8 Aug 2019 15:16:17 +0000 (15:16 +0000)]
Auto merge of #4355 - lzutao:macro_expn_try_err, r=flip1995

Fix macro expansion in try_err lint

Fixes #4309

changelog: none

4 years agotemplate: Update how to format source code with ./util/dev
Lzu Tao [Thu, 8 Aug 2019 14:37:19 +0000 (21:37 +0700)]
template: Update how to format source code with ./util/dev

4 years agoUse source_callsite() instead of recursive outer_expn_info()
Lzu Tao [Thu, 8 Aug 2019 14:28:40 +0000 (21:28 +0700)]
Use source_callsite() instead of recursive outer_expn_info()

4 years agoUse snippet_with_macro_callsite suggested by flip1995
Lzu Tao [Thu, 8 Aug 2019 12:33:34 +0000 (19:33 +0700)]
Use snippet_with_macro_callsite suggested by flip1995

4 years agoFix macro expansion in try_err lint
Lzu Tao [Thu, 8 Aug 2019 12:33:34 +0000 (19:33 +0700)]
Fix macro expansion in try_err lint

4 years agoAuto merge of #4350 - matthiaskrgr:readme_cargo_fix_clippy, r=phansch
bors [Wed, 7 Aug 2019 20:25:08 +0000 (20:25 +0000)]
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

4 years agoUpdate README.md (fix typo)
Matthias Krüger [Wed, 7 Aug 2019 19:07:35 +0000 (21:07 +0200)]
Update README.md (fix typo)

Co-Authored-By: Philipp Hansch <dev@phansch.net>
4 years agoREADME: mention that cargo fix has experimental support for applying some clippy...
Matthias Krüger [Wed, 7 Aug 2019 14:24:14 +0000 (16:24 +0200)]
README: mention that cargo fix has experimental support for applying some clippy lint suggestions via "cargo fix -Z unstable-options --clippy"

4 years agoAuto merge of #4339 - phansch:rustfix_needless_bool, r=flip1995
bors [Wed, 7 Aug 2019 11:00:09 +0000 (11:00 +0000)]
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

4 years agoAuto merge of #4345 - phansch:enum_variants_fix, r=flip1995
bors [Wed, 7 Aug 2019 10:22:06 +0000 (10:22 +0000)]
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

4 years agoAuto merge of #4346 - atouchet:links, r=flip1995
bors [Wed, 7 Aug 2019 08:31:47 +0000 (08:31 +0000)]
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

4 years agoAuto merge of #4340 - lzutao:rustup, r=oli-obk
bors [Wed, 7 Aug 2019 07:05:53 +0000 (07:05 +0000)]
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

4 years agoUpdate Readme
Alex Touchet [Tue, 6 Aug 2019 20:09:26 +0000 (13:09 -0700)]
Update Readme

4 years agoDon't emit enum_variant_names if remainder starts with a numeric
Philipp Hansch [Tue, 6 Aug 2019 18:45:36 +0000 (20:45 +0200)]
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

4 years agoRustup https://github.com/rust-lang/rust/pull/59369
Lzu Tao [Tue, 6 Aug 2019 12:20:41 +0000 (19:20 +0700)]
Rustup https://github.com/rust-lang/rust/pull/59369

4 years agoAdd run-rustfix for needless_bool lint
Philipp Hansch [Mon, 5 Aug 2019 20:05:05 +0000 (22:05 +0200)]
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.

4 years agoAuto merge of #4335 - phansch:fix_needless_bool_suggestion, r=flip1995
bors [Mon, 5 Aug 2019 18:54:11 +0000 (18:54 +0000)]
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

4 years agofmt
Philipp Hansch [Mon, 5 Aug 2019 18:53:13 +0000 (20:53 +0200)]
fmt

4 years agoFix needless_bool suggestion with if-else-if-else
Philipp Hansch [Sun, 4 Aug 2019 20:08:28 +0000 (22:08 +0200)]
Fix needless_bool suggestion with if-else-if-else

Closes #4334

4 years agoAuto merge of #4203 - Urriel:feat/333_calling_main, r=flip1995
bors [Mon, 5 Aug 2019 15:54:44 +0000 (15:54 +0000)]
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

4 years agoIgnore no_std-test on windows and macos
flip1995 [Mon, 5 Aug 2019 15:53:55 +0000 (17:53 +0200)]
Ignore no_std-test on windows and macos

4 years agoRun update_lints and fmt
flip1995 [Mon, 5 Aug 2019 11:24:31 +0000 (13:24 +0200)]
Run update_lints and fmt

4 years agoMove expression check to LateLintPass
Vincent Dal Maso [Mon, 17 Jun 2019 15:36:42 +0000 (17:36 +0200)]
Move expression check to LateLintPass

Changes:
- Move from EarlyLintPass
- Fix entrypoint check with function path def_id.

4 years agoAdd recursion check on main function
Vincent Dal Maso [Thu, 13 Jun 2019 08:58:35 +0000 (10:58 +0200)]
Add recursion check on main function

Changes:
- Add MainRecursion lint to clippy
- Check for no-std setup

fixes #333

4 years agoAuto merge of #4338 - flip1995:rollup-9cm4jbr, r=flip1995
bors [Mon, 5 Aug 2019 09:44:45 +0000 (09:44 +0000)]
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

4 years agoRollup merge of #4332 - phansch:rustfix_unnecessary_cast, r=flip1995
Philipp Krones [Mon, 5 Aug 2019 08:50:07 +0000 (10:50 +0200)]
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

4 years agoRollup merge of #4331 - phansch:doctests_restriction, r=flip1995
Philipp Krones [Mon, 5 Aug 2019 08:50:06 +0000 (10:50 +0200)]
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)

4 years agoRollup merge of #4330 - phansch:doctests_nursery, r=flip1995
Philipp Krones [Mon, 5 Aug 2019 08:50:04 +0000 (10:50 +0200)]
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

4 years agoRollup merge of #4329 - phansch:doctests_pedantic, r=flip1995
Philipp Krones [Mon, 5 Aug 2019 08:50:03 +0000 (10:50 +0200)]
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

4 years agoAuto merge of #4337 - flip1995:let_unit, r=phansch
bors [Mon, 5 Aug 2019 08:41:24 +0000 (08:41 +0000)]
Auto merge of #4337 - flip1995:let_unit, r=phansch

 Make let_unit lint suggestion auto applicable

changelog: Make `let_unit` lint suggestion auto applicable

4 years agoAuto merge of #4333 - phansch:rustfix_decimal_literal_representation, r=flip1995
bors [Mon, 5 Aug 2019 08:00:39 +0000 (08:00 +0000)]
Auto merge of #4333 - phansch:rustfix_decimal_literal_representation, r=flip1995

Add run-rustfix for decimal_literal_representation lint

changelog: none

cc #3630

4 years agoAdd tests for auto fixable let_unit suggestion
flip1995 [Mon, 5 Aug 2019 07:30:24 +0000 (09:30 +0200)]
Add tests for auto fixable let_unit suggestion

4 years agoMake let_unit lint suggestion auto applicable
flip1995 [Mon, 5 Aug 2019 07:29:39 +0000 (09:29 +0200)]
Make let_unit lint suggestion auto applicable

4 years agoAuto merge of #4336 - phansch:rustup, r=flip1995
bors [Mon, 5 Aug 2019 07:23:07 +0000 (07:23 +0000)]
Auto merge of #4336 - phansch:rustup, r=flip1995

Rustup to https://github.com/rust-lang/rust/pull/63213

changelog: none

4 years agoRustup to https://github.com/rust-lang/rust/pull/63213
Philipp Hansch [Mon, 5 Aug 2019 05:30:01 +0000 (07:30 +0200)]
Rustup to https://github.com/rust-lang/rust/pull/63213

4 years agoAdd run-rustfix for decimal_literal_representation lint
Philipp Hansch [Sun, 4 Aug 2019 08:21:52 +0000 (10:21 +0200)]
Add run-rustfix for decimal_literal_representation lint

cc #3630

4 years agoSplit up cast.rs tests, run-rustfix for unnecessary_cast
Philipp Hansch [Sun, 4 Aug 2019 06:24:23 +0000 (08:24 +0200)]
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

4 years agoDoctests: Enable running doc tests for restriction lints
Philipp Hansch [Sat, 3 Aug 2019 19:24:50 +0000 (21:24 +0200)]
Doctests: Enable running doc tests for restriction lints

4 years agoDoctests: Enable running doc tests for nursery lints
Philipp Hansch [Sat, 3 Aug 2019 19:01:23 +0000 (21:01 +0200)]
Doctests: Enable running doc tests for nursery lints

4 years agoDoctests: Enable running doc tests for pedantic lints
Philipp Hansch [Sat, 3 Aug 2019 16:42:05 +0000 (18:42 +0200)]
Doctests: Enable running doc tests for pedantic lints

4 years agoAuto merge of #4327 - phansch:doctests_perf, r=flip1995
bors [Sat, 3 Aug 2019 14:06:13 +0000 (14:06 +0000)]
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

4 years agoAuto merge of #4325 - phansch:doctests_complexity, r=flip1995
bors [Sat, 3 Aug 2019 13:24:07 +0000 (13:24 +0000)]
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

4 years agoAuto merge of #4328 - phansch:rustup, r=phansch
bors [Sat, 3 Aug 2019 11:39:51 +0000 (11:39 +0000)]
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

4 years agoIgnore missing rustfmt
Philipp Hansch [Sat, 3 Aug 2019 10:30:51 +0000 (12:30 +0200)]
Ignore missing rustfmt

4 years agoRustup to latest rustc master
Philipp Hansch [Sat, 3 Aug 2019 06:44:32 +0000 (08:44 +0200)]
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`)

4 years agoAlso enable doc tests for internal lints
Philipp Hansch [Sat, 3 Aug 2019 06:12:53 +0000 (08:12 +0200)]
Also enable doc tests for internal lints

Because there were fixed in the parent commit.

4 years agoDoctests: Enable running doc tests for perf lints
Philipp Hansch [Sat, 3 Aug 2019 06:01:27 +0000 (08:01 +0200)]
Doctests: Enable running doc tests for perf lints

This should be possible to merge independently of #4325

cc #4319

4 years agoDoctests: Fix all complexity lint docs
Philipp Hansch [Fri, 2 Aug 2019 06:13:54 +0000 (08:13 +0200)]
Doctests: Fix all complexity lint docs

cc #4319

4 years agoAuto merge of #4322 - Y0hy0h:patch-1, r=phansch
bors [Thu, 1 Aug 2019 18:58:11 +0000 (18:58 +0000)]
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

4 years agoFix missing import
Y0hy0h [Thu, 1 Aug 2019 15:54:22 +0000 (17:54 +0200)]
Fix missing import

4 years agoAuto merge of #4314 - chansuke:add-negation-to-is_empty, r=flip1995
bors [Thu, 1 Aug 2019 14:09:59 +0000 (14:09 +0000)]
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.

4 years agoUpdate `stderr` file
chansuke [Thu, 1 Aug 2019 13:20:08 +0000 (22:20 +0900)]
Update `stderr` file

4 years agoAuto merge of #4307 - flip1995:unnecessary_unwrap, r=oli-obk
bors [Thu, 1 Aug 2019 13:18:04 +0000 (13:18 +0000)]
Auto merge of #4307 - flip1995:unnecessary_unwrap, r=oli-obk

Move {unnecessary,panicking}_unwrap out of nursery

Resolves #2437

changelog: Move `{unnnecessary,panicking}_unwrap` out of nursery

4 years agoFix doc tests
flip1995 [Thu, 1 Aug 2019 10:53:20 +0000 (12:53 +0200)]
Fix doc tests

4 years agoRemove Known problems for UNNECESSARY_UNWRAP
flip1995 [Tue, 30 Jul 2019 07:51:45 +0000 (09:51 +0200)]
Remove Known problems for UNNECESSARY_UNWRAP

This shouldn't happen with NLL

4 years agoMove UNNECESSARY_UNWRAP to complexity and PANICKING_UNWRAP to correctness
flip1995 [Tue, 30 Jul 2019 07:50:56 +0000 (09:50 +0200)]
Move UNNECESSARY_UNWRAP to complexity and PANICKING_UNWRAP to correctness

4 years agoAuto merge of #4318 - izik1:typo, r=phansch
bors [Thu, 1 Aug 2019 09:20:32 +0000 (09:20 +0000)]
Auto merge of #4318 - izik1:typo, r=phansch

Fix `for on` typo

<!--
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 -->

closes #4317

changelog: minor typo fix

4 years agoImprove documentation on implicit_hasher lint
Y0hy0h [Thu, 1 Aug 2019 08:51:39 +0000 (10:51 +0200)]
Improve documentation on implicit_hasher lint

Provide an example of how to fix the lint.

4 years agoAuto merge of #4316 - phansch:method_rs_cleanup2, r=flip1995
bors [Thu, 1 Aug 2019 08:40:15 +0000 (08:40 +0000)]
Auto merge of #4316 - phansch:method_rs_cleanup2, r=flip1995

UI Test Cleanup: No wrong_self_convention in methods.rs

These cases are already covered in `tests/ui/wrong_self_convention.rs`.

cc #2038

changelog: none

4 years agoAuto merge of #4315 - phansch:fn_to_numeric_cast_applicability, r=flip1995
bors [Thu, 1 Aug 2019 07:59:51 +0000 (07:59 +0000)]
Auto merge of #4315 - phansch:fn_to_numeric_cast_applicability, r=flip1995

Mark `fn_to_numeric_cast` lints as MaybeIncorrect

At least for now so that `cargo fix --clippy` is not causing problems
with this lint. See #3896 for the remaining problems with the suggestions of this lint.

changelog: none

cc #3630, #3896

4 years agoAuto merge of #4303 - mikerite:dev-fmt-20190728, r=flip1995
bors [Thu, 1 Aug 2019 07:24:32 +0000 (07:24 +0000)]
Auto merge of #4303 - mikerite:dev-fmt-20190728, r=flip1995

Make fmt test and command more robust

changelog: none

4 years agoFix `for on` typo
Zachery Gyurkovitz [Thu, 1 Aug 2019 05:24:57 +0000 (22:24 -0700)]
Fix `for on` typo

4 years agoUpdate formatting
Michael Wright [Thu, 1 Aug 2019 05:09:57 +0000 (07:09 +0200)]
Update formatting

4 years agoMerge branch 'master' into dev-fmt-20190728
Michael Wright [Thu, 1 Aug 2019 05:02:48 +0000 (07:02 +0200)]
Merge branch 'master' into dev-fmt-20190728

4 years agoUI Test Cleanup: No wrong_self_convention in methods.rs
Philipp Hansch [Thu, 1 Aug 2019 04:54:57 +0000 (06:54 +0200)]
UI Test Cleanup: No wrong_self_convention in methods.rs

These cases are already covered in `tests/ui/wrong_self_convention.rs`.

cc #2038

4 years agoMark `fn_to_numeric_cast` lints as MaybeIncorrect
Philipp Hansch [Wed, 31 Jul 2019 19:05:31 +0000 (21:05 +0200)]
Mark `fn_to_numeric_cast` lints as MaybeIncorrect

At least for now so that `cargo fix --clippy` is not causing problems
with this lint.

cc #3630, #3896

4 years agoAuto merge of #4313 - Manishearth:owl, r=yaahallo
bors [Wed, 31 Jul 2019 17:57:57 +0000 (17:57 +0000)]
Auto merge of #4313 - Manishearth:owl, r=yaahallo

Don't nudge people towards toilet closures when producing owl results

`.map_err(drop)` should never be linted since sometimes you want to produce `Result<(), ()>` and the alternative is `.map_err(|_| ())`, which can be ugly. We don't seem to, but it's good to specifically test for this.

changelog: none

r? @yaahallo

4 years agoDon't nudge people towards toilet closures when producing owl results
Manish Goregaokar [Wed, 31 Jul 2019 15:38:08 +0000 (08:38 -0700)]
Don't nudge people towards toilet closures when producing owl results

4 years agoAdd required negation in non_zero lint
chansuke [Mon, 29 Jul 2019 14:42:33 +0000 (23:42 +0900)]
Add required negation in non_zero lint

4 years agoAuto merge of #4308 - jakubadamw:use-self-variant-scope, r=flip1995
bors [Wed, 31 Jul 2019 14:50:01 +0000 (14:50 +0000)]
Auto merge of #4308 - jakubadamw:use-self-variant-scope, r=flip1995

Extend the `use_self` lint to suggest uses of `Self::Variant`

Fixes #4296.

changelog: Extend the `use_self` lint to suggest uses of `Self::Variant`

4 years agoUpdate all the code to pass the updated `use_self` lint.
Jakub Wieczorek [Wed, 31 Jul 2019 00:25:35 +0000 (00:25 +0000)]
Update all the code to pass the updated `use_self` lint.

One struct required a temporary `#[allow(dead_code)]` annotation due to
a bug in the Rust compiler: https://github.com/rust-lang/rust/issues/63151.

4 years agoExtend the `use_self` lint to suggest uses of `Self::Variant`.
Jakub Wieczorek [Wed, 31 Jul 2019 00:24:28 +0000 (00:24 +0000)]
Extend the `use_self` lint to suggest uses of `Self::Variant`.

4 years agoAuto merge of #3766 - xd009642:issue-3764, r=flip1995
bors [Tue, 30 Jul 2019 12:11:17 +0000 (12:11 +0000)]
Auto merge of #3766 - xd009642:issue-3764, r=flip1995

trait bounds lint - repeated types

This PR is to tackle https://github.com/rust-lang/rust-clippy/issues/3764 it's still a WIP and doesn't work but this is an initial stab. It builds though I haven't added any tests as I'm not sure where lint tests should go?

Unfortunately, it seems id isn't tied to the type itself but I guess where it is in the AST? Looking at https://manishearth.github.io/rust-internals-docs/syntax/ast/struct.Ty.html I can't see any members that would let me tell if a type was repeated in multiple trait bounds.

There may be other issues with how I've implemented this so any assistance is appreciated!

changelog: Add new lint: `type_repetition_in_bounds`

4 years agoAuto merge of #4306 - mikerite:fix-breakage-20190730, r=flip1995
bors [Tue, 30 Jul 2019 08:57:29 +0000 (08:57 +0000)]
Auto merge of #4306 - mikerite:fix-breakage-20190730, r=flip1995

Fix breakage due to rust-lang/rust#61856

changelog: none

4 years agoFix breakage due to rust-lang/rust#61856
Michael Wright [Tue, 30 Jul 2019 04:37:49 +0000 (06:37 +0200)]
Fix breakage due to rust-lang/rust#61856

4 years agoCorrect typo
Michael Wright [Mon, 29 Jul 2019 05:54:03 +0000 (07:54 +0200)]
Correct typo

4 years agoMake appveyor build ignore rustfmt unavailability
Michael Wright [Mon, 29 Jul 2019 05:51:44 +0000 (07:51 +0200)]
Make appveyor build ignore rustfmt unavailability

4 years agoFix dogfood test
xd009642 [Sun, 28 Jul 2019 08:31:05 +0000 (09:31 +0100)]
Fix dogfood test

4 years agoEnable rustfmt tests
Michael Wright [Sun, 28 Jul 2019 04:41:29 +0000 (06:41 +0200)]
Enable rustfmt tests

This reverts commit d73a953db7a8120ec00b31c57d7092aff0f2c10b.

4 years agoSkip fmt test if rustfmt is unavailble
Michael Wright [Sun, 28 Jul 2019 04:41:25 +0000 (06:41 +0200)]
Skip fmt test if rustfmt is unavailble

4 years agodev-fmt: better error handling
Michael Wright [Sun, 28 Jul 2019 04:41:13 +0000 (06:41 +0200)]
dev-fmt: better error handling

Check if rustfmt is installed at the start and exit if it isn't.

4 years agoHash discriminant of lifetime.name
xd009642 [Sat, 27 Jul 2019 22:04:36 +0000 (23:04 +0100)]
Hash discriminant of lifetime.name

4 years agoHash discriminant of Lifetime::Name
xd009642 [Sat, 27 Jul 2019 21:59:46 +0000 (22:59 +0100)]
Hash discriminant of Lifetime::Name

4 years agoUpdated tests.
xd009642 [Sat, 27 Jul 2019 21:53:26 +0000 (22:53 +0100)]
Updated tests.

Removed unnecessary type repetition in float test and regenerated stderr
Regenerated type_repetition stderr