]> git.lizzy.rs Git - rust.git/log
rust.git
4 years agocleaned up import suggestion formatter, look into code reuse with wildcard impotrs
Devin R [Tue, 26 May 2020 23:57:36 +0000 (19:57 -0400)]
cleaned up import suggestion formatter, look into code reuse with wildcard impotrs

4 years agowip: of handling nested import paths for multi-macro paths
Devin R [Fri, 15 May 2020 12:36:56 +0000 (08:36 -0400)]
wip: of handling nested import paths for multi-macro paths

4 years agostill working on displaying nested imports
Devin R [Thu, 14 May 2020 22:20:07 +0000 (18:20 -0400)]
still working on displaying nested imports

4 years agofix some of the review, rename, fmt, refactor
Devin R [Sun, 10 May 2020 13:06:33 +0000 (09:06 -0400)]
fix some of the review, rename, fmt, refactor

4 years agoremove session
Devin R [Tue, 24 Mar 2020 02:13:35 +0000 (22:13 -0400)]
remove session

4 years agouse hashset not map for keeping track of seen macro refs
Devin R [Fri, 13 Mar 2020 22:54:32 +0000 (18:54 -0400)]
use hashset not map for keeping track of seen macro refs

remove stdout, fix clippy warnings, fmtcar

4 years agocollected all the imports and names
Devin R [Wed, 4 Mar 2020 12:59:10 +0000 (07:59 -0500)]
collected all the imports and names

how to compare macro to import path

add more imports to test

4 years agowarn on macro_use attr
Devin R [Wed, 26 Feb 2020 12:40:31 +0000 (07:40 -0500)]
warn on macro_use attr

cargo dev update lints

use if_chain

clean up alot, span_lint_and_sugg

find imported macros for sugg

4 years agoAuto merge of #5692 - ebroto:5689_N_dotdot_N, r=yaahc
bors [Mon, 8 Jun 2020 17:15:45 +0000 (17:15 +0000)]
Auto merge of #5692 - ebroto:5689_N_dotdot_N, r=yaahc

reversed_empty_ranges: avoid linting N..N except in for loop arguments

changelog: [`reversed_empty_ranges`]: avoid linting N..N except in for loop arguments

r? @yaahc
Fixes #5689

4 years agoAuto merge of #5680 - ebroto:3792_let_return, r=Manishearth
bors [Mon, 8 Jun 2020 16:47:22 +0000 (16:47 +0000)]
Auto merge of #5680 - ebroto:3792_let_return, r=Manishearth

let_and_return: avoid "does not live long enough" errors

EDIT: Add #3324 to the list of fixes

<details>
<summary>Description of old impl</summary>
<br>
Avoid suggesting turning the RHS expression of the last statement into the block tail expression if a temporary borrows from a local that would be destroyed before.

This is my first incursion into MIR so there's probably room for improvement!
</details>

Avoid linting if the return type of some method or function called in the last statement has a lifetime parameter.

changelog: Fix false positive in [`let_and_return`]

Fixes #3792
Fixes #3324

4 years agoAuto merge of #5378 - Centril:unnested-or-pats, r=flip1995,phansch
bors [Mon, 8 Jun 2020 13:49:29 +0000 (13:49 +0000)]
Auto merge of #5378 - Centril:unnested-or-pats, r=flip1995,phansch

New lint: `unnested_or_patterns`

changelog: Adds a lint `unnested_or_patterns`, suggesting `Some(0 | 2)` as opposed to `Some(0) | Some(2)`. The lint only fires on compilers capable of using `#![feature(or_patterns)]`.

- The lint is primarily encoded as a pure algorithm which to unnest or-patterns in an `ast::Pat` (`fn unnest_or_patterns`) through a `MutVisitor`. After that is done, and assuming that any change was detected, then `pprust::pat_to_string` is used to simply convert the transformed pattern into a suggestion.

- The PR introduces a module `utils::ast_utils` with a bunch of functions for spanless & nodeless equality comparisons of ASTs.

cc https://github.com/rust-lang/rust/issues/54883

4 years agoFix rebase fallout
flip1995 [Sun, 7 Jun 2020 19:33:03 +0000 (21:33 +0200)]
Fix rebase fallout

4 years agoApply self-review by Centril
flip1995 [Sun, 7 Jun 2020 14:43:17 +0000 (16:43 +0200)]
Apply self-review by Centril

4 years agosplit unnested_or_patterns test
Mazdak Farrokhzad [Sat, 28 Mar 2020 12:08:57 +0000 (13:08 +0100)]
split unnested_or_patterns test

4 years agodogfood unnested_or_patterns
Mazdak Farrokhzad [Sat, 28 Mar 2020 10:45:13 +0000 (11:45 +0100)]
dogfood unnested_or_patterns

4 years agoRemove unnecessary lifetime parameter
Eduardo Broto [Sun, 7 Jun 2020 19:13:13 +0000 (21:13 +0200)]
Remove unnecessary lifetime parameter

4 years agoadd `unnested_or_patterns` lint
Mazdak Farrokhzad [Thu, 19 Mar 2020 13:14:52 +0000 (14:14 +0100)]
add `unnested_or_patterns` lint

4 years agoreversed_empty_ranges: don't lint N..N except in for loop arg
Eduardo Broto [Sun, 7 Jun 2020 18:38:28 +0000 (20:38 +0200)]
reversed_empty_ranges: don't lint N..N except in for loop arg

4 years agolet_and_return: do not lint if last statement borrows
Eduardo Broto [Sat, 6 Jun 2020 22:30:39 +0000 (00:30 +0200)]
let_and_return: do not lint if last statement borrows

4 years agoRename let_and_return test for consistency with the lint name
Eduardo Broto [Sat, 6 Jun 2020 19:51:41 +0000 (21:51 +0200)]
Rename let_and_return test for consistency with the lint name

4 years agoMake let_and_return a late lint pass
Eduardo Broto [Tue, 2 Jun 2020 23:13:57 +0000 (01:13 +0200)]
Make let_and_return a late lint pass

4 years agoAuto merge of #5691 - flip1995:rustup, r=matthiaskrgr
bors [Sun, 7 Jun 2020 12:55:08 +0000 (12:55 +0000)]
Auto merge of #5691 - flip1995:rustup, r=matthiaskrgr

Rustup

changelog: none

4 years agoTemporarily disable RLS integration test
flip1995 [Sun, 7 Jun 2020 12:54:21 +0000 (14:54 +0200)]
Temporarily disable RLS integration test

4 years agoRustup to rust-lang/rust#71796
flip1995 [Sun, 7 Jun 2020 01:07:48 +0000 (03:07 +0200)]
Rustup to rust-lang/rust#71796

4 years agoMerge remote-tracking branch 'upstream/master' into rustup
flip1995 [Sun, 7 Jun 2020 00:17:49 +0000 (02:17 +0200)]
Merge remote-tracking branch 'upstream/master' into rustup

4 years agoRollup merge of #72508 - ecstatic-morse:poly-self-ty, r=nikomatsakis
Ralf Jung [Sat, 6 Jun 2020 19:57:38 +0000 (21:57 +0200)]
Rollup merge of #72508 - ecstatic-morse:poly-self-ty, r=nikomatsakis

Make `PolyTraitRef::self_ty` return `Binder<Ty>`

This came up during review of #71618. The current implementation is the same as a call to `skip_binder` but harder to audit. Make it preserve binding levels and add a call to `skip_binder` at all use sites so they can be audited as part of #72507.

4 years agoAuto merge of #5674 - ThibsG:DocTypeDefinesMethod, r=yaahc,phansch,flip1995
bors [Sat, 6 Jun 2020 10:32:02 +0000 (10:32 +0000)]
Auto merge of #5674 - ThibsG:DocTypeDefinesMethod, r=yaahc,phansch,flip1995

Add doc for checking if type defines specific method

This PR adds documentation on how:
- check if a type defines a specific method
- check an expr is calling a specific method

closes: #3843

changelog: none

4 years agoAuto merge of #5528 - phansch:same-tys, r=flip1995
bors [Sat, 6 Jun 2020 10:04:21 +0000 (10:04 +0000)]
Auto merge of #5528 - phansch:same-tys, r=flip1995

Cleanup: Use rustc's `same_type` for our `same_tys`

This delegates our `same_tys` to [ty::TyS::same_type][same_type] to
remove some duplication.

Our `same_tys` was introduced 4 years ago in #730. Before, it was
building an inference context to be able to call
`can_eq` to compare the types. The `rustc-dev-guide` has some more details
about `can_eq` in [Type Inference -> Trying equality][try_eq].

Now, using the rustc function, we are essentially comparing the `DefId`s
of the given types, which also makes more sense, IMO.

I also confirmed that the FIXME is resolved via a bit of `dbg!`, however
no UI tests seem to have been affected.

[same_type]: https://github.com/rust-lang/rust/blob/659951c4a0d7450e43f61c61c0e87d0ceae17087/src/librustc_middle/ty/util.rs#L777
[try_eq]: https://rustc-dev-guide.rust-lang.org/type-inference.html#trying-equality

---

changelog: none

4 years agoCleanup: Use rustc's `same_types` instead of our `same_tys`
Philipp Hansch [Sat, 6 Jun 2020 09:50:59 +0000 (11:50 +0200)]
Cleanup: Use rustc's `same_types` instead of our `same_tys`

4 years agoAuto merge of #72927 - petrochenkov:rustc, r=Mark-Simulacrum
bors [Sat, 6 Jun 2020 09:00:51 +0000 (09:00 +0000)]
Auto merge of #72927 - petrochenkov:rustc, r=Mark-Simulacrum

Rename all remaining compiler crates to use the `rustc_foo` pattern

libarena -> librustc_arena
libfmt_macros -> librustc_parse_format
libgraphviz -> librustc_graphviz
libserialize -> librustc_serialize

Closes https://github.com/rust-lang/rust/issues/71177 in particular.

4 years agoAuto merge of #5688 - ebroto:fix_cargo_tests_in_rustc, r=flip1995
bors [Fri, 5 Jun 2020 21:59:37 +0000 (21:59 +0000)]
Auto merge of #5688 - ebroto:fix_cargo_tests_in_rustc, r=flip1995

Fix cargo tests when running inside the rustlang/rust repo

It seems we hit https://github.com/rust-lang/cargo/issues/5418, so I've applied the suggested solution. Also added some more info when cargo-metadata fails to execute.

(there was no open issue for this)

changelog: none

4 years agoFix cargo ui tests when running inside rust repo
Eduardo Broto [Fri, 5 Jun 2020 20:30:14 +0000 (22:30 +0200)]
Fix cargo ui tests when running inside rust repo

4 years agoAdd error info when cargo metadata fails to run
Eduardo Broto [Fri, 5 Jun 2020 20:28:58 +0000 (22:28 +0200)]
Add error info when cargo metadata fails to run

4 years agoAuto merge of #5687 - flip1995:release_doc, r=phansch
bors [Fri, 5 Jun 2020 13:34:19 +0000 (13:34 +0000)]
Auto merge of #5687 - flip1995:release_doc, r=phansch

Replace all remaining occurrences of submodule with subtree

r? @phansch

I should have included this in #5686, but forgot about it, so here we go again.

changelog: none

4 years agoReplace all remaining occurrences of submodule with subtree
flip1995 [Fri, 5 Jun 2020 12:47:12 +0000 (14:47 +0200)]
Replace all remaining occurrences of submodule with subtree

4 years agoAuto merge of #5671 - ebroto:changelog_144_145, r=flip1995
bors [Fri, 5 Jun 2020 12:52:23 +0000 (12:52 +0000)]
Auto merge of #5671 - ebroto:changelog_144_145, r=flip1995

Update changelog for stable:1.44 beta:1.45

[Rendered](https://github.com/ebroto/rust-clippy/blob/changelog_144_145/CHANGELOG.md)

changelog: none

4 years agoAuto merge of #5686 - flip1995:release_doc, r=phansch
bors [Fri, 5 Jun 2020 12:23:13 +0000 (12:23 +0000)]
Auto merge of #5686 - flip1995:release_doc, r=phansch

Reorder sections of release documentation

r? @phansch

[Rendered](https://github.com/flip1995/rust-clippy/blob/release_doc/doc/release.md)

changelog: none

4 years agoReorder sections of release documentation
flip1995 [Fri, 5 Jun 2020 11:56:07 +0000 (13:56 +0200)]
Reorder sections of release documentation

Before tagging a commit the beta branch has to be remerged

4 years agoAuto merge of #5685 - flip1995:backport_remerge, r=flip1995
bors [Fri, 5 Jun 2020 11:52:27 +0000 (11:52 +0000)]
Auto merge of #5685 - flip1995:backport_remerge, r=flip1995

Backport remerge

Part of the release process. Nothing to see here (literally).

d4092ac matches the current HEAD of the beta branch

changelog: none

4 years agoMerge remote-tracking branch 'upstream/beta' into backport_remerge
flip1995 [Fri, 5 Jun 2020 11:50:53 +0000 (13:50 +0200)]
Merge remote-tracking branch 'upstream/beta' into backport_remerge

4 years agoAuto merge of #5681 - matthiaskrgr:empty_line, r=phansch
bors [Thu, 4 Jun 2020 09:23:44 +0000 (09:23 +0000)]
Auto merge of #5681 - matthiaskrgr:empty_line, r=phansch

match_wildcard_for_single_variants: remove empty line at start of lint example.

See https://rust-lang.github.io/rust-clippy/master/index.html#match_wildcard_for_single_variants

changelog: none

4 years agomatch_wildcard_for_single_variants: remove empty line at start of lint example.
Matthias Krüger [Thu, 4 Jun 2020 01:34:22 +0000 (03:34 +0200)]
match_wildcard_for_single_variants: remove empty line at start of lint example.

See https://rust-lang.github.io/rust-clippy/master/index.html#match_wildcard_for_single_variants

changelog: none

4 years agoBump to 1.46
Mark Rousskov [Wed, 3 Jun 2020 19:15:53 +0000 (15:15 -0400)]
Bump to 1.46

4 years agoAuto merge of #5677 - lzutao:checked_conv, r=matthiaskrgr
bors [Wed, 3 Jun 2020 16:06:39 +0000 (16:06 +0000)]
Auto merge of #5677 - lzutao:checked_conv, r=matthiaskrgr

 Fix false negative of `checked_conversion` lint

Closes  #5675
changelog: none

4 years agoFix false negative of checked_conversion lint
Lzu Tao [Wed, 3 Jun 2020 02:04:24 +0000 (09:04 +0700)]
Fix false negative of checked_conversion lint

4 years agoUpdate fulldeps tests and clippy
Vadim Petrochenkov [Tue, 2 Jun 2020 19:46:42 +0000 (22:46 +0300)]
Update fulldeps tests and clippy

4 years agoApply suggestions from PR review
Eduardo Broto [Tue, 2 Jun 2020 18:45:57 +0000 (20:45 +0200)]
Apply suggestions from PR review

4 years agoRename the crates in source code
Vadim Petrochenkov [Tue, 2 Jun 2020 17:19:49 +0000 (20:19 +0300)]
Rename the crates in source code

4 years agoAuto merge of #5678 - lzutao:slice, r=flip1995
bors [Tue, 2 Jun 2020 16:42:51 +0000 (16:42 +0000)]
Auto merge of #5678 - lzutao:slice, r=flip1995

Make use of slice pattern

changelog: none

4 years agoMake use of slice pattern
Lzu Tao [Tue, 2 Jun 2020 14:42:33 +0000 (21:42 +0700)]
Make use of slice pattern

4 years agoAuto merge of #5672 - phansch:regression-test-env, r=yaahc
bors [Tue, 2 Jun 2020 12:40:20 +0000 (12:40 +0000)]
Auto merge of #5672 - phansch:regression-test-env, r=yaahc

Add regression test for `string_lit_as_bytes` issue

Closes #5619

Before the fix in https://github.com/rust-lang/rust/pull/72637, `string_lit_as_bytes` was incorrectly triggering on the `env!` macro. With the fix merged, this test makes sure that the lint is not triggering anymore.

changelog: none

4 years agoAuto merge of #5664 - ThibsG:GiveCorrectedCode, r=flip1995
bors [Tue, 2 Jun 2020 12:11:28 +0000 (12:11 +0000)]
Auto merge of #5664 - ThibsG:GiveCorrectedCode, r=flip1995

Give corrected code

This PR adds corrected code for doc examples.

I did this in several commits to facilitate review.
Don't hesitate to tell me if I forgot some.
Also, sometimes I felt it was not necessary to give corrected code, but I maybe wrong.

fixes: #4829

changelog: Improve documentation examples across multiple lints.

4 years agoAuto merge of #5597 - esamudera:slice_iter_next, r=flip1995
bors [Tue, 2 Jun 2020 11:42:22 +0000 (11:42 +0000)]
Auto merge of #5597 - esamudera:slice_iter_next, r=flip1995

New lint: iter_next_slice

Hello, this is a work-in-progress PR for issue: https://github.com/rust-lang/rust-clippy/issues/5572

I have implemented lint to replace `iter().next()` for `slice[index..]` and `array` with `get(index)` and `get(0)` respectively. However since I made a lot of changes, I would like to request some feedback before continuing so that I could fix mistakes.

Thank you!

---

changelog: implement `iter_next_slice` lint and test, and modify `needless_continues`, `for_loop_over_options_result` UI tests since they have `iter().next()`

4 years agoCall `skip_binder` or `no_bound_vars` before `self_ty`
Dylan MacKenzie [Sat, 23 May 2020 18:12:06 +0000 (11:12 -0700)]
Call `skip_binder` or `no_bound_vars` before `self_ty`

4 years agoUpdate documentation on changelog updates
Eduardo Broto [Mon, 1 Jun 2020 07:26:40 +0000 (09:26 +0200)]
Update documentation on changelog updates

4 years agoAuto merge of #5673 - phansch:endless-loop, r=Manishearth
bors [Mon, 1 Jun 2020 17:16:06 +0000 (17:16 +0000)]
Auto merge of #5673 - phansch:endless-loop, r=Manishearth

Add regression test for endless loop / update `pulldown_cmark`

Closes #4917

This was fixed in pulldown_cmark 0.7.1, specifically raphlinus/pulldown-cmark#438

changelog: none

4 years agoAdd doc for checking if type defines certain method
ThibsG [Sun, 31 May 2020 13:09:58 +0000 (15:09 +0200)]
Add doc for checking if type defines certain method

4 years agoCorrected doc PR fixes
ThibsG [Mon, 1 Jun 2020 08:16:01 +0000 (10:16 +0200)]
Corrected doc PR fixes

4 years agoAdd more corrected code for doc
ThibsG [Sun, 31 May 2020 10:08:41 +0000 (12:08 +0200)]
Add more corrected code for doc

4 years agoGive more corrected code examples in doc
ThibsG [Sun, 31 May 2020 09:38:48 +0000 (11:38 +0200)]
Give more corrected code examples in doc

4 years agoFix more code examples
ThibsG [Fri, 29 May 2020 16:15:42 +0000 (18:15 +0200)]
Fix more code examples

4 years agoFix some code examples in doc
ThibsG [Wed, 27 May 2020 14:24:53 +0000 (16:24 +0200)]
Fix some code examples in doc

4 years agoAdd regression test for endless loop
Philipp Hansch [Mon, 1 Jun 2020 08:20:17 +0000 (10:20 +0200)]
Add regression test for endless loop

This was fixed in pulldown_cmark 0.7.1, specifically
https://github.com/raphlinus/pulldown-cmark/pull/438

4 years agoAdd regression test for string_lit_as_bytes issue
Philipp Hansch [Mon, 1 Jun 2020 07:58:42 +0000 (09:58 +0200)]
Add regression test for string_lit_as_bytes issue

4 years agoAuto merge of #5623 - JarredAllen:sort_by_key_reverse, r=phansch
bors [Mon, 1 Jun 2020 07:43:16 +0000 (07:43 +0000)]
Auto merge of #5623 - JarredAllen:sort_by_key_reverse, r=phansch

New lint: Use Reverse with sort_by_key

Implements  #5578

changelog: New lint: [`unnecessary_sort_by`]

4 years agoUpdate changelog for stable:1.44 beta:1.45
Eduardo Broto [Sun, 31 May 2020 22:28:58 +0000 (00:28 +0200)]
Update changelog for stable:1.44 beta:1.45

4 years agoRan update_lints
JarredAllen [Sun, 31 May 2020 22:19:31 +0000 (15:19 -0700)]
Ran update_lints

4 years agoImplement suggestions from phansch
JarredAllen [Sun, 31 May 2020 22:09:12 +0000 (15:09 -0700)]
Implement suggestions from phansch

4 years agoAuto merge of #5661 - matthiaskrgr:explain_ra_setup, r=phansch
bors [Sun, 31 May 2020 21:59:56 +0000 (21:59 +0000)]
Auto merge of #5661 - matthiaskrgr:explain_ra_setup, r=phansch

CONTRIBUTING: explain how to use cargo dev ra-setup

Fixes #5514

Technically this should be merged after https://github.com/rust-lang/rust-clippy/pull/5655 but it's not very important.

---

changelog: none

4 years agoCONTRIBUTING: explain how to use cargo dev ra-setup
Matthias Krüger [Thu, 28 May 2020 19:42:01 +0000 (21:42 +0200)]
CONTRIBUTING: explain how to use cargo dev ra-setup

Fixes #5514

4 years agoNew lint: iter_next_slice
Ericko Samudera [Mon, 25 May 2020 16:22:01 +0000 (23:22 +0700)]
New lint: iter_next_slice

4 years agoAuto merge of #5662 - ebroto:cargo_tests_invalid_crate, r=flip1995
bors [Sun, 31 May 2020 19:12:00 +0000 (19:12 +0000)]
Auto merge of #5662 - ebroto:cargo_tests_invalid_crate, r=flip1995

cargo-ui tests: check that <dir>/src exists before processing test

I forgot that I had fixed this in a PR I closed some days ago (#5643).

Before this change, cargo UI tests could fail when switching between branches if the previous branch had a test that the current branch does not have. The directory is not removed when switching because an ignored `Cargo.lock` file exists, and the code was trying to reach `$DIR/src` unconditionally.

This change will just skip a directory that has no `src` subdirectory.

changelog: none

4 years agoUpdated test cases and formatted
JarredAllen [Sun, 31 May 2020 19:06:32 +0000 (12:06 -0700)]
Updated test cases and formatted

4 years agoRenamed to
JarredAllen [Fri, 29 May 2020 01:18:25 +0000 (18:18 -0700)]
Renamed to

4 years agoDetect also when works
JarredAllen [Mon, 25 May 2020 03:05:58 +0000 (20:05 -0700)]
Detect also when  works

4 years agoDetect also a non-reversed comparison
JarredAllen [Mon, 25 May 2020 02:45:41 +0000 (19:45 -0700)]
Detect also a non-reversed comparison

4 years agoAdded negative test cases and ran cargo dev fmt
JarredAllen [Wed, 20 May 2020 16:23:00 +0000 (09:23 -0700)]
Added negative test cases and ran cargo dev fmt

4 years agoPasses all tests now!
JarredAllen [Wed, 20 May 2020 05:57:27 +0000 (22:57 -0700)]
Passes all tests now!

4 years agoMore progress towards sort_by_key_reverse lint
JarredAllen [Tue, 19 May 2020 04:48:35 +0000 (21:48 -0700)]
More progress towards sort_by_key_reverse lint

4 years agoAttempted start at sort_by_key_reverse lint
JarredAllen [Sat, 16 May 2020 20:50:33 +0000 (13:50 -0700)]
Attempted start at sort_by_key_reverse lint

4 years agoCreated lint
JarredAllen [Thu, 14 May 2020 22:06:05 +0000 (15:06 -0700)]
Created lint

4 years agocargo-ui tests: check that <dir>/src exists before processing test
Eduardo Broto [Sun, 24 May 2020 22:41:13 +0000 (00:41 +0200)]
cargo-ui tests: check that <dir>/src exists before processing test

4 years agoAuto merge of #4455 - flip1995:unit_arg_appl, r=phansch
bors [Sun, 31 May 2020 18:01:40 +0000 (18:01 +0000)]
Auto merge of #4455 - flip1995:unit_arg_appl, r=phansch

Rework suggestion generation of `unit_arg` lint

Found this bug while running `cargo fix --clippy` on quite a big codebase:

This would replace something like:
```rust
Some(fn_that_actually_does_something(&a, b))
```
with
```rust
Some(())
```
which obviously suppresses side effects.

Since pretty much every expression could have side effects, I think making this suggestion `MaybeIncorrect` is the best thing to do here.

A correct suggestion would be:

```rust
fn_that_actually_does_something(&a, b);
Some(())
```

Somehow the suggestion is not correctly applied to the arguments, when more than one argument is a unit value. I have to look into this a little more, though.

changelog: Fixes suggestion of `unit_arg` lint, so that it suggests semantic equivalent code

Fixes #4741

4 years agoAuto merge of #5669 - mikerite:fix-cargo_metadata-0.9, r=phansch
bors [Sun, 31 May 2020 17:31:29 +0000 (17:31 +0000)]
Auto merge of #5669 - mikerite:fix-cargo_metadata-0.9, r=phansch

Increase cargo_metadata version to 0.9.1

`clippy_lints` makes use of `dep_kinds` on `NodeDep` but this was only
added in versoin 0.9.1. Compiling with 0.9.0 will fail because of this.

changelog: none

4 years agoAdd tests for empty blocks
flip1995 [Sun, 31 May 2020 17:29:36 +0000 (19:29 +0200)]
Add tests for empty blocks

4 years agoDon't suggest to move empty blocks
flip1995 [Sun, 31 May 2020 16:45:16 +0000 (18:45 +0200)]
Don't suggest to move empty blocks

4 years agoUpdate test files
flip1995 [Mon, 17 Feb 2020 17:12:01 +0000 (18:12 +0100)]
Update test files

4 years agoMove linting out in its own function
flip1995 [Tue, 18 Feb 2020 08:51:52 +0000 (09:51 +0100)]
Move linting out in its own function

4 years agoSuggest to remove the semicolon of the last stmt in a block
flip1995 [Mon, 17 Feb 2020 17:11:50 +0000 (18:11 +0100)]
Suggest to remove the semicolon of the last stmt in a block

4 years agoRework suggestion generation and use multipart_suggestion again
flip1995 [Mon, 17 Feb 2020 17:10:59 +0000 (18:10 +0100)]
Rework suggestion generation and use multipart_suggestion again

4 years agoUse multiple span_suggestions instead of multipart_suggestion
flip1995 [Mon, 26 Aug 2019 19:43:29 +0000 (21:43 +0200)]
Use multiple span_suggestions instead of multipart_suggestion

multipart suggestions aren't autofixable by rustfix yet

4 years agoAdapt stderr and fixed files
flip1995 [Mon, 26 Aug 2019 17:35:25 +0000 (19:35 +0200)]
Adapt stderr and fixed files

4 years agoRework suggestion generation of `unit_arg` lint
flip1995 [Mon, 26 Aug 2019 16:34:30 +0000 (18:34 +0200)]
Rework suggestion generation of `unit_arg` lint

4 years agoIncrease cargo_metadata version to 0.9.1
Michael Wright [Sun, 31 May 2020 15:38:59 +0000 (17:38 +0200)]
Increase cargo_metadata version to 0.9.1

`clippy_lints` makes use of `dep_kinds` on `NodeDep` but this was only
added in versoin 0.9.1. Compiling with 0.9.0 will fail because of this.

4 years agoAuto merge of #5667 - djugei:master, r=flip1995
bors [Sun, 31 May 2020 14:26:03 +0000 (14:26 +0000)]
Auto merge of #5667 - djugei:master, r=flip1995

moved cast_ptr_alignment to pedantic and expanded documentation

fixes: #5618
changelog: cast_ptr_alignment moved to pedantic

4 years agoran update_lints
djugei [Sun, 31 May 2020 14:00:29 +0000 (16:00 +0200)]
ran update_lints

4 years agoAuto merge of #5666 - flip1995:rollup-yjyvvbg, r=flip1995
bors [Sun, 31 May 2020 13:57:08 +0000 (13:57 +0000)]
Auto merge of #5666 - flip1995:rollup-yjyvvbg, r=flip1995

Rollup of 3 pull requests

Successful merges:

 - #5637 (new lint: vec_resize_to_zero)
 - #5656 (len_zero: skip ranges if feature `range_is_empty` is not enabled)
 - #5663 (add testcase that no longer ICEs)

Failed merges:

r? @ghost

changelog: rollup

4 years agomoved cast_ptr_alignment to pedantic and expanded documentation
djugei [Sun, 31 May 2020 13:41:33 +0000 (15:41 +0200)]
moved cast_ptr_alignment to pedantic and expanded documentation

4 years agoRollup merge of #5663 - matthiaskrgr:crash_test_3969, r=Manishearth
Philipp Krones [Sun, 31 May 2020 12:57:34 +0000 (14:57 +0200)]
Rollup merge of #5663 - matthiaskrgr:crash_test_3969, r=Manishearth

add testcase that no longer ICEs

Fixes #3969

changelog: none

4 years agoRollup merge of #5656 - ebroto:len_zero_ranges, r=matthiaskrgr
Philipp Krones [Sun, 31 May 2020 12:57:33 +0000 (14:57 +0200)]
Rollup merge of #5656 - ebroto:len_zero_ranges, r=matthiaskrgr

len_zero: skip ranges if feature `range_is_empty` is not enabled

If the feature is not enabled, calling `is_empty()` on a range is ambiguous. Moreover, the two possible resolutions are unstable methods, one inherent to the range and the other being part of the `ExactSizeIterator` trait.

Since `len_zero` only checks for existing `is_empty()` inherent methods, we only take into account the `range_is_empty` feature.

Related: https://github.com/rust-lang/rust/issues/48111#issuecomment-445132965

changelog: len_zero: avoid linting ranges without #![feature(range_is_empty)]

Fixes: #3807