]>
git.lizzy.rs Git - rust.git/log
bors [Wed, 11 Sep 2019 09:48:25 +0000 (09:48 +0000)]
Auto merge of #4478 - tsurai:master, r=flip1995
Fix incorrect swap suggestion
Clippy suggests using swap on fields belonging to the same owner causing two mutable borrows of the owner.
Disclosure: This is my first time working with clippy and rusts HIR. I'm very grateful for assistance and suggestions to improve the PR.
fixes #981
changelog: Fix false positive in `manual_swap` lint
bors [Wed, 11 Sep 2019 07:14:31 +0000 (07:14 +0000)]
Auto merge of #4534 - matthiaskrgr:fmt_, r=flip1995
run rustfmt
I was getting local `cargo test` failures because of this, yet travis was green.
changelog: none
Matthias Krüger [Wed, 11 Sep 2019 06:26:57 +0000 (08:26 +0200)]
run rustfmt
bors [Tue, 10 Sep 2019 19:40:45 +0000 (19:40 +0000)]
Auto merge of #4532 - rust-lang:integer-const, r=oli-obk
New `is_integer_const` to check more const ints
This mostly affects loop checks and the modulo_one lint. Tests were also updated where applicable.
changelog: none
Andre Bogus [Mon, 9 Sep 2019 15:01:01 +0000 (17:01 +0200)]
New `is_integer_const` to check more const ints
This mostly affects loop checks and the modulo_one lint. Tests
were also updated where applicable.
bors [Tue, 10 Sep 2019 07:32:11 +0000 (07:32 +0000)]
Auto merge of #4525 - mikerite:use-self-constructor, r=phansch
Extend `use_self` to check constructor
Rust did not allow this before.
changelog: Extend `use_self` to check constructor
bors [Tue, 10 Sep 2019 04:04:42 +0000 (04:04 +0000)]
Auto merge of #4529 - lzutao:rm-feature-bind-by-move, r=matthiaskrgr
Remove feature gate bind-by-move
This feature was stabilized in https://github.com/rust-lang/rust/pull/63118
changelog: none
Lzu Tao [Tue, 10 Sep 2019 02:23:25 +0000 (09:23 +0700)]
Remove feature gate bind-by-move
bors [Mon, 9 Sep 2019 16:56:51 +0000 (16:56 +0000)]
Auto merge of #4527 - rust-lang:more-vec-diag-items, r=oli-obk
Changed more `Vec` paths to diagnostic_items
In #4519, I missed a few instances of path matching for `Vec`, so here they are.
r? @oli-obk
changelog: none
bors [Mon, 9 Sep 2019 15:38:59 +0000 (15:38 +0000)]
Auto merge of #4522 - mikerite:fix-4514, r=phansch
Fix `or_fun_call` bad suggestion
Closes #4514
changelog: Fix `or_fun_call` bad suggestion
Andre Bogus [Mon, 9 Sep 2019 15:22:41 +0000 (17:22 +0200)]
Changed more Vec paths to diagnostic_items
bors [Mon, 9 Sep 2019 14:55:33 +0000 (14:55 +0000)]
Auto merge of #4458 - flip1995:block_in_if_ext_macro, r=phansch
Allow block_in_if_{stmt,expr} in external macro
I found this by running `cargo fix --clippy` on quite a big codebase.
You could refactor this assert to
```rust
let block_expr = _;
assert!(block_expr);
```
but,
1. it doesn't increase the readability IMO
2. That isn't possible in a `debug_assert!`
I'm not sure though, if we should allow this for macros in general or just for external macros.
changelog: Allow `block_in_if_{stmt,expr}` in external macros
bors [Mon, 9 Sep 2019 14:13:55 +0000 (14:13 +0000)]
Auto merge of #4510 - lzutao:unsep-literals-regression-macro-attr, r=flip1995
Fix regression in case of proc-macro attribute expansion
cc #4507
changelog: none
r? @flip1995
Lzu Tao [Sat, 7 Sep 2019 03:53:34 +0000 (10:53 +0700)]
Add a regression test for proc-macro attribute
Lzu Tao [Fri, 6 Sep 2019 10:00:53 +0000 (17:00 +0700)]
Fix regression in case of proc-macro attribute expansion
Michael Wright [Mon, 9 Sep 2019 05:51:44 +0000 (07:51 +0200)]
Extend `use_self` to check constructor
Rust did not allow this before.
Michael Wright [Mon, 9 Sep 2019 05:36:30 +0000 (07:36 +0200)]
Merge branch 'master' into fix-4514
bors [Mon, 9 Sep 2019 04:52:29 +0000 (04:52 +0000)]
Auto merge of #4519 - rust-lang:vec-diagnostic-item, r=@oli-obk
Use diagnostic item for `Vec`
This adds a new `is_type_diagnostic_item` to check items without lookup via `match_type`.
changelog: none
Andre Bogus [Sat, 7 Sep 2019 10:21:52 +0000 (12:21 +0200)]
Use diagnostic item for
bors [Sun, 8 Sep 2019 20:09:12 +0000 (20:09 +0000)]
Auto merge of #4523 - matthewjasper:remove-cfg-usage, r=llogiq
Stop using the HIR CFG
This does slightly change the behavior:
* Functions with unreachable code don't end up being ignored
* `match` guards are counted as +1 for each guard, rather than +1 for each pattern with a guard
* Or patterns don't add to the complexity
changelog: none
Matthew Jasper [Sun, 8 Sep 2019 10:40:04 +0000 (11:40 +0100)]
Update non_expressive_names for or patterns
Matthew Jasper [Sun, 8 Sep 2019 10:39:42 +0000 (11:39 +0100)]
Remove use of the HIR CFG
Michael Wright [Sun, 8 Sep 2019 09:03:45 +0000 (11:03 +0200)]
Fix `or_fun_call` bad suggestion
Closes #4514
bors [Fri, 6 Sep 2019 15:10:06 +0000 (15:10 +0000)]
Auto merge of #4508 - rust-lang:reduced-symbolism, r=phansch
Simplify `utils::match_def_path`, removing a FIXME
changelog: none
This removes the `Vec<Symbol>` allocation. We still need to call `cx.get_def_path`, but this should already have been interned, and I don't see how we can keep ergonomics of that function without allocating a `Vec`.
r? @phansch
bors [Fri, 6 Sep 2019 12:13:06 +0000 (12:13 +0000)]
Auto merge of #4512 - mati865:rustup, r=phansch
Rustup to rust-lang/rust#64111
changelog: none
Mateusz Mikuła [Fri, 6 Sep 2019 11:57:27 +0000 (13:57 +0200)]
Rustup to rust-lang/rust#64111
bors [Fri, 6 Sep 2019 08:41:56 +0000 (08:41 +0000)]
Auto merge of #4500 - jeremystucki:refactoring, r=flip1995
Small refactoring
changelog: none
Andre Bogus [Fri, 6 Sep 2019 07:40:36 +0000 (09:40 +0200)]
Simplify , removing a FIXME
bors [Fri, 6 Sep 2019 04:50:12 +0000 (04:50 +0000)]
Auto merge of #4506 - derivmug:fix-add-lint-example, r=phansch
Fix two occurences of TESTNAME=ui/foo_functions
changelog: Fix two occurrences of the wrong path to the foo_functions test in doc/adding_lints.md
This PR fixes the other two wrong paths to the example test. I already created a PR yesterday but only changed one. The old command was `TESTNAME=ui/foo_functions cargo uitest` and is now `TESTNAME=foo_functions cargo uitest`.
Luca Beetz [Thu, 5 Sep 2019 22:54:49 +0000 (00:54 +0200)]
Fix two occurences of TESTNAME=ui/foo_functions
This commit fixes two occurences of the wrong path to the foo_functions example test in doc/adding-lints.md
bors [Thu, 5 Sep 2019 16:15:36 +0000 (16:15 +0000)]
Auto merge of #4489 - JohnTitor:fix-redundant-pattern-false-positive, r=flip1995
Fix `redundant_pattern` false positive
Fix #4428
changelog: Fix `redundant_pattern` false positive
Yuki Okushi [Thu, 5 Sep 2019 13:45:52 +0000 (22:45 +0900)]
Run rustfix
bors [Thu, 5 Sep 2019 08:26:00 +0000 (08:26 +0000)]
Auto merge of #4502 - lzutao:rustup-64141, r=phansch
Rustup "Minimize uses of `LocalInternedString`"
Rustup https://github.com/rust-lang/rust/pull/64141
changelog: none
Lzu Tao [Thu, 5 Sep 2019 06:56:10 +0000 (13:56 +0700)]
Rustup "Minimize uses of `LocalInternedString`"
bors [Wed, 4 Sep 2019 17:59:19 +0000 (17:59 +0000)]
Auto merge of #4501 - derivmug:update-lint-doc, r=phansch
Remove ui/ from TESTNAME for foo lint example
changelog: Remove ui/ from TESTNAME in doc/adding-lints.md
This PR remove the `ui/` from the TESTNAME of the example foo lint in the 'Adding lints' documentation.
Luca Beetz [Wed, 4 Sep 2019 16:34:19 +0000 (18:34 +0200)]
Remove ui/ from TESTNAME for foo lint example
bors [Wed, 4 Sep 2019 16:25:49 +0000 (16:25 +0000)]
Auto merge of #4495 - JohnTitor:fix-map-entry-false-positive, r=phansch
Fix `map_entry` false positive
Fixes #4219
changelog: Fix `map_entry` false positive
Yuki Okushi [Wed, 4 Sep 2019 15:50:22 +0000 (00:50 +0900)]
Make it auto fixable lint
Yuki Okushi [Mon, 2 Sep 2019 19:49:14 +0000 (04:49 +0900)]
Fix `redundant_pattern` false positive
Yuki Okushi [Wed, 4 Sep 2019 15:24:45 +0000 (00:24 +0900)]
Improve tests
bors [Wed, 4 Sep 2019 15:01:06 +0000 (15:01 +0000)]
Auto merge of #4487 - JohnTitor:deref-addrof-external-macro, r=flip1995
Don't check across macro boundary in `deref_addrof`
Fixes #4289
changelog: Allow `deref_addrof` in macros
Jeremy Stucki [Wed, 4 Sep 2019 14:19:59 +0000 (16:19 +0200)]
Refactor option handling
bors [Wed, 4 Sep 2019 13:33:47 +0000 (13:33 +0000)]
Auto merge of #4418 - euclio:byte-lit-suggestion, r=flip1995
use a structured suggestion for char-lit-as-u8
changelog: use a structured suggestion for char-lit-as-u8
flip1995 [Wed, 4 Sep 2019 13:33:14 +0000 (15:33 +0200)]
Run update_lints
Andy Russell [Tue, 20 Aug 2019 02:24:07 +0000 (22:24 -0400)]
use a structured suggestion for char-lit-as-u8
bors [Wed, 4 Sep 2019 12:14:41 +0000 (12:14 +0000)]
Auto merge of #4498 - sinkuu:checked_arithmetic_unwrap, r=flip1995
Add manual_saturating_arithmetic lint
changelog: add `manual_saturating_arithmetic` lint
Fixes #1557. This lint detects manual saturating arithmetics like `x.checked_add(10u32).unwrap_or(u32::max_value())` and suggests replacing with `x.saturating_add(10u32)`.
Shotaro Yamada [Wed, 4 Sep 2019 12:10:08 +0000 (21:10 +0900)]
Hide variables in doc-test
Shotaro Yamada [Wed, 4 Sep 2019 12:06:28 +0000 (21:06 +0900)]
Fix doctest and renaming src
bors [Wed, 4 Sep 2019 11:35:13 +0000 (11:35 +0000)]
Auto merge of #4490 - mikerite:fix-4364, r=flip1995
Fix `too_many_lines` false positive
changelog: Fix `too_many_lines` false positive
Shotaro Yamada [Wed, 4 Sep 2019 07:08:48 +0000 (16:08 +0900)]
Add manual_saturating_arithmetic lint
bors [Wed, 4 Sep 2019 07:53:44 +0000 (07:53 +0000)]
Auto merge of #4454 - BO41:search_is_some, r=flip1995
Dereference one less on search_is_some and make it auto-fixable
Fixes #4453
changelog: none
BO41 [Thu, 29 Aug 2019 08:06:56 +0000 (10:06 +0200)]
Try to fix .fixed
bors [Tue, 3 Sep 2019 16:14:40 +0000 (16:14 +0000)]
Auto merge of #4479 - rust-lang:uninit_assume_init, r=flip1995
lint against `MaybeUninit::uninit().assume_init()`
changelog: add `uninit_assumed_init` lint
This fixes #4272
Andre Bogus [Sat, 31 Aug 2019 18:25:28 +0000 (20:25 +0200)]
lint against `MaybeUninit::uninit().assume_init()`
bors [Tue, 3 Sep 2019 13:17:30 +0000 (13:17 +0000)]
Auto merge of #4486 - lzutao:fix-panic-unseparate-literals, r=flip1995
Fix index out of bound in case of empty snippet
cc #4480
changelog: none
Yuki Okushi [Tue, 3 Sep 2019 00:41:37 +0000 (09:41 +0900)]
Fix `map_entry` false positive
bors [Tue, 3 Sep 2019 10:44:47 +0000 (10:44 +0000)]
Auto merge of #4493 - JohnTitor:fix-build-bytes, r=flip1995
Rustup to rust-lang/rust#63561
changelog: none
Yuki Okushi [Tue, 3 Sep 2019 09:25:56 +0000 (18:25 +0900)]
Remove Allocation::bytes
Michael Wright [Tue, 3 Sep 2019 04:26:49 +0000 (06:26 +0200)]
Fix occurrences of `too_many_lines` violations
Michael Wright [Tue, 3 Sep 2019 04:25:54 +0000 (06:25 +0200)]
Fix `too_many_lines` false positive
Fixes #4364
Yuki Okushi [Mon, 2 Sep 2019 14:26:04 +0000 (23:26 +0900)]
Allow deref_addrof in macros
Lzu Tao [Mon, 2 Sep 2019 13:38:40 +0000 (20:38 +0700)]
Fix index out of bound in case of empty snippet
bors [Mon, 2 Sep 2019 12:46:13 +0000 (12:46 +0000)]
Auto merge of #4482 - awoimbee:doc_explicit_counter_loop, r=flip1995
fix misleading doc for explicit_counter_loop lint
changelog: replace misleading examples for explicit_counter_loop & more concise `Why is it bad?` section
This fixes #4472
bors [Mon, 2 Sep 2019 12:17:47 +0000 (12:17 +0000)]
Auto merge of #4477 - mikerite:fix-4291, r=flip1995
Fix `extra_unused_lifetimes` false positive
Fixes #4291
changelog: Fix `extra_unused_lifetimes` false positive
Cristian Kubis [Mon, 2 Sep 2019 12:15:52 +0000 (14:15 +0200)]
Add more UI tests for swap
These tests make sure that the swap warning will not be triggered
for expressions that will cause multiple mutable references of the
same owner
Arthur Woimée [Sun, 1 Sep 2019 17:59:14 +0000 (19:59 +0200)]
fix misleading doc for explicit_counter_loop lint
Michael Wright [Sun, 1 Sep 2019 06:11:40 +0000 (08:11 +0200)]
Fix `needless_lifetimes` false positive
Michael Wright [Sun, 1 Sep 2019 05:55:29 +0000 (07:55 +0200)]
Simplify issue-4291 test
Cristian Kubis [Sat, 31 Aug 2019 16:50:22 +0000 (18:50 +0200)]
Fix incorrect swap suggestion
Clippy suggests using swap on fields belonging to the same owner
causing two mutable borrows of the owner
Fixes #981
Signed-off-by: Cristian Kubis <cristian.kubis@tsunix.de>
Michael Wright [Sat, 31 Aug 2019 06:16:04 +0000 (08:16 +0200)]
Fix `extra_unused_lifetimes` false positive
Fixes #4291
bors [Fri, 30 Aug 2019 20:30:53 +0000 (20:30 +0000)]
Auto merge of #4473 - phansch:fix_cast_lossless_fp, r=flip1995
Fix cast_lossless false positive in impl const fn
Fixes https://github.com/rust-lang/rust-clippy/issues/3656#issuecomment-
526387382
changelog: Fix false positive in `cast_lossless`
bors [Fri, 30 Aug 2019 08:12:11 +0000 (08:12 +0000)]
Auto merge of #4475 - flip1995:rustup, r=phansch
Rustup to rust-lang/rust#60966
changelog: none
flip1995 [Fri, 30 Aug 2019 07:33:03 +0000 (09:33 +0200)]
Rustup to rust-lang/rust#60966
bors [Fri, 30 Aug 2019 06:07:41 +0000 (06:07 +0000)]
Auto merge of #4446 - mikerite:fix-4437, r=phansch
Fix `match_as_ref` bad suggestion
Fixes #4437
changelog: Fix `match_as_ref` bad suggestion
Philipp Hansch [Fri, 30 Aug 2019 05:22:35 +0000 (07:22 +0200)]
Fix cast_lossless false positive in impl const fn
Fixes https://github.com/rust-lang/rust-clippy/issues/3656#issuecomment-
526387382
bors [Thu, 29 Aug 2019 17:24:21 +0000 (17:24 +0000)]
Auto merge of #4450 - phansch:fix_const_fn_fp, r=flip1995
Fix missing_const_for_fn false positive
We don't want to lint if the type of the method implements drop.
(constant functions cannot evaluate destructors)
changelog: Fix `missing_const_for_fn` false positive
Fixes #4449
Philipp Hansch [Thu, 29 Aug 2019 16:37:43 +0000 (18:37 +0200)]
Add missing UI test change
flip1995 [Wed, 28 Aug 2019 08:52:23 +0000 (10:52 +0200)]
Fix tests
flip1995 [Wed, 28 Aug 2019 08:41:32 +0000 (10:41 +0200)]
Use the spans returned by utils::method_calls
flip1995 [Wed, 28 Aug 2019 08:41:06 +0000 (10:41 +0200)]
Also return the method spans in utils::method_calls
BO41 [Mon, 26 Aug 2019 10:50:15 +0000 (12:50 +0200)]
Dereference one less on search_is_some and make it auto-fixable
bors [Thu, 29 Aug 2019 10:48:14 +0000 (10:48 +0000)]
Auto merge of #4408 - phansch:more_rustfix_tests, r=flip1995
More rustfix tests
<!--
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 `./util/dev fmt`
[lint_naming]: https://rust-lang.github.io/rfcs/0344-conventions-galore.html#lints
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 -->
cc #3630
This is probably easier reviewed per-commit.
changelog: none
bors [Thu, 29 Aug 2019 10:19:26 +0000 (10:19 +0000)]
Auto merge of #4469 - vityafx:master, r=flip1995
Improve the cognitive_complexity lint's warning.
Adds the value of complexity limit set for the lint
to the warning.
Fixes #4466
Signed-off-by: Victor Polevoy <fx@thefx.co>
changelog: improve the `cognitive_complexity` lint's warning message.
Victor Polevoy [Thu, 29 Aug 2019 08:56:13 +0000 (10:56 +0200)]
Improve cognitive_complexity lint's warning.
Adds the value of complexity limit set for the lint
to the warning.
Fixes #4466
Signed-off-by: Victor Polevoy <fx@thefx.co>
Michael Wright [Thu, 29 Aug 2019 06:17:36 +0000 (08:17 +0200)]
Merge branch 'master' into fix-4437
Philipp Hansch [Sun, 25 Aug 2019 13:44:22 +0000 (15:44 +0200)]
Fix missing_const_for_fn false positive
We don't want to lint if any of the input parameters implement drop.
(constant functions cannot evaluate destructors)
Philipp Hansch [Wed, 28 Aug 2019 19:17:12 +0000 (21:17 +0200)]
Make useless_attribute suggestion MaybeIncorrect
bors [Wed, 28 Aug 2019 16:09:08 +0000 (16:09 +0000)]
Auto merge of #4465 - JohnTitor:add-note-to-fix-toolstate, r=flip1995
Add note to fix toolstate
The idea from https://github.com/rust-lang/rust-clippy/pull/4462#issuecomment-
525725587
It's nice that we have the documentation to guide fix toolstate.
changelog: none
Yuki Okushi [Wed, 28 Aug 2019 12:46:04 +0000 (21:46 +0900)]
Add note to fix toolstate
bors [Wed, 28 Aug 2019 12:37:29 +0000 (12:37 +0000)]
Auto merge of #4464 - flip1995:fetch_prs_between, r=phansch
Also fetch rollup merges in fetch_prs_between.sh script
Otherwise rolled up PRs won't be included in the changelog, e.g.
236666138fa15fdd48b1c12180b2c9dc936441b4
changelog: none
flip1995 [Wed, 28 Aug 2019 11:53:56 +0000 (13:53 +0200)]
Also fetch rollup merges in fetch_prs_between.sh script
bors [Wed, 28 Aug 2019 11:11:43 +0000 (11:11 +0000)]
Auto merge of #4463 - flip1995:rollup-240kr2c, r=flip1995
Rollup of 2 pull requests
Successful merges:
- #4459 (Add note to avoid confusing)
- #4460 (Fix `inherent_to_string` false positive)
Failed merges:
r? @ghost
changelog: none
Philipp Krones [Wed, 28 Aug 2019 11:00:52 +0000 (13:00 +0200)]
Rollup merge of #4460 - JohnTitor:fix-inherent-to-string, r=flip1995
Fix `inherent_to_string` false positive
Fixes #4457
changelog: fixes `inherent_to_string` false positive
Philipp Krones [Wed, 28 Aug 2019 11:00:51 +0000 (13:00 +0200)]
Rollup merge of #4459 - JohnTitor:update-testing-notes, r=flip1995
Add note to avoid confusing
Fixes #4456
changelog: none
bors [Wed, 28 Aug 2019 10:28:30 +0000 (10:28 +0000)]
Auto merge of #4462 - JohnTitor:fix-build-arg, r=flip1995
Replace `Arg` with `Param`
Fix build issue.
Rustup to https://github.com/rust-lang/rust/pull/63127
changelog: none
Yuki Okushi [Wed, 28 Aug 2019 09:27:06 +0000 (18:27 +0900)]
Replace `Arg` with `Param`
Philipp Hansch [Wed, 28 Aug 2019 05:29:30 +0000 (07:29 +0200)]
Update int_plus_one suggestion text
This is now in line with the recommendations from here:
https://doc.rust-lang.org/nightly/nightly-rustc/rustc_errors/struct.Diagnostic.html#method.span_suggestion
Philipp Hansch [Mon, 19 Aug 2019 06:00:39 +0000 (08:00 +0200)]
Change float_cmp Applicability to `HasPlaceholders`
The suggestion includes an 'errors' placeholder currently, so it's not
`MachineApplicable`
Philipp Hansch [Sun, 18 Aug 2019 07:37:12 +0000 (09:37 +0200)]
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.
Philipp Hansch [Sun, 18 Aug 2019 07:32:38 +0000 (09:32 +0200)]
Add run-rustfix for outer_expn_data