]> git.lizzy.rs Git - rust.git/log
rust.git
5 years agoEnable rustfix on `unused_unit` tests
Michael Wright [Thu, 7 Mar 2019 06:21:41 +0000 (08:21 +0200)]
Enable rustfix on `unused_unit` tests

5 years agoAdd `[rustfmt::skip]` to `unused_unit` test
Michael Wright [Thu, 7 Mar 2019 06:13:59 +0000 (08:13 +0200)]
Add `[rustfmt::skip]` to `unused_unit` test

5 years agoAdd `[rustfmt::skip]` to `doc_markdown` tests
Michael Wright [Thu, 7 Mar 2019 06:03:15 +0000 (08:03 +0200)]
Add `[rustfmt::skip]` to `doc_markdown` tests

5 years agoAuto merge of #3803 - felix91gr:master, r=oli-obk
bors [Wed, 6 Mar 2019 13:41:31 +0000 (13:41 +0000)]
Auto merge of #3803 - felix91gr:master, r=oli-obk

Cognitive Complexity (step 1 out of 3+): name changes

Following up on #3793

**Overall checklist:**

1. **Name changes**
2. MVP of functionality
3. Tests

After this PR, we will start working on the implementation itself.

5 years agoRenamed: Cyclomatic Complexity -> Cognitive Complexity
Félix Fischer [Sat, 23 Feb 2019 01:19:50 +0000 (22:19 -0300)]
Renamed: Cyclomatic Complexity -> Cognitive Complexity

* Ran automatic naming update

* Formalized rename of `cyclomatic_complexity` to `cognitive_complexity`
** Added the rename to `lib.rs`
** Added rename test

* Added warning for deprecated key `cyclomatic_complexity_threshold` and tests for it

* Added deprecation status for Clippy's builtin attribute

* Updated tests for new builtin attribute renaming

5 years agoAuto merge of #3845 - euclio:unused-comments, r=phansch
bors [Wed, 6 Mar 2019 06:48:26 +0000 (06:48 +0000)]
Auto merge of #3845 - euclio:unused-comments, r=phansch

move lint documentation into macro invocations

This PR moves lint documentation inside `declare_clippy_lint!` macro invocations, to avoid triggering the `unused_doc_comments` lint once it's modified in rust-lang/rust#57882. This PR is necessary to unblock that work, since the large number of warnings generated in `clippy_lints` causes Travis to hit the log length limit.

This PR also updates the documentation and website generation script.

It would be nice to get a clippy update in the Rust repo once this is merged.

cc @phansch

5 years agoAuto merge of #3846 - mikerite:fix-3839, r=phansch
bors [Wed, 6 Mar 2019 05:54:48 +0000 (05:54 +0000)]
Auto merge of #3846 - mikerite:fix-3839, r=phansch

Ensure `expect_fun_call` bad suggestion is fixed

Closes #3839

5 years agoEnsure `expect_fun_call` bad suggestion is fixed
Michael Wright [Wed, 6 Mar 2019 05:00:05 +0000 (07:00 +0200)]
Ensure `expect_fun_call` bad suggestion is fixed

Closes #3839

5 years agofix or ignore failing doc tests
Andy Russell [Tue, 5 Mar 2019 22:23:50 +0000 (17:23 -0500)]
fix or ignore failing doc tests

5 years agomove lint documentation into macro invocations
Andy Russell [Tue, 5 Mar 2019 16:50:33 +0000 (11:50 -0500)]
move lint documentation into macro invocations

5 years agoAuto merge of #3844 - phansch:const_fn_external_macro, r=oli-obk
bors [Tue, 5 Mar 2019 10:12:53 +0000 (10:12 +0000)]
Auto merge of #3844 - phansch:const_fn_external_macro, r=oli-obk

Fix two missing_const_for_fn false positives

Fixes #3841

* Fixes false positive in external macros
* Fixes false positive when implement trait methods

5 years agoFix missing_const_for_fn for impl trait methods
Philipp Hansch [Tue, 5 Mar 2019 07:11:55 +0000 (08:11 +0100)]
Fix missing_const_for_fn for impl trait methods

5 years agoDon't trigger missing_const_for_fn in external macros
Philipp Hansch [Mon, 4 Mar 2019 21:56:33 +0000 (22:56 +0100)]
Don't trigger missing_const_for_fn in external macros

As reported in #3841. Only fixes the part where it triggers on the
`derive`.

5 years agoAuto merge of #3838 - mati865:rustup, r=phansch
bors [Sun, 3 Mar 2019 15:09:00 +0000 (15:09 +0000)]
Auto merge of #3838 - mati865:rustup, r=phansch

Upgrade compiletest_rs to 0.3.19

5 years agoUpgrade compiletest_rs to 0.3.19
Mateusz Mikuła [Sun, 3 Mar 2019 15:02:59 +0000 (16:02 +0100)]
Upgrade compiletest_rs to 0.3.19

5 years agoAuto merge of #3834 - ljedrz:HirIdification_fix, r=phansch
bors [Sun, 3 Mar 2019 12:26:15 +0000 (12:26 +0000)]
Auto merge of #3834 - ljedrz:HirIdification_fix, r=phansch

HirIdification fixes

Supersedes https://github.com/rust-lang/rust-clippy/pull/3828, enables https://github.com/rust-lang/rust/pull/58836.

As usual, requesting a branch.

5 years agofmt fixes
Philipp Hansch [Sun, 3 Mar 2019 12:00:49 +0000 (13:00 +0100)]
fmt fixes

5 years agoalign with rust-lang/rust/#58836
ljedrz [Fri, 1 Mar 2019 12:26:06 +0000 (13:26 +0100)]
align with rust-lang/rust/#58836

5 years agoenable rust-lang/rust#58754
ljedrz [Wed, 27 Feb 2019 09:39:33 +0000 (10:39 +0100)]
enable rust-lang/rust#58754

5 years agoAuto merge of #3823 - spastorino:place_base, r=flip1995
bors [Fri, 1 Mar 2019 16:03:15 +0000 (16:03 +0000)]
Auto merge of #3823 - spastorino:place_base, r=flip1995

Place::Local(x) is now Place::Base(PlaceBase::Local(x))

We need to merge this after the beta cut for this https://github.com/rust-lang/rust/pull/58631 to work.
/cc @oli-obk

5 years agoPlace::Local(x) is now Place::Base(PlaceBase::Local(x))
Santiago Pastorino [Tue, 26 Feb 2019 18:02:22 +0000 (15:02 -0300)]
Place::Local(x) is now Place::Base(PlaceBase::Local(x))

5 years agoAuto merge of #3833 - mati865:rustup, r=oli-obk
bors [Fri, 1 Mar 2019 12:51:11 +0000 (12:51 +0000)]
Auto merge of #3833 - mati865:rustup, r=oli-obk

Fix build with the master

https://github.com/rust-lang/rust/pull/58689 broke compiletest.

5 years agoUse temporary branch for compiletest
Mateusz Mikuła [Fri, 1 Mar 2019 10:54:25 +0000 (11:54 +0100)]
Use temporary branch for compiletest

https://github.com/rust-lang/rust/pull/58689 broke it

5 years agoAuto merge of #3831 - martin-t:master, r=flip1995
bors [Thu, 28 Feb 2019 19:56:25 +0000 (19:56 +0000)]
Auto merge of #3831 - martin-t:master, r=flip1995

Use the same <title> as <h1> on gh-pages

I think this makes the page easier to find using firefox's URL bar - it (afaik) searches based on the page's URL and title so if somebody doesn't have it bookmarked but remembers that the page contained "ALL lints" or something similar it's easy to go to it directly without resorting to a search engine.

5 years agoAuto merge of #3830 - flip1995:unknown_attribute, r=oli-obk
bors [Thu, 28 Feb 2019 19:20:06 +0000 (19:20 +0000)]
Auto merge of #3830 - flip1995:unknown_attribute, r=oli-obk

Error on unknown or deprecated attributes

The reason I decided to not make this a lint is, that unknown attributes are always a hard error in rustc and also in rustfmt, which cannot be turned off by an `allow`. This could have been done by introducing a category which would be forbid-by-default. But that would have introduced a new lint category+group for just one lint and also wouldn't be consistent with rustfmt and rustc.

5 years agoAdd test for unknown Clippy attributes
flip1995 [Thu, 28 Feb 2019 15:47:00 +0000 (16:47 +0100)]
Add test for unknown Clippy attributes

5 years agoUse the same <title> as <h1> on gh-pages
Martin Taibr [Thu, 28 Feb 2019 18:17:10 +0000 (19:17 +0100)]
Use the same <title> as <h1> on gh-pages

5 years agoError an unknown or deprecated Clippy attribute
flip1995 [Thu, 28 Feb 2019 15:44:42 +0000 (16:44 +0100)]
Error an unknown or deprecated Clippy attribute

5 years agoAuto merge of #3829 - mikerite:fix-double-parens-suggestions, r=flip1995
bors [Thu, 28 Feb 2019 10:09:00 +0000 (10:09 +0000)]
Auto merge of #3829 - mikerite:fix-double-parens-suggestions, r=flip1995

Add `rustfmt::skip` to `double_parens` tests

5 years agoAdd `rustfmt::skip` to `double_parens` tests
Michael Wright [Thu, 28 Feb 2019 06:02:45 +0000 (08:02 +0200)]
Add `rustfmt::skip` to `double_parens` tests

5 years agoAuto merge of #3666 - detrumi:map-or-on-non-copy, r=flip1995
bors [Wed, 27 Feb 2019 08:28:48 +0000 (08:28 +0000)]
Auto merge of #3666 - detrumi:map-or-on-non-copy, r=flip1995

Only suggest map_or for copy types

Fixes #2686

5 years agoAuto merge of #3826 - mikerite:rustfmt-outer-attr-tests, r=phansch
bors [Wed, 27 Feb 2019 06:49:09 +0000 (06:49 +0000)]
Auto merge of #3826 - mikerite:rustfmt-outer-attr-tests, r=phansch

Add `rustfmt::skip` to outer attr format tests

5 years agoAuto merge of #3827 - phansch:rustup, r=Manishearth
bors [Wed, 27 Feb 2019 06:28:08 +0000 (06:28 +0000)]
Auto merge of #3827 - phansch:rustup, r=Manishearth

Rustup rust-lang/rust#58321

Fixes the build after https://github.com/rust-lang/rust/issues/58321

5 years agoRustup https://github.com/rust-lang/rust/pull/58321
Philipp Hansch [Wed, 27 Feb 2019 06:20:49 +0000 (07:20 +0100)]
Rustup https://github.com/rust-lang/rust/pull/58321

5 years agoAdd `rustfmt::skip` to outer attr format tests
Michael Wright [Wed, 27 Feb 2019 05:41:07 +0000 (07:41 +0200)]
Add `rustfmt::skip` to outer attr format tests

5 years agoAuto merge of #3821 - g-bartoszek:redundant_closure-different-borrow-levels, r=oli-obk
bors [Tue, 26 Feb 2019 17:30:48 +0000 (17:30 +0000)]
Auto merge of #3821 - g-bartoszek:redundant_closure-different-borrow-levels, r=oli-obk

do not trigger redundant_closure when there is a difference in borrow…

… level between closure parameter and "self", fixes  #3802

5 years agoAuto merge of #3818 - phansch:update_changelog, r=oli-obk
bors [Tue, 26 Feb 2019 16:40:12 +0000 (16:40 +0000)]
Auto merge of #3818 - phansch:update_changelog, r=oli-obk

Update changelog for Rust 1.33

None

5 years agoFix false negative
Wilco Kusee [Tue, 5 Feb 2019 15:59:23 +0000 (16:59 +0100)]
Fix false negative

5 years agoAttempt to fix false negative
Wilco Kusee [Mon, 21 Jan 2019 17:29:35 +0000 (18:29 +0100)]
Attempt to fix false negative

5 years agoMove lint_map_unwrap_or to its own file
Wilco Kusee [Sat, 19 Jan 2019 11:53:21 +0000 (12:53 +0100)]
Move lint_map_unwrap_or to its own file

5 years agoOnly suggest map_or for copy types
Wilco Kusee [Wed, 16 Jan 2019 15:55:53 +0000 (16:55 +0100)]
Only suggest map_or for copy types

5 years agoAuto merge of #3817 - rust-lang:fix-bool_comparison-on-non-bool, r=oli-obk
bors [Tue, 26 Feb 2019 15:51:40 +0000 (15:51 +0000)]
Auto merge of #3817 - rust-lang:fix-bool_comparison-on-non-bool, r=oli-obk

Fix `bool_comparison` with non-`bool` expressions

Fixes #3703.
It just moves around the type check that was already there for some comparison to all of them, because if one type isn't `bool`, none of those comparison can be simplified.

5 years agodo not trigger redundant_closure when there is a difference in borrow level between...
Grzegorz [Tue, 26 Feb 2019 11:12:27 +0000 (12:12 +0100)]
do not trigger redundant_closure when there is a difference in borrow level between closure parameter and "self"

5 years agoAuto merge of #3814 - ljedrz:HirIdification_lockstep_upgrade, r=phansch
bors [Tue, 26 Feb 2019 10:43:50 +0000 (10:43 +0000)]
Auto merge of #3814 - ljedrz:HirIdification_lockstep_upgrade, r=phansch

HirIdify some lints

Unblocks https://github.com/rust-lang/rust/pull/58561 (a part of [rust-lang/rust#57578](https://github.com/rust-lang/rust/pull/57578)). Can we branch it like with https://github.com/rust-lang/rust-clippy/pull/3790? I can rebase on a different commit if need be.

Haven't had time to run tests yet, so I'd wait for Travis 🙈.

5 years agofix line format
ljedrz [Tue, 26 Feb 2019 10:21:07 +0000 (11:21 +0100)]
fix line format

5 years agoAuto merge of #3819 - mikerite:rustfmt-formatting-tests, r=phansch
bors [Tue, 26 Feb 2019 07:21:01 +0000 (07:21 +0000)]
Auto merge of #3819 - mikerite:rustfmt-formatting-tests, r=phansch

Add [rustfmt::skip] to formatting lint tests

5 years agoAuto merge of #3820 - mikerite:remove-feature-try-from, r=Manishearth
bors [Tue, 26 Feb 2019 06:52:34 +0000 (06:52 +0000)]
Auto merge of #3820 - mikerite:remove-feature-try-from, r=Manishearth

Remove `#[feature(try_from)]`

`try_from` is now stable.

5 years agoRemove `#[feature(try_from)]`
Michael Wright [Tue, 26 Feb 2019 06:43:47 +0000 (08:43 +0200)]
Remove `#[feature(try_from)]`

`try_from` is now stable.

5 years agoAdd [rustfmt::skip] to formatting lint tests
Michael Wright [Tue, 26 Feb 2019 05:49:46 +0000 (07:49 +0200)]
Add [rustfmt::skip] to formatting lint tests

5 years agoUpdate changelog for Rust 1.33
Philipp Hansch [Mon, 25 Feb 2019 21:53:02 +0000 (22:53 +0100)]
Update changelog for Rust 1.33

5 years agoFix `bool_comparison` with non-`bool` expressions
mcarton [Mon, 25 Feb 2019 20:48:20 +0000 (21:48 +0100)]
Fix `bool_comparison` with non-`bool` expressions

5 years agoAuto merge of #3808 - mikerite:useless-format-suggestions, r=oli-obk
bors [Mon, 25 Feb 2019 16:21:26 +0000 (16:21 +0000)]
Auto merge of #3808 - mikerite:useless-format-suggestions, r=oli-obk

Fix `useless_format` suggestions

5 years agoAuto merge of #3816 - g-bartoszek:redundant_closure_for_macros, r=Manishearth
bors [Mon, 25 Feb 2019 13:46:31 +0000 (13:46 +0000)]
Auto merge of #3816 - g-bartoszek:redundant_closure_for_macros, r=Manishearth

do not trigger redundant_closure for external macros

fixes #3791

5 years agoredundant_closure does not trigger for external macros
Grzegorz [Mon, 25 Feb 2019 12:40:28 +0000 (13:40 +0100)]
redundant_closure does not trigger for external macros

5 years agoAuto merge of #3772 - flip1995:ice-3719, r=Manishearth
bors [Mon, 25 Feb 2019 12:30:35 +0000 (12:30 +0000)]
Auto merge of #3772 - flip1995:ice-3719, r=Manishearth

Fix ICE #3719+#3718 in lint match_ref_pats

Fixes #3719
This conveniently also fixes #3718

The ICE occurs when the match expression was a macro call, where the macro was defined in another file. Since we don't have the ability to reproduce this behavior with our UI tests (AFAIK), I couldn't add a test reproducing this ICE.. However, I added a test which is related to the ICE, to show the new behavior of the lint.

I tested it with the mscheme repo locally and the ICE didn't happen anymore.

r? @matthiaskrgr

5 years agoAuto merge of #3805 - martinsp:ice-3747, r=Manishearth
bors [Mon, 25 Feb 2019 12:08:43 +0000 (12:08 +0000)]
Auto merge of #3805 - martinsp:ice-3747, r=Manishearth

Fix ICE #3747

I'm not sure if this was the correct approach.

I don't know if I put tests/ui/crashses/ice-3747.rs in correct place because the test always passed when I ran it with `cargo test`, even without the fix applied.

If I run that test with `env CLIPPY_TESTS=true cargo run --bin clippy-driver -- -L ./target/debug tests/ui/crashes/ice-3747.rs` then the test correctly fails without the fix applied

fixes #3747

5 years agofix: replace wrong id
ljedrz [Mon, 25 Feb 2019 10:06:46 +0000 (11:06 +0100)]
fix: replace wrong id

5 years agoAuto merge of #3815 - phansch:make_private, r=Manishearth
bors [Mon, 25 Feb 2019 06:31:27 +0000 (06:31 +0000)]
Auto merge of #3815 - phansch:make_private, r=Manishearth

Make DiagnosticWrapper private

It's doesn't have to be public anywhere outside of clippy_lints as far as I can tell.

5 years agoMake DiagnosticWrapper private
Philipp Hansch [Mon, 25 Feb 2019 06:14:44 +0000 (07:14 +0100)]
Make DiagnosticWrapper private

It's doesn't have to be public anywhere outside of clippy_lints

5 years agoHirIdify some lints
ljedrz [Sun, 24 Feb 2019 18:43:15 +0000 (19:43 +0100)]
HirIdify some lints

5 years agoAuto merge of #3811 - rust-lang:test-for-2526, r=mcarton
bors [Sun, 24 Feb 2019 17:25:58 +0000 (17:25 +0000)]
Auto merge of #3811 - rust-lang:test-for-2526, r=mcarton

Add a test for #2526

Closes #2526, which seems to have been fixed at some point, but I couldn't find a test for it.

5 years agoAdd a test for #2526
mcarton [Sun, 24 Feb 2019 14:59:58 +0000 (15:59 +0100)]
Add a test for #2526

5 years agoAuto merge of #3810 - phansch:refactor/extract_module, r=flip1995
bors [Sun, 24 Feb 2019 15:35:01 +0000 (15:35 +0000)]
Auto merge of #3810 - phansch:refactor/extract_module, r=flip1995

Extract diagnostics module and document some functions

This moves the lint building functions from `utils/mod.rs` to their own
`utils/diagnostics.rs` file. Also adds documentation for three of them.

5 years agoAuto merge of #3790 - ljedrz:HirIdify_intravisit, r=phansch
bors [Sun, 24 Feb 2019 14:32:55 +0000 (14:32 +0000)]
Auto merge of #3790 - ljedrz:HirIdify_intravisit, r=phansch

partially HirIdify lints

Enables https://github.com/rust-lang/rust/pull/58232 (a part of https://github.com/rust-lang/rust/pull/57578).

5 years agofix formatting
ljedrz [Sun, 24 Feb 2019 14:16:16 +0000 (15:16 +0100)]
fix formatting

5 years agoExtract diagnostics module and document some functions
Philipp Hansch [Sun, 24 Feb 2019 13:11:05 +0000 (14:11 +0100)]
Extract diagnostics module and document some functions

This moves the lint building functions from `utils/mod.rs` to their own
`utils/diagnostics.rs` file. Also adds documentation for three of them.

5 years agoDocument some `span_lint_*` util functions
Philipp Hansch [Sun, 24 Feb 2019 08:49:17 +0000 (09:49 +0100)]
Document some `span_lint_*` util functions

5 years agoFix `useless_format` suggestions
Michael Wright [Sun, 24 Feb 2019 05:30:08 +0000 (07:30 +0200)]
Fix `useless_format` suggestions

5 years agoFix ICE #3747
Martins Polakovs [Sat, 23 Feb 2019 17:29:30 +0000 (19:29 +0200)]
Fix ICE #3747

[Martins Polakovs, John Firebaugh]

5 years agoAuto merge of #3798 - eyko:patch-1, r=flip1995
bors [Sat, 23 Feb 2019 14:50:39 +0000 (14:50 +0000)]
Auto merge of #3798 - eyko:patch-1, r=flip1995

Fix broken link in README

I noticed the link to the lint list had a typo, so this PR is just that:

```diff
- [lint list]](https://rust-lang.github.io/rust-clippy/master/index.html)
+ [lint list](https://rust-lang.github.io/rust-clippy/master/index.html)
```

5 years agoAuto merge of #3801 - Wilfred:patch-1, r=Manishearth
bors [Sat, 23 Feb 2019 00:23:56 +0000 (00:23 +0000)]
Auto merge of #3801 - Wilfred:patch-1, r=Manishearth

Fix broken markdown in README.md

5 years agoFix broken markdown in README.md
Wilfred Hughes [Sat, 23 Feb 2019 00:20:57 +0000 (00:20 +0000)]
Fix broken markdown in README.md

5 years agoFix broken link in README
Vincent Martínez [Fri, 22 Feb 2019 15:17:53 +0000 (15:17 +0000)]
Fix broken link in README

5 years agoAuto merge of #3796 - rust-lang:clarify-readme, r=oli-obk
bors [Fri, 22 Feb 2019 09:18:21 +0000 (09:18 +0000)]
Auto merge of #3796 - rust-lang:clarify-readme, r=oli-obk

Clarify lint groups in readme

I'm explicitly avoiding mention of the deprecated/restriction lint groups, those exist more for testing purposes and are not really something people should be using.

r? @oli-obk @phansch

fixes #2964

5 years agoClarify lint groups in readme
Manish Goregaokar [Fri, 22 Feb 2019 07:56:49 +0000 (13:26 +0530)]
Clarify lint groups in readme

5 years agoAuto merge of #3795 - mikerite:test-rustfmt, r=phansch
bors [Fri, 22 Feb 2019 06:54:25 +0000 (06:54 +0000)]
Auto merge of #3795 - mikerite:test-rustfmt, r=phansch

Allow rustfmt to run on more tests

5 years agorustfmt tests/ui/methods.rs
Michael Wright [Fri, 22 Feb 2019 06:05:21 +0000 (08:05 +0200)]
rustfmt tests/ui/methods.rs

5 years agoAdd `#[rustfmt::skip]` to methods tests
Michael Wright [Fri, 22 Feb 2019 05:49:17 +0000 (07:49 +0200)]
Add `#[rustfmt::skip]` to methods tests

Many people run rustfmt automatically on save. Format-dependent tests
should be marked with `#[rustfmt::skip]` to prevent accidental
reformatting from this. As a bonus the rest of the code can the formatted.

5 years agoAuto merge of #3789 - bzzzzzz:needless_range_loop_bugfix, r=oli-obk
bors [Thu, 21 Feb 2019 09:36:13 +0000 (09:36 +0000)]
Auto merge of #3789 - bzzzzzz:needless_range_loop_bugfix, r=oli-obk

Make needless_range_loop not applicable to structures without iter method

Fixes https://github.com/rust-lang/rust-clippy/issues/3788

Now we will start lint indexed structure only if it has known iter or iter_mut method implemented.

5 years agoFixed formatting and typo
bzzzz [Wed, 20 Feb 2019 18:12:24 +0000 (10:12 -0800)]
Fixed formatting and typo

5 years agoAuto merge of #3781 - uniphil:write_with_newline_false_positive, r=oli-obk
bors [Wed, 20 Feb 2019 16:37:32 +0000 (16:37 +0000)]
Auto merge of #3781 - uniphil:write_with_newline_false_positive, r=oli-obk

Don't check [print/write]_with_newline on raw strings

Some tests for #3778 and some maybe-not-the-greatest code that passes those tests!

I didn't run `fmt` because a) it doesn't seem to install on nightly for me, and b) on stable it wanted to apply formatting to over 90 files. Happy to make any tweaks though!

I suspect this contribution may require more than just tweaks. I'm still sort of new to rust so it may not be idiomatic, and the specific approach I took feels a little heavy-handed and brittle. I'm happy to make changes with some guidance, or equally happy if this gives a starting place for someone else to do it better :)

5 years agopartially HirIdify lints
ljedrz [Wed, 20 Feb 2019 10:11:11 +0000 (11:11 +0100)]
partially HirIdify lints

5 years agoAuto merge of #3779 - mikerite:fix-3704, r=phansch
bors [Wed, 20 Feb 2019 09:21:18 +0000 (09:21 +0000)]
Auto merge of #3779 - mikerite:fix-3704, r=phansch

Improve `iter_cloned_collect` suggestions

Fixes #3704

5 years agoMake needless_range_loop not applicable to structures without iter method
bzzzz [Wed, 20 Feb 2019 08:10:25 +0000 (00:10 -0800)]
Make needless_range_loop not applicable to structures without iter method

5 years agoFormat again
Michael Wright [Wed, 20 Feb 2019 04:06:00 +0000 (06:06 +0200)]
Format again

5 years agoDocument the new `Sugg` functions
flip1995 [Sat, 16 Feb 2019 21:52:20 +0000 (22:52 +0100)]
Document the new `Sugg` functions

5 years agoAdd test related to the ICE
flip1995 [Sat, 16 Feb 2019 18:37:58 +0000 (19:37 +0100)]
Add test related to the ICE

This test doesn't reproduce the ICE since it only happens, when the macro is defined in another file.
Currently we can't add tests with multiple files AFAIK

Also using the auxiliary folder didn't help

5 years agoFix ice-3719
flip1995 [Sat, 16 Feb 2019 18:35:15 +0000 (19:35 +0100)]
Fix ice-3719

5 years agoImplement Sugg::hir_with_macro_callsite
flip1995 [Sat, 16 Feb 2019 18:34:51 +0000 (19:34 +0100)]
Implement Sugg::hir_with_macro_callsite

5 years agoAuto merge of #3776 - notriddle:drop-bounds, r=oli-obk
bors [Tue, 19 Feb 2019 09:46:29 +0000 (09:46 +0000)]
Auto merge of #3776 - notriddle:drop-bounds, r=oli-obk

Add a lint to warn on `T: Drop` bounds

**What it does:** Checks for generics with `std::ops::Drop` as bounds.

**Why is this bad?** `Drop` bounds do not really accomplish anything.
A type may have compiler-generated drop glue without implementing the
`Drop` trait itself. The `Drop` trait also only has one method,
`Drop::drop`, and that function is by fiat not callable in user code.
So there is really no use case for using `Drop` in trait bounds.

**Known problems:** None.

**Example:**
```rust
fn foo<T: Drop>() {}
```

Fixes #3773

5 years agoAuto merge of #3786 - rust-lang:rustup, r=Manishearth
bors [Tue, 19 Feb 2019 07:35:44 +0000 (07:35 +0000)]
Auto merge of #3786 - rust-lang:rustup, r=Manishearth

Rustup to rustc master (32471f7ea 2019-02-19)

None

5 years agoRustup to rustc 1.34.0-nightly (32471f7ea 2019-02-19)
Manish Goregaokar [Tue, 19 Feb 2019 07:34:43 +0000 (13:04 +0530)]
Rustup to rustc 1.34.0-nightly (32471f7ea 2019-02-19)

5 years agoFormat again
Michael Wright [Tue, 19 Feb 2019 04:39:22 +0000 (06:39 +0200)]
Format again

5 years agoAdd more descriptive details
Michael Howell [Tue, 19 Feb 2019 02:37:08 +0000 (19:37 -0700)]
Add more descriptive details

5 years agoFix formatting
Michael Howell [Tue, 19 Feb 2019 02:36:58 +0000 (19:36 -0700)]
Fix formatting

5 years agoCheck {print,write}_with_newline for literal newline
phil [Mon, 18 Feb 2019 16:39:23 +0000 (11:39 -0500)]
Check {print,write}_with_newline for literal newline

Both regular strings and raw strings can contain literal newlines. This commit
extends the lint to also warn about terminating strings with these.

Behaviour handling for raw strings is also moved into `check_newlines` by
passing in the `is_raw` boolean from `check_tts` as
[suggested](https://github.com/rust-lang/rust-clippy/pull/3781#pullrequestreview-204663732)

5 years agoAuto merge of #3729 - illicitonion:match_enum_wildcard, r=flip1995
bors [Mon, 18 Feb 2019 23:59:32 +0000 (23:59 +0000)]
Auto merge of #3729 - illicitonion:match_enum_wildcard, r=flip1995

wildcard_enum_match_arm gives suggestions

And is also more robust

5 years agoFix Binding for rustc update
Daniel Wagner-Hall [Mon, 18 Feb 2019 23:16:53 +0000 (23:16 +0000)]
Fix Binding for rustc update

5 years agoRestore tests
Daniel Wagner-Hall [Mon, 18 Feb 2019 22:55:16 +0000 (22:55 +0000)]
Restore tests

Also, fix existing test

5 years agowildcard_enum_match_arm gives suggestions
Daniel Wagner-Hall [Thu, 31 Jan 2019 22:01:23 +0000 (22:01 +0000)]
wildcard_enum_match_arm gives suggestions

And is also more robust