Commit graph

7492 commits

Author SHA1 Message Date
Manish Goregaokar
49adc99aed op_ref: Move tests out of eq_op file 2019-09-20 23:21:37 +09:00
bors
ca9e4adf3d Auto merge of #4511 - rust-lang:replace_uninitialized, r=flip1995
New lint: mem_replace_with_uninit

changelog: add `mem_replace_uninit` lint

This fixes #4485
2019-09-20 07:27:36 +00:00
Manish Goregaokar
d513a0b0a1 deref_addrof_double_trigger: Note why rustfix can't be used 2019-09-20 14:51:28 +09:00
Manish Goregaokar
fa969762a4 assign_ops: Remove MachineApplicable 2019-09-20 14:51:28 +09:00
Andre Bogus
8d884c8a1a new lint: mem-replace-with-uninit 2019-09-20 00:25:57 +02:00
bors
cdaa93d695 Auto merge of #4544 - JoshMcguigan:issue-4542, r=flip1995
#4542 remove machine applicable suggestion

This helps #4542 (but does not completely resolve) by removing the machine applicable suggestion (which was incorrect) for that case.

I would have preferred to fix the machine applicable suggestion to handle format strings, but that's a bit beyond my current understanding of the clippy codebase. I'd be happy to give it a try given some guidance.

changelog: only produce machine applicable suggestions on `explicit_write` lint
2019-09-19 09:28:29 +00:00
bors
f08f171530 Auto merge of #4539 - jolson88:cast-lossless-pedantic, r=flip1995
Changes cast-lossless to a pedantic lint

As discussed in #4528, this moves the cast-lossless lint from `all` to `pedantic`.

I couldn't tell from description alone if it should also be removed from the complexity category, so I left it as part of complexity for now. I didn't see any impact to the tests from this change, but I could be wrong (as this is my first PR).

fixes #4528

changelog: Moves cast-lossless from default to checking only as a `pedantic` lint.
2019-09-19 08:50:31 +00:00
bors
f783ff3d52 Auto merge of #4535 - rust-lang:unsafe-doc, r=flip1995
New lint: Require `# Safety` section in pub unsafe fn docs

changelog: add `missing_safety_doc` lint

This fixes #2207
2019-09-19 08:21:42 +00:00
Andre Bogus
70a7dab773 New lint: Require # Safety section in pub unsafe fn docs 2019-09-19 09:19:55 +02:00
bors
a5e568bcc8 Auto merge of #4551 - mikerite:fix-ice-reporting, r=llogiq
Fix ice reporting

changelog: none
2019-09-19 04:12:43 +00:00
Michael Wright
16ce071bed Work around qpath_res issue 2019-09-18 21:57:14 +02:00
Josh Mcguigan
24ec994001 remove machine applicable suggestion explicit_write format #4542 2019-09-18 01:59:58 -07:00
mikerite
fed1709f46
Add note about refactoring
Co-Authored-By: Philipp Krones <hello@philkrones.com>
2019-09-18 06:48:47 +02:00
flip1995
c3cfb77bc7
Add ICE regression test 2019-09-17 09:49:08 +02:00
Jason Olson
cc68d8135b
Changes to catch_fatal_errors in rustc driver
A [recent PR](https://github.com/rust-lang/rust/pull/60584/files#diff-707a0eda6b2f1a0537abc3d23133748cL1151)
changed the function name from `report_ices_to_stderr_if_any` to `catch_fatal_errors`. This PR changes to using
the new function name.
2019-09-16 11:08:45 -07:00
Jason Olson
6f1f413717
Changes cast-lossless to a pedantic lint
Fixes #4528
2019-09-15 10:32:45 -07:00
bors
535bc1d704 Auto merge of #4513 - matthiaskrgr:dogdood_incrcomp, r=llogiq
tests: disable incremental compilation in dogfood to reduce target dir size

tests: execute dogfood tests with incremental compilation disabled reduces target/ dir size of when "cargo test"ing by around 2 gigs.

changelog: none
2019-09-14 16:02:59 +00:00
bors
6b6580ccf9 Auto merge of #4540 - jolson88:fix-place-projection, r=phansch
Fix rustc breaking change: convert to Place's new boxed slice projection

Addressed breaking changes from rust-lang PR https://github.com/rust-lang/rust/pull/63420/

I'm not entirely sure the semantics are preserved as I don't have much knowledge about MIR yet. So this code was largely reverse-engineered from the PR above. I wouldn't be surprised if I did something wrong :).

I followed the instructions to pull latest rustc from master and verified the build break I was seeing in my PR for cast-lossless in Travis CI. With these changes, it compiles again and all tests pass.

Fixes https://github.com/rust-lang/rust/issues/64440

changelog: none
2019-09-14 06:12:52 +00:00
Jason Olson
80822b430d
Convert to Place's new boxed slice projection
Fixes breaking change from rust-lang PR https://github.com/rust-lang/rust/pull/63420/
2019-09-13 18:49:11 -07:00
Michael Wright
99be5221bc Apply review suggestions
Fix grammar errors and use `Pat::is_rest` instead of own function.
2019-09-13 08:31:24 +02:00
bors
ff4a3fb52f Auto merge of #4536 - matthiaskrgr:impl_lint_doc, r=flip1995
docs: fix broken link in adding_lints documantation

changelog: none
2019-09-12 08:10:43 +00:00
bors
30c75ed5b3 Auto merge of #4538 - mikerite:fix-3567, r=flip1995
Verify that issue #3567 is resolved

Closes #3567

changelog: none
2019-09-12 07:42:38 +00:00
Michael Wright
67f149215f Verify that issue #3567 is resolved
Closes #3567
2019-09-12 08:47:11 +02:00
Michael Wright
00ca42fe5b Fix lint warnings 2019-09-12 08:36:05 +02:00
Michael Wright
4a3bc6b592 Add unneeded-wildcard-pattern lint 2019-09-12 08:25:05 +02:00
Matthias Krüger
6038c31637 docs: fix broken link in adding_lints documantation 2019-09-11 21:53:12 +02:00
Matthias Krüger
a1ecf39442 tests: dogfood: run tests with debuginfo=0 reducing dogfood target dir size even further. 2019-09-11 21:29:07 +02:00
Matthias Krüger
34dc07863d tests: execute dogfood tests with incremental compilation disabled
reduces target/ dir size of when "cago test"ing by around 2 gigs.
2019-09-11 21:29:00 +02:00
bors
6ca5b2053a 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
2019-09-11 09:48:25 +00:00
bors
dfa88c6841 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
2019-09-11 07:14:31 +00:00
Matthias Krüger
b72982759c run rustfmt 2019-09-11 08:26:57 +02:00
bors
12bb7d668d 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
2019-09-10 19:40:45 +00:00
Andre Bogus
5823e9468d 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.
2019-09-10 17:46:39 +02:00
bors
c53d2b824e 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
2019-09-10 07:32:11 +00:00
bors
09ed605df8 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
2019-09-10 04:04:42 +00:00
Lzu Tao
b4d7f04a1d Remove feature gate bind-by-move 2019-09-10 09:23:25 +07:00
bors
4ee8bc84cd 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
2019-09-09 16:56:51 +00:00
bors
c733376a5f Auto merge of #4522 - mikerite:fix-4514, r=phansch
Fix `or_fun_call` bad suggestion

Closes #4514

changelog: Fix `or_fun_call` bad suggestion
2019-09-09 15:38:59 +00:00
Andre Bogus
507c03a859 Changed more Vec paths to diagnostic_items 2019-09-09 17:22:41 +02:00
bors
8af4e09605 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
2019-09-09 14:55:33 +00:00
bors
144d940c2f 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
2019-09-09 14:13:55 +00:00
Lzu Tao
ca1c0aa819 Add a regression test for proc-macro attribute 2019-09-09 16:14:32 +07:00
Lzu Tao
a5f4d3ce29 Fix regression in case of proc-macro attribute expansion 2019-09-09 16:14:32 +07:00
Michael Wright
31fbff2a36 Extend use_self to check constructor
Rust did not allow this before.
2019-09-09 07:51:44 +02:00
Michael Wright
f88c224d82 Merge branch 'master' into fix-4514 2019-09-09 07:36:30 +02:00
bors
58e01ea4d7 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
2019-09-09 04:52:29 +00:00
Andre Bogus
e3c4ffd4aa Use diagnostic item for 2019-09-09 05:43:39 +02:00
bors
d4a48edbeb 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
2019-09-08 20:09:12 +00:00
Matthew Jasper
5e7ff6b705 Update non_expressive_names for or patterns 2019-09-08 16:27:54 +01:00
Matthew Jasper
a2477f7759 Remove use of the HIR CFG 2019-09-08 16:27:54 +01:00