]> git.lizzy.rs Git - rust.git/log
rust.git
5 years agoFix `unit_arg` false positive
Michael Wright [Tue, 29 Jan 2019 05:22:08 +0000 (07:22 +0200)]
Fix `unit_arg` false positive

Ignore arguments with the question mark operator.

Closes #2945

5 years agoAuto merge of #3700 - phansch:would_you_like_some_help_with_this_const_fn, r=oli-obk
bors [Mon, 28 Jan 2019 14:30:18 +0000 (14:30 +0000)]
Auto merge of #3700 - phansch:would_you_like_some_help_with_this_const_fn, r=oli-obk

Prevent incorrect cast_lossless suggestion in const_fn

`::from` is not a const fn, so applying the suggestion of
`cast_lossless` would fail to compile. The fix is to skip the lint if
the cast is found inside a const fn.

Fixes #3656

5 years agoAuto merge of #3711 - rust-lang:rustup, r=oli-obk
bors [Mon, 28 Jan 2019 11:37:45 +0000 (11:37 +0000)]
Auto merge of #3711 - rust-lang:rustup, r=oli-obk

Rustup

fixes #3709

I'm currently in the process of making rustc's deprecation lint emit the `AtomicFoo::new(0)` suggestion

5 years agoRustfmt
Oliver Scherer [Mon, 28 Jan 2019 10:32:41 +0000 (11:32 +0100)]
Rustfmt

5 years agoCheck hypothetically failing conversion
Oliver Scherer [Mon, 28 Jan 2019 09:32:34 +0000 (10:32 +0100)]
Check hypothetically failing conversion

5 years agoRemove tests for deprecated items
Oliver Scherer [Mon, 28 Jan 2019 09:17:04 +0000 (10:17 +0100)]
Remove tests for deprecated items

5 years agoUpdate more changed iterator paths
Oliver Scherer [Mon, 28 Jan 2019 09:16:34 +0000 (10:16 +0100)]
Update more changed iterator paths

5 years agoAtomics constants are now handled by the deprecation lint
Oliver Scherer [Mon, 28 Jan 2019 09:10:27 +0000 (10:10 +0100)]
Atomics constants are now handled by the deprecation lint

5 years agoUpdate changed iterator paths
Oliver Scherer [Mon, 28 Jan 2019 09:09:45 +0000 (10:09 +0100)]
Update changed iterator paths

5 years agoUpdate const slice processing
Oliver Scherer [Mon, 28 Jan 2019 09:09:34 +0000 (10:09 +0100)]
Update const slice processing

5 years agoAuto merge of #3706 - robamler:patch-1, r=phansch
bors [Sun, 27 Jan 2019 13:34:47 +0000 (13:34 +0000)]
Auto merge of #3706 - robamler:patch-1, r=phansch

Fix documentation for `slow_vector_initialization`

This PR fixes the documentation for the lint `slow_vector_initialization`. The documentation recommended writing `vec![len; 0]` but the correct solution is `vec![0; len]`.

5 years agoAuto merge of #3705 - matthiaskrgr:rustup, r=phansch
bors [Sun, 27 Jan 2019 13:14:37 +0000 (13:14 +0000)]
Auto merge of #3705 - matthiaskrgr:rustup, r=phansch

rustup

rustup https://github.com/rust-lang/rust/pull/57907/ and https://github.com/rust-lang/rust/pull/57726
Fixes #3708

5 years agoupdate test stderr
Matthias Krüger [Sun, 27 Jan 2019 12:46:22 +0000 (13:46 +0100)]
update test stderr

5 years agorun cargo fmt
Matthias Krüger [Sun, 27 Jan 2019 12:34:23 +0000 (13:34 +0100)]
run cargo fmt

5 years agorustup https://github.com/rust-lang/rust/pull/57907/
Matthias Krüger [Sun, 27 Jan 2019 12:33:56 +0000 (13:33 +0100)]
rustup https://github.com/rust-lang/rust/pull/57907/

for file in `fd \.rs$` ; do sed  -i  s/span_suggestion_with_applicability/span_suggestion/g $file ; done

for file in `fd \.rs$` ; do sed  -i  s/span_suggestion_short_with_applicability/span_suggestion_short/g $file ; done

for file in `fd \.rs$` ; do sed  -i  s/span_suggestions_with_applicability/span_suggestions/g $file ; done

5 years agoFix documentation for `slow_vector_initialization`
Robert Bamler [Sun, 27 Jan 2019 04:26:38 +0000 (20:26 -0800)]
Fix documentation for `slow_vector_initialization`

Change the recommended solution from `vec![len; 0]` to `vec![0; len]`.

Also fix grammar.

5 years agorustup https://github.com/rust-lang/rust/pull/57726
Matthias Krüger [Sat, 26 Jan 2019 19:40:55 +0000 (20:40 +0100)]
rustup https://github.com/rust-lang/rust/pull/57726

5 years agoAuto merge of #3702 - phansch:changechangelog, r=matthiaskrgr
bors [Sat, 26 Jan 2019 11:58:35 +0000 (11:58 +0000)]
Auto merge of #3702 - phansch:changechangelog, r=matthiaskrgr

Remove unsafe_vector_initialization from added lints

It was deprecated before it reached a stable release,
no need to include it.

5 years agoRemove unsafe_vector_initialization from added lints
Philipp Hansch [Sat, 26 Jan 2019 11:50:40 +0000 (12:50 +0100)]
Remove unsafe_vector_initialization from added lints

It was deprecated before it reached a stable release,
no need to include it.

5 years agoAuto merge of #3690 - mikerite:fix-3630-expect-fun-call, r=phansch
bors [Sat, 26 Jan 2019 10:57:39 +0000 (10:57 +0000)]
Auto merge of #3690 - mikerite:fix-3630-expect-fun-call, r=phansch

Fix `expect_fun_call` lint suggestions

This commit corrects some bad suggestions produced by the
`expect_fun_call` lint and enables `rust-fix` checking on the tests.

Addresses #3630

5 years agoPrevent incorrect cast_lossless suggestion in const_fn
Philipp Hansch [Sat, 26 Jan 2019 08:49:55 +0000 (09:49 +0100)]
Prevent incorrect cast_lossless suggestion in const_fn

`::from` is not a const fn, so applying the suggestion of
`cast_lossless` would fail to compile. The fix is to skip the lint if
the cast is found inside a const fn.

5 years agoAuto merge of #3701 - mikerite:fix-3118, r=phansch
bors [Sat, 26 Jan 2019 09:56:07 +0000 (09:56 +0000)]
Auto merge of #3701 - mikerite:fix-3118, r=phansch

Fix dogfood tests on Appveyor

This introduces a work-around for a bug in rustup.rs when excuting
cargo from a custom toolchain. Instead of trusting rustup to
invoke cargo from one of the release channels we just invoke
nightly cargo directly.

5 years agoIncorporate review suggestions
Michael Wright [Sat, 26 Jan 2019 09:55:54 +0000 (11:55 +0200)]
Incorporate review suggestions

5 years agoFix dogfood tests on Appveyor
Michael Wright [Sat, 26 Jan 2019 09:10:13 +0000 (11:10 +0200)]
Fix dogfood tests on Appveyor

This introduces a work-around for a bug in rustup.rs when excuting
cargo from a custom toolchain. Instead of trusting rustup to
invoke cargo from one of the release channels we just invoke
nightly cargo directly.

5 years agoAuto merge of #3698 - sorin-davidoi:fix-common-metadata-no-deps, r=oli-obk
bors [Fri, 25 Jan 2019 23:01:06 +0000 (23:01 +0000)]
Auto merge of #3698 - sorin-davidoi:fix-common-metadata-no-deps, r=oli-obk

chore(cargo/dependencies/cargo-metadata): Upgrade to 0.7.1

Closes https://github.com/rust-lang/rust-clippy/issues/3692.

5 years agotest(versioncheck): Use .no_deps()
Sorin Davidoi [Fri, 25 Jan 2019 20:28:09 +0000 (21:28 +0100)]
test(versioncheck): Use .no_deps()

5 years agotest(versioncheck): Fix version equality check
Sorin Davidoi [Fri, 25 Jan 2019 19:39:45 +0000 (20:39 +0100)]
test(versioncheck): Fix version equality check

5 years agochore(cargo/dependencies/cargo-metadata): Upgrade to 0.7.1
Sorin Davidoi [Fri, 25 Jan 2019 19:27:07 +0000 (20:27 +0100)]
chore(cargo/dependencies/cargo-metadata): Upgrade to 0.7.1

Closes https://github.com/rust-lang/rust-clippy/issues/3692.

5 years agoAuto merge of #3699 - matthiaskrgr:itertools, r=oli-obk
bors [Fri, 25 Jan 2019 20:00:20 +0000 (20:00 +0000)]
Auto merge of #3699 - matthiaskrgr:itertools, r=oli-obk

dependencies: update itertools from 0.7 to 0.8

5 years agodependencies: update itertools from 0.7 to 0.8
Matthias Krüger [Fri, 25 Jan 2019 19:25:14 +0000 (20:25 +0100)]
dependencies: update itertools from 0.7 to 0.8

5 years agoAuto merge of #3691 - phansch:update_changelog, r=oli-obk
bors [Fri, 25 Jan 2019 17:47:54 +0000 (17:47 +0000)]
Auto merge of #3691 - phansch:update_changelog, r=oli-obk

Update changelog with all changes since 0.0.212

This updates the changelog with all notable and user-facing changes since
0.0.212 has been released. I decided to group the changes by the Rust version
they are included in, as that's what makes the most sense to users.

Whenever a new rust version is released, we will have to go through the list
of commits and then update the changelog with the relevant changes.

[Rendered](https://github.com/rust-lang/rust-clippy/pull/3691/files?short_path=4ac32a7#diff-4ac32a78649ca5bdd8e0ba38b7006a1e)

5 years agoAdd script to fetch GitHub PRs between two commits
Philipp Hansch [Fri, 25 Jan 2019 17:07:50 +0000 (18:07 +0100)]
Add script to fetch GitHub PRs between two commits

5 years agoAuto merge of #3694 - phansch:fixed, r=phansch
bors [Fri, 25 Jan 2019 06:43:24 +0000 (06:43 +0000)]
Auto merge of #3694 - phansch:fixed, r=phansch

gitattributes: Treat .fixed files as rust files

This way GitHub treats them as Rust code :crab: :eyes:

5 years agogitattributes: Treat .fixed files as rust files
Philipp Hansch [Thu, 24 Jan 2019 19:39:00 +0000 (20:39 +0100)]
gitattributes: Treat .fixed files as rust files

5 years agoAuto merge of #3693 - phansch:rustup, r=matthiaskrgr
bors [Thu, 24 Jan 2019 19:40:31 +0000 (19:40 +0000)]
Auto merge of #3693 - phansch:rustup, r=matthiaskrgr

Rustup

Due to https://github.com/rust-lang/rust/pull/51285

5 years agoRustup
Philipp Hansch [Thu, 24 Jan 2019 19:32:18 +0000 (20:32 +0100)]
Rustup

Due to https://github.com/rust-lang/rust/pull/51285

5 years agoUpdate changelog with all changes since 0.0.212
Philipp Hansch [Thu, 24 Jan 2019 13:51:25 +0000 (14:51 +0100)]
Update changelog with all changes since 0.0.212

5 years agoFix `expect_fun_call` lint suggestions
Michael Wright [Thu, 24 Jan 2019 04:58:53 +0000 (06:58 +0200)]
Fix `expect_fun_call` lint suggestions

This commit corrects some bad suggestions produced by the
`expect_fun_call` lint and enables `rust-fix` checking on the tests.

Addresses #3630

5 years agoAuto merge of #3582 - Arkweid:add-lints-aseert-checks, r=flip1995
bors [Wed, 23 Jan 2019 17:42:30 +0000 (17:42 +0000)]
Auto merge of #3582 - Arkweid:add-lints-aseert-checks, r=flip1995

Add assert(true) and assert(false) lints

This PR add two lints on assert!(true) and assert!(false).
#3575

5 years agoallow assertions_on_constants for collapsible_if and missing_test_files
A.A.Abroskin [Wed, 23 Jan 2019 08:49:02 +0000 (11:49 +0300)]
allow assertions_on_constants for collapsible_if and missing_test_files

5 years agoMerge branch 'master' into add-lints-aseert-checks
A.A.Abroskin [Wed, 23 Jan 2019 08:36:12 +0000 (11:36 +0300)]
Merge branch 'master' into add-lints-aseert-checks

* master: (58 commits)
  Rustfmt all the things
  Don't make decisions on values that don't represent the decision
  Improving comments.
  Rustup
  Added rustfix to the test.
  Improve span shortening.
  Added "make_return" and "blockify" convenience methods in Sugg and used them in "needless_bool".
  Actually check for constants.
  Fixed potential mistakes with nesting. Added tests.
  formatting fix
  Update clippy_lints/src/needless_bool.rs
  formatting fix
  Fixing typo in CONTRIBUTING.md
  Fix breakage due to rust-lang/rust#57651
  needless bool lint suggestion is wrapped in brackets if it is an "else" clause of an "if-else" statement
  Fix automatic suggestion on `use_self`.
  Remove negative integer literal checks.
  Fix `implicit_return` false positives.
  Run rustfmt
  Fixed breakage due to rust-lang/rust#57489
  ...

5 years agoAuto merge of #3684 - g-bartoszek:sugg-snippet-modifications, r=phansch
bors [Tue, 22 Jan 2019 20:18:11 +0000 (20:18 +0000)]
Auto merge of #3684 - g-bartoszek:sugg-snippet-modifications, r=phansch

"make_return" and "blockify" convenience methods, fixes #3683

…ed them in "needless_bool".

5 years agoAuto merge of #3679 - daxpedda:use_self, r=phansch
bors [Tue, 22 Jan 2019 19:18:39 +0000 (19:18 +0000)]
Auto merge of #3679 - daxpedda:use_self, r=phansch

Fix automatic suggestion on `use_self`.

In an example like this:
```rust
impl Example {
    fn fun_1() { }
    fn fun_2() {
        Example::fun_1();
    }
}
```
Clippy tries to replace `Example::fun_1` with `Self`, loosing `::fun_1` in the process, it should rather try to replace `Example` with `Self`.

**Question**
- There may be other paths that need the same treatment, but I'm not sure I understand them fully:
  - https://github.com/rust-lang/rust-clippy/blob/e648adf0866a1cea7db6ce2d33ea86e442f25377/clippy_lints/src/use_self.rs#L94-L96
  - https://github.com/rust-lang/rust-clippy/blob/e648adf0866a1cea7db6ce2d33ea86e442f25377/clippy_lints/src/use_self.rs#L225-L229

5 years agoAuto merge of #3685 - rust-lang:rustup, r=flip1995
bors [Tue, 22 Jan 2019 16:07:32 +0000 (16:07 +0000)]
Auto merge of #3685 - rust-lang:rustup, r=flip1995

Rustup

5 years agoRustfmt all the things
Oliver Scherer [Tue, 22 Jan 2019 15:27:42 +0000 (16:27 +0100)]
Rustfmt all the things

5 years agoDon't make decisions on values that don't represent the decision
Oliver Scherer [Tue, 22 Jan 2019 14:28:51 +0000 (15:28 +0100)]
Don't make decisions on values that don't represent the decision

5 years agoImproving comments.
daxpedda [Tue, 22 Jan 2019 14:23:45 +0000 (15:23 +0100)]
Improving comments.

5 years agoRustup
Oliver Scherer [Tue, 22 Jan 2019 14:17:05 +0000 (15:17 +0100)]
Rustup

5 years agoAdded rustfix to the test.
daxpedda [Tue, 22 Jan 2019 14:16:54 +0000 (15:16 +0100)]
Added rustfix to the test.

5 years agoImprove span shortening.
Philipp Krones [Tue, 22 Jan 2019 13:43:59 +0000 (14:43 +0100)]
Improve span shortening.

Co-Authored-By: daxpedda <1645124+daxpedda@users.noreply.github.com>
5 years agoAdded "make_return" and "blockify" convenience methods in Sugg and used them in ...
Grzegorz Bartoszek [Tue, 22 Jan 2019 11:33:47 +0000 (12:33 +0100)]
Added "make_return" and "blockify" convenience methods in Sugg and used them in "needless_bool".

5 years agoAuto merge of #3677 - daxpedda:integer_arithmetic, r=oli-obk
bors [Mon, 21 Jan 2019 15:07:22 +0000 (15:07 +0000)]
Auto merge of #3677 - daxpedda:integer_arithmetic, r=oli-obk

Remove negative integer literal checks.

Fixes #3678.

5 years agoActually check for constants.
daxpedda [Mon, 21 Jan 2019 12:59:49 +0000 (13:59 +0100)]
Actually check for constants.

5 years agoAuto merge of #3676 - daxpedda:implicit_return, r=oli-obk
bors [Mon, 21 Jan 2019 12:25:45 +0000 (12:25 +0000)]
Auto merge of #3676 - daxpedda:implicit_return, r=oli-obk

Fix `implicit_return` false positives.

Fixes the following false positives:
- linting on `if let` without `else` in a `loop` even with a present `return`
- linting on `unreachable!()`

5 years agoFixed potential mistakes with nesting. Added tests.
daxpedda [Mon, 21 Jan 2019 12:06:32 +0000 (13:06 +0100)]
Fixed potential mistakes with nesting. Added tests.

5 years agoAuto merge of #3680 - g-bartoszek:needless-bool-else-if-brackets, r=oli-obk
bors [Mon, 21 Jan 2019 11:47:06 +0000 (11:47 +0000)]
Auto merge of #3680 - g-bartoszek:needless-bool-else-if-brackets, r=oli-obk

needless bool lint suggestion is wrapped in brackets if it is an "els…

…e" clause of an "if-else" statement

5 years agoformatting fix
Grzegorz Bartoszek [Mon, 21 Jan 2019 11:04:15 +0000 (12:04 +0100)]
formatting fix

5 years agoUpdate clippy_lints/src/needless_bool.rs
Oliver Scherer [Mon, 21 Jan 2019 10:41:33 +0000 (11:41 +0100)]
Update clippy_lints/src/needless_bool.rs

Co-Authored-By: g-bartoszek <grzegorz.bartoszek@thaumatec.com>
5 years agoformatting fix
Grzegorz Bartoszek [Mon, 21 Jan 2019 10:14:34 +0000 (11:14 +0100)]
formatting fix

5 years agoAuto merge of #3681 - rmcteggart-r7:master, r=matthiaskrgr
bors [Sun, 20 Jan 2019 22:21:00 +0000 (22:21 +0000)]
Auto merge of #3681 - rmcteggart-r7:master, r=matthiaskrgr

Fixing typo in CONTRIBUTING.md

Noticed small typo in CONTRIBUTING readme when working on another issue

5 years agoAuto merge of #3675 - mikerite:fix-build-20190120, r=matthiaskrgr
bors [Sun, 20 Jan 2019 21:52:18 +0000 (21:52 +0000)]
Auto merge of #3675 - mikerite:fix-build-20190120, r=matthiaskrgr

Fix build 20190120

5 years agoFixing typo in CONTRIBUTING.md
rmcteggart-r7 [Sun, 20 Jan 2019 21:25:36 +0000 (21:25 +0000)]
Fixing typo in CONTRIBUTING.md

5 years agoFix breakage due to rust-lang/rust#57651
Michael Wright [Sun, 20 Jan 2019 20:54:04 +0000 (22:54 +0200)]
Fix breakage due to rust-lang/rust#57651

5 years agoneedless bool lint suggestion is wrapped in brackets if it is an "else" clause of...
Grzegorz Bartoszek [Sun, 20 Jan 2019 15:15:00 +0000 (16:15 +0100)]
needless bool lint suggestion is wrapped in brackets if it is an "else" clause of an "if-else" statement

5 years agoFix automatic suggestion on `use_self`.
daxpedda [Sun, 20 Jan 2019 13:50:26 +0000 (14:50 +0100)]
Fix automatic suggestion on `use_self`.

5 years agoRemove negative integer literal checks.
daxpedda [Sun, 20 Jan 2019 13:18:31 +0000 (14:18 +0100)]
Remove negative integer literal checks.

5 years agoFix `implicit_return` false positives.
daxpedda [Sun, 20 Jan 2019 12:45:22 +0000 (13:45 +0100)]
Fix `implicit_return` false positives.

5 years agoRun rustfmt
Michael Wright [Sun, 20 Jan 2019 10:49:45 +0000 (12:49 +0200)]
Run rustfmt

5 years agoFixed breakage due to rust-lang/rust#57489
Michael Wright [Sun, 20 Jan 2019 10:21:30 +0000 (12:21 +0200)]
Fixed breakage due to rust-lang/rust#57489

5 years agoFix breakage due to rust-lang/rust#57755
Michael Wright [Sun, 20 Jan 2019 08:14:23 +0000 (10:14 +0200)]
Fix breakage due to rust-lang/rust#57755

5 years agoAuto merge of #3674 - sinkuu:fmt_rustup, r=oli-obk
bors [Sat, 19 Jan 2019 12:40:46 +0000 (12:40 +0000)]
Auto merge of #3674 - sinkuu:fmt_rustup, r=oli-obk

Catch up with `format_args` change

Catches up with a change in rust-lang/rust#57537. (Since the optimization is optional, this clippy PR can be merged before the rustc PR.)

Happened to fix a bug in `expect_fun_call`, that is the lint ignores more than
one arguments to `format`.

```
warning: use of `expect` followed by a function call
 --> src/main.rs:2:17
  |
2 |     Some("foo").expect(format!("{} {}", 1, 2).as_ref());
  |                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try this: `unwrap_or_else(|| panic!("{} {}", 1))`
  |
```

5 years agoCatch up with `format_args` change
Shotaro Yamada [Sat, 19 Jan 2019 12:13:06 +0000 (21:13 +0900)]
Catch up with `format_args` change

Catches up with a change in rust-lang/rust#57537

Happened to fix a bug in `expect_fun_call`, that is the lint ignores more than
one arguments to `format`.

5 years agoAuto merge of #3672 - mikerite:fix-3670, r=oli-obk
bors [Sat, 19 Jan 2019 11:12:03 +0000 (11:12 +0000)]
Auto merge of #3672 - mikerite:fix-3670, r=oli-obk

Fix bad `while_let_on_iterator` suggestion.

Don't suggest a `for` loop if the iterator is used inside the `while` loop.

Closes #3670

5 years agoAuto merge of #3671 - matthiaskrgr:rustup, r=oli-obk
bors [Sat, 19 Jan 2019 10:46:32 +0000 (10:46 +0000)]
Auto merge of #3671 - matthiaskrgr:rustup, r=oli-obk

rustup https://github.com/rust-lang/rust/pull/57747

5 years agoFix bad `while_let_on_iterator` suggestion.
Michael Wright [Sat, 19 Jan 2019 09:36:27 +0000 (11:36 +0200)]
Fix bad `while_let_on_iterator` suggestion.

Don't suggest a `for` loop if the iterator is used inside the `while` loop.

Closes #3670

5 years agorustup https://github.com/rust-lang/rust/pull/57747
Matthias Krüger [Sat, 19 Jan 2019 08:27:45 +0000 (09:27 +0100)]
rustup https://github.com/rust-lang/rust/pull/57747

5 years agoAuto merge of #3669 - avborhanian:extra_results_files, r=oli-obk
bors [Fri, 18 Jan 2019 08:27:06 +0000 (08:27 +0000)]
Auto merge of #3669 - avborhanian:extra_results_files, r=oli-obk

Check for results files missing tests

Addresses #3572.

Basically iterates over all the files, and if it sees any files that don't have a matching rs file, it throws an error.

5 years agoAuto merge of #3668 - phansch:remove_bors_toml, r=flip1995
bors [Fri, 18 Jan 2019 07:44:17 +0000 (07:44 +0000)]
Auto merge of #3668 - phansch:remove_bors_toml, r=flip1995

Remove bors.toml

This file was only needed for bors-ng, but now we use the default
rust-lang bors fork.

5 years agoFixing issues pointed out by dogfood tests.
Unknown [Fri, 18 Jan 2019 05:12:35 +0000 (00:12 -0500)]
Fixing issues pointed out by dogfood tests.

5 years agoUpdate to collect all the files then throw the error.
Unknown [Fri, 18 Jan 2019 04:50:30 +0000 (23:50 -0500)]
Update to collect all the files then throw the error.

5 years agoAdding a test for checking if test files are missing.
Unknown [Fri, 18 Jan 2019 04:19:51 +0000 (23:19 -0500)]
Adding a test for checking if test files are missing.

5 years agoRemove bors.toml
Philipp Hansch [Thu, 17 Jan 2019 17:50:24 +0000 (18:50 +0100)]
Remove bors.toml

This file was only needed for bors-ng, but now we use the default
rust-lang bors fork.

5 years agoAuto merge of #3667 - euclio:applicability, r=phansch
bors [Thu, 17 Jan 2019 16:26:50 +0000 (16:26 +0000)]
Auto merge of #3667 - euclio:applicability, r=phansch

add applicability to lint name suggestion

5 years agoadd applicability to lint name suggestion
Andy Russell [Wed, 16 Jan 2019 20:27:43 +0000 (15:27 -0500)]
add applicability to lint name suggestion

5 years agoAuto merge of #3662 - mikerite:fix-498, r=oli-obk
bors [Tue, 15 Jan 2019 09:04:09 +0000 (09:04 +0000)]
Auto merge of #3662 - mikerite:fix-498, r=oli-obk

Fix `map_clone` bad suggestion

`cloned` requires that the elements of the iterator must be references. This
change determines if that is the case by examining the type of the closure
argument and suggesting `.cloned` only if it is a reference. When the closure
argument is not a reference, it suggests removing the `map` call instead.

A minor problem with this change is that the new check sometimes overlaps
with the `clone_on_copy` lint.

Fixes #498

5 years agoReally fix issue number in `map_clone` test
Michael Wright [Tue, 15 Jan 2019 06:36:56 +0000 (08:36 +0200)]
Really fix issue number in `map_clone` test

5 years agoFix issue number in `map_clone` test
Michael Wright [Tue, 15 Jan 2019 06:17:55 +0000 (08:17 +0200)]
Fix issue number in `map_clone` test

5 years agoRemove `map_clone` fixed known problem
Michael Wright [Tue, 15 Jan 2019 06:15:12 +0000 (08:15 +0200)]
Remove `map_clone` fixed known problem

5 years agoFix `map_clone` bad suggestion
Michael Wright [Tue, 15 Jan 2019 06:09:47 +0000 (08:09 +0200)]
Fix `map_clone` bad suggestion

`cloned` requires that the elements of the iterator must be references. This
change determines if that is the case by examining the type of the closure
argument and suggesting `.cloned` only if it is a reference. When the closure
argument is not a reference, it suggests removing the `map` call instead.

A minor problem with this change is that the new check sometimes overlaps
with the `clone_on_copy` lint.

Fixes #498

5 years agoAuto merge of #3657 - roblabla:bugfix-missing-docs-global-asm, r=phansch
bors [Mon, 14 Jan 2019 14:50:27 +0000 (14:50 +0000)]
Auto merge of #3657 - roblabla:bugfix-missing-docs-global-asm, r=phansch

Missing docs: don't require documenting Global Asm items.

global_asm! items cannot be documented, the lint still gets triggered after adding documentation to the macro invocation. Furthermore, even if we could add documentation to the AST node, rustdoc doesn't render it anyways.

Playground example: https://play.rust-lang.org/?version=nightly&mode=debug&edition=2018&gist=5182df182f0ffbbab4c3107e43368ac3

5 years agoAuto merge of #3653 - gendx:master, r=phansch
bors [Mon, 14 Jan 2019 09:16:20 +0000 (09:16 +0000)]
Auto merge of #3653 - gendx:master, r=phansch

Fix typos in clippy_lints/src/len_zero.rs

Some comments in the len_zero lint had typos.

5 years agoAuto merge of #3658 - detrumi:add-several-run-rustfix-annotations, r=phansch
bors [Mon, 14 Jan 2019 08:16:51 +0000 (08:16 +0000)]
Auto merge of #3658 - detrumi:add-several-run-rustfix-annotations, r=phansch

Add several run rustfix annotations

Adds `run-rustfix` to 18 of the tests from the tracking issue #3630.
Each test has its own commit, to make reviewing easier (hopefully this is easier to review than 18 separate PRs).

## Changes
- `cfg_attr_rustfmt`: Custom inner attributes are unstable. Let's disable the lint for inner attributes until [#54726](https://github.com/rust-lang/rust/issues/54726) stabilizes
- `collapsible_if`: unrelated cyclomatic_complexity warning that can be ignored
- `duration_subsec`: Simply needed `#![allow(dead_code)]`
- `excessive_precision`: Fixed by `#!allow(dead_code,unused_variables)`
- `explicit_write`: Fixed by `#![allow(unused_imports)]`
- `inconsistent_digit_grouping`: Avoid triggering `clippy::excessive_precision` lint
- `infallible_destructuring_match`: Fixed by `#![allow(dead_code, unreachable_code, unused_variables)]`
- `into_iter_on_ref`: Triggered unrelated `clippy::useless_vec` lint
- `large_digit_groups`: Avoid triggering `clippy::excessive_precision` lint
- `map_clone`: Fixed by `#![allow(clippy::iter_cloned_collect)]`
- `mem_replace`: Suggestion causes import to be unused, fixed by `#![allow(unused_imports)]`
- `precedence`: Allow some unrelated lints, and change out-of-range `0b1111_1111i8` literal
- `redundant_field_names`: Allow dead code, and remove stabilized feature toggles
- `replace_consts`: Fixed by `#![allow(unused_variables)]`
- `starts_ends_with`: Fixed by `#![allow(unused_must_use)]`
- `types`: Fixed by `#![allow(dead_code, unused_variables)]`
- `unit_arg`: Fixed by `#[allow(unused_must_use)]`
- `unnecessary_fold`: Fixed by adding type annotations and adding `#![allow(dead_code)]`

5 years agoAdd run-rustfix to unnecessary_fold
Wilco Kusee [Sun, 13 Jan 2019 19:03:22 +0000 (20:03 +0100)]
Add run-rustfix to unnecessary_fold

5 years agoAdd run-rustfix to unit_arg test
Wilco Kusee [Sun, 13 Jan 2019 18:59:00 +0000 (19:59 +0100)]
Add run-rustfix to unit_arg test

5 years agoAdd run-rustfix for types test
Wilco Kusee [Sun, 13 Jan 2019 18:57:19 +0000 (19:57 +0100)]
Add run-rustfix for types test

5 years agoAdd run-rustfix to starts_ends_with
Wilco Kusee [Sun, 13 Jan 2019 18:40:14 +0000 (19:40 +0100)]
Add run-rustfix to starts_ends_with

5 years agoAdd run-rustfix to replace_const test
Wilco Kusee [Sun, 13 Jan 2019 18:38:43 +0000 (19:38 +0100)]
Add run-rustfix to replace_const test

5 years agoAdd run-rustfix to redundant_field_names
Wilco Kusee [Sun, 13 Jan 2019 17:48:54 +0000 (18:48 +0100)]
Add run-rustfix to redundant_field_names

5 years agoMissing docs: don't require documenting Global Asm items.
roblabla [Sun, 13 Jan 2019 16:09:58 +0000 (16:09 +0000)]
Missing docs: don't require documenting Global Asm items.

global_asm! items cannot be documented, the lint still gets triggered
after adding documentation to the macro invocation. Furthermore, even
if we could add documentation to the AST node, rustdoc doesn't render
it anyways.

Playground example: https://play.rust-lang.org/?version=nightly&mode=debug&edition=2018&gist=5182df182f0ffbbab4c3107e43368ac3

5 years agoAdd run-rustfix for precedence test
Wilco Kusee [Sun, 13 Jan 2019 13:24:21 +0000 (14:24 +0100)]
Add run-rustfix for precedence test