]>
git.lizzy.rs Git - rust.git/log
Alex Hamilton [Tue, 29 Jan 2019 18:39:01 +0000 (12:39 -0600)]
wildcard_match_arm: update ui test stderr
Alex Hamilton [Tue, 29 Jan 2019 18:23:11 +0000 (12:23 -0600)]
wildcard_match_arm: format test.
Alex Hamilton [Sun, 27 Jan 2019 21:41:22 +0000 (15:41 -0600)]
wilcard_match_arm: run rustfmt.
Alex Hamilton [Fri, 25 Jan 2019 17:06:19 +0000 (11:06 -0600)]
wildcard_match_arm: add lint properly.
Alex Hamilton [Fri, 25 Jan 2019 16:56:00 +0000 (10:56 -0600)]
wildcard_match_arm: rename function.
We also don't need `ex` as an argument.
Alex Hamilton [Fri, 25 Jan 2019 16:42:11 +0000 (10:42 -0600)]
wildcard_match_arm: add simple ui test.
Alex Hamilton [Fri, 25 Jan 2019 16:39:09 +0000 (10:39 -0600)]
wildcard_match_arm: expand lint scope.
We're not only working with Results.
Alex Hamilton [Sat, 12 Jan 2019 23:45:16 +0000 (17:45 -0600)]
Change match_wild lint name to WILDCARD_MATCH_ARM.
Also fix message capitalization.
Alex Hamilton [Thu, 10 Jan 2019 20:56:28 +0000 (14:56 -0600)]
Add match_wild lint (#3649).
This lint prevents using a wildcard in a match.
bors [Tue, 29 Jan 2019 19:58:13 +0000 (19:58 +0000)]
Auto merge of #3648 - phansch:const_fn_lint, r=oli-obk
Add initial version of const_fn lint
This adds an initial version of a lint that can tell if a function could be `const`.
TODO:
- [x] Finish up the docs
- [x] Fix the ICE
cc #2440
bors [Tue, 29 Jan 2019 19:06:33 +0000 (19:06 +0000)]
Auto merge of #3716 - matthiaskrgr:sh, r=phansch
fetch_prs_between: add .sh file ending
r? @phansch
Matthias Krüger [Tue, 29 Jan 2019 19:00:45 +0000 (20:00 +0100)]
fetch_prs_between: add .sh file ending
Philipp Hansch [Wed, 23 Jan 2019 06:32:58 +0000 (07:32 +0100)]
cargo fmt
bors [Tue, 29 Jan 2019 11:57:26 +0000 (11:57 +0000)]
Auto merge of #3714 - mikerite:fix-2945, r=oli-obk
Fix `unit_arg` false positive
Ignore arguments with the question mark operator.
Closes #2945
Philipp Hansch [Tue, 22 Jan 2019 06:59:09 +0000 (07:59 +0100)]
Update various docs
* `const_transmute` currently also seems to depend on the `const_fn`
feature.
* Only `Sized` is currently allowed as a bound, not Copy.
Philipp Hansch [Tue, 22 Jan 2019 06:36:15 +0000 (07:36 +0100)]
Use built-in entry_fn detection over self-built
Philipp Hansch [Mon, 21 Jan 2019 06:54:05 +0000 (07:54 +0100)]
cargo fmt
Philipp Hansch [Mon, 14 Jan 2019 15:44:10 +0000 (16:44 +0100)]
Reorganize conditionals: Run faster checks first
Philipp Hansch [Thu, 10 Jan 2019 19:33:24 +0000 (20:33 +0100)]
Maybe fix ICE?
Philipp Hansch [Wed, 9 Jan 2019 19:11:37 +0000 (20:11 +0100)]
Add initial version of const_fn lint
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
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
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
Oliver Scherer [Mon, 28 Jan 2019 10:32:41 +0000 (11:32 +0100)]
Rustfmt
Oliver Scherer [Mon, 28 Jan 2019 09:32:34 +0000 (10:32 +0100)]
Check hypothetically failing conversion
Oliver Scherer [Mon, 28 Jan 2019 09:17:04 +0000 (10:17 +0100)]
Remove tests for deprecated items
Oliver Scherer [Mon, 28 Jan 2019 09:16:34 +0000 (10:16 +0100)]
Update more changed iterator paths
Oliver Scherer [Mon, 28 Jan 2019 09:10:27 +0000 (10:10 +0100)]
Atomics constants are now handled by the deprecation lint
Oliver Scherer [Mon, 28 Jan 2019 09:09:45 +0000 (10:09 +0100)]
Update changed iterator paths
Oliver Scherer [Mon, 28 Jan 2019 09:09:34 +0000 (10:09 +0100)]
Update const slice processing
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]`.
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
Matthias Krüger [Sun, 27 Jan 2019 12:46:22 +0000 (13:46 +0100)]
update test stderr
Matthias Krüger [Sun, 27 Jan 2019 12:34:23 +0000 (13:34 +0100)]
run cargo fmt
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
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.
Matthias Krüger [Sat, 26 Jan 2019 19:40:55 +0000 (20:40 +0100)]
rustup https://github.com/rust-lang/rust/pull/57726
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.
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.
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
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.
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.
Michael Wright [Sat, 26 Jan 2019 09:55:54 +0000 (11:55 +0200)]
Incorporate review suggestions
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.
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.
Sorin Davidoi [Fri, 25 Jan 2019 20:28:09 +0000 (21:28 +0100)]
test(versioncheck): Use .no_deps()
Sorin Davidoi [Fri, 25 Jan 2019 19:39:45 +0000 (20:39 +0100)]
test(versioncheck): Fix version equality check
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.
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
Matthias Krüger [Fri, 25 Jan 2019 19:25:14 +0000 (20:25 +0100)]
dependencies: update itertools from 0.7 to 0.8
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 )
Philipp Hansch [Fri, 25 Jan 2019 17:07:50 +0000 (18:07 +0100)]
Add script to fetch GitHub PRs between two commits
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:
Philipp Hansch [Thu, 24 Jan 2019 19:39:00 +0000 (20:39 +0100)]
gitattributes: Treat .fixed files as rust files
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
Philipp Hansch [Thu, 24 Jan 2019 19:32:18 +0000 (20:32 +0100)]
Rustup
Due to https://github.com/rust-lang/rust/pull/51285
Philipp Hansch [Thu, 24 Jan 2019 13:51:25 +0000 (14:51 +0100)]
Update changelog with all changes since 0.0.212
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
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
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
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
...
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".
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
bors [Tue, 22 Jan 2019 16:07:32 +0000 (16:07 +0000)]
Auto merge of #3685 - rust-lang:rustup, r=flip1995
Rustup
Oliver Scherer [Tue, 22 Jan 2019 15:27:42 +0000 (16:27 +0100)]
Rustfmt all the things
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
daxpedda [Tue, 22 Jan 2019 14:23:45 +0000 (15:23 +0100)]
Improving comments.
Oliver Scherer [Tue, 22 Jan 2019 14:17:05 +0000 (15:17 +0100)]
Rustup
daxpedda [Tue, 22 Jan 2019 14:16:54 +0000 (15:16 +0100)]
Added rustfix to the test.
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>
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".
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.
daxpedda [Mon, 21 Jan 2019 12:59:49 +0000 (13:59 +0100)]
Actually check for constants.
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!()`
daxpedda [Mon, 21 Jan 2019 12:06:32 +0000 (13:06 +0100)]
Fixed potential mistakes with nesting. Added tests.
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
Grzegorz Bartoszek [Mon, 21 Jan 2019 11:04:15 +0000 (12:04 +0100)]
formatting fix
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>
Grzegorz Bartoszek [Mon, 21 Jan 2019 10:14:34 +0000 (11:14 +0100)]
formatting fix
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
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
rmcteggart-r7 [Sun, 20 Jan 2019 21:25:36 +0000 (21:25 +0000)]
Fixing typo in CONTRIBUTING.md
Michael Wright [Sun, 20 Jan 2019 20:54:04 +0000 (22:54 +0200)]
Fix breakage due to rust-lang/rust#57651
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
daxpedda [Sun, 20 Jan 2019 13:50:26 +0000 (14:50 +0100)]
Fix automatic suggestion on `use_self`.
daxpedda [Sun, 20 Jan 2019 13:18:31 +0000 (14:18 +0100)]
Remove negative integer literal checks.
daxpedda [Sun, 20 Jan 2019 12:45:22 +0000 (13:45 +0100)]
Fix `implicit_return` false positives.
Michael Wright [Sun, 20 Jan 2019 10:49:45 +0000 (12:49 +0200)]
Run rustfmt
Michael Wright [Sun, 20 Jan 2019 10:21:30 +0000 (12:21 +0200)]
Fixed breakage due to rust-lang/rust#57489
Michael Wright [Sun, 20 Jan 2019 08:14:23 +0000 (10:14 +0200)]
Fix breakage due to rust-lang/rust#57755
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))`
|
```
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`.
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
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
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
Matthias Krüger [Sat, 19 Jan 2019 08:27:45 +0000 (09:27 +0100)]
rustup https://github.com/rust-lang/rust/pull/57747
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.
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.
Unknown [Fri, 18 Jan 2019 05:12:35 +0000 (00:12 -0500)]
Fixing issues pointed out by dogfood tests.
Unknown [Fri, 18 Jan 2019 04:50:30 +0000 (23:50 -0500)]
Update to collect all the files then throw the error.