]> git.lizzy.rs Git - rust.git/log
rust.git
3 years agoMerge remote-tracking branch 'upstream/master' into rustup
flip1995 [Thu, 3 Jun 2021 06:37:53 +0000 (08:37 +0200)]
Merge remote-tracking branch 'upstream/master' into rustup

3 years agoAuto merge of #7297 - flip1995:rm-cov, r=giraffate
bors [Tue, 1 Jun 2021 01:22:43 +0000 (01:22 +0000)]
Auto merge of #7297 - flip1995:rm-cov, r=giraffate

Remove util/cov.sh script

This script hasn't been working and wasn't used for years.

changelog: none

3 years agoAuto merge of #7265 - Jarcho:manual_str_repeat, r=giraffate
bors [Tue, 1 Jun 2021 00:47:05 +0000 (00:47 +0000)]
Auto merge of #7265 - Jarcho:manual_str_repeat, r=giraffate

Add lint `manual_str_repeat`

fixes: #7260

There's a similar function for slices. Should this be renamed to include it, or should that be a separate lint? If we are going to have them as one lint a better name will be needed. `manual_repeat` isn't exactly clear as it's replacing a call to `iter::repeat`.

changelog: Add new lint `manual_str_repeat`

3 years agoRemove util/cov.sh script
flip1995 [Mon, 31 May 2021 15:09:21 +0000 (17:09 +0200)]
Remove util/cov.sh script

This script hasn't been working and wasn't used for years.

3 years agoFix type checks for `manual_str_repeat`
Jason Newcomb [Sun, 23 May 2021 17:16:09 +0000 (13:16 -0400)]
Fix type checks for `manual_str_repeat`

3 years agoAdd lint `manual_str_repeat`
Jason Newcomb [Sat, 22 May 2021 21:08:17 +0000 (17:08 -0400)]
Add lint `manual_str_repeat`

3 years agoAuto merge of #7294 - stevenengler:unsafe-ptr-deref-msg, r=Manishearth
bors [Mon, 31 May 2021 00:36:46 +0000 (00:36 +0000)]
Auto merge of #7294 - stevenengler:unsafe-ptr-deref-msg, r=Manishearth

Improve message for `not_unsafe_ptr_arg_deref` lint

changelog: Improved message for the ['not_unsafe_ptr_arg_deref'] lint

Doesn't close any issue, but implements a suggestion from https://github.com/rust-lang/rust-clippy/issues/3045#issuecomment-791556803.

3 years agoUpdate message for 'not_unsafe_ptr_arg_deref' lint
Steven Engler [Mon, 31 May 2021 00:19:57 +0000 (20:19 -0400)]
Update message for 'not_unsafe_ptr_arg_deref' lint

3 years agoAuto merge of #7292 - Jarcho:suspicious_splitn, r=flip1995
bors [Sun, 30 May 2021 20:32:22 +0000 (20:32 +0000)]
Auto merge of #7292 - Jarcho:suspicious_splitn, r=flip1995

Add lint `suspicious_splitn`

fixes: #7245
changelog: Add lint `suspicious_splitn`

3 years agoEvaluate constant expressions in `suspicious_splitn`
Jason Newcomb [Sun, 30 May 2021 17:25:24 +0000 (13:25 -0400)]
Evaluate constant expressions in `suspicious_splitn`

3 years agoAdd lint `suspicious_splitn`
Jason Newcomb [Sun, 30 May 2021 13:35:06 +0000 (09:35 -0400)]
Add lint `suspicious_splitn`

3 years agoAuto merge of #7287 - Jarcho:ice_7272, r=flip1995
bors [Fri, 28 May 2021 09:22:22 +0000 (09:22 +0000)]
Auto merge of #7287 - Jarcho:ice_7272, r=flip1995

Fix ICE in `too_many_lines`

fixes: #7272
fixes: #7286

#7272 looks like it's caused by a bug in rust-c. The span it's giving for the closure is:

```rust
$crate:: $lower($d arg) }
        }
    }
}
```

The correct span would be `$crate:: $lower($d arg)` without all the closing braces.

#7286 is definitely a clippy bug

changelog: none

3 years agoFix ICE in `too_many_lines` due to wrong assumptions on braces.
Jason Newcomb [Thu, 27 May 2021 19:16:26 +0000 (15:16 -0400)]
Fix ICE in `too_many_lines` due to wrong assumptions on braces.

3 years agoAuto merge of #7285 - camsteffen:mini-macro-move, r=flip1995
bors [Thu, 27 May 2021 17:19:39 +0000 (17:19 +0000)]
Auto merge of #7285 - camsteffen:mini-macro-move, r=flip1995

Move mini-macro to tests/ui/auxilary

changelog: none

Merges `/mini-macro` into `/tests/ui/auxilary/proc_macro_derive.rs`.

The mini-macro crate is an artifact of the distant past. A lot has changed (#2284) and it doesn't make sense as a top-level crate anymore. Especially since we can use the auxilary folder to accompolish the same thing.

3 years agoMove mini-macro to auxilary
Cameron Steffen [Thu, 27 May 2021 16:03:13 +0000 (11:03 -0500)]
Move mini-macro to auxilary

3 years agoAuto merge of #7284 - camsteffen:consts-reexport, r=flip1995
bors [Thu, 27 May 2021 14:07:12 +0000 (14:07 +0000)]
Auto merge of #7284 - camsteffen:consts-reexport, r=flip1995

Remove clippy_utils::consts re-export

changelog: none

We got a straggler.

3 years agoRemove clippy_utils::consts re-export
Cameron Steffen [Thu, 27 May 2021 13:49:37 +0000 (08:49 -0500)]
Remove clippy_utils::consts re-export

3 years agoAuto merge of #7283 - flip1995:release-doc, r=giraffate
bors [Thu, 27 May 2021 13:19:35 +0000 (13:19 +0000)]
Auto merge of #7283 - flip1995:release-doc, r=giraffate

Document to only push the created tag and not everything

Inspired by https://stackoverflow.com/a/5195913

changelog: none

3 years agoDocument to only push the created tag and not everything
flip1995 [Thu, 27 May 2021 09:09:49 +0000 (11:09 +0200)]
Document to only push the created tag and not everything

3 years agoAuto merge of #7281 - camsteffen:has-doc-fp, r=flip1995
bors [Thu, 27 May 2021 08:37:08 +0000 (08:37 +0000)]
Auto merge of #7281 - camsteffen:has-doc-fp, r=flip1995

Fix missing_docs_in_private_items false negative

changelog: Fix [`missing_docs_in_private_items`] false negative when the item has any `#[name = "value"]` attribute

Closes #7247 (decided not to use the rustc method since it calls `Session::check_name`, which is for rustc only)

3 years agoAuto merge of #7282 - camsteffen:lint-stmt-expr, r=flip1995
bors [Thu, 27 May 2021 08:23:21 +0000 (08:23 +0000)]
Auto merge of #7282 - camsteffen:lint-stmt-expr, r=flip1995

Fix allow on some statement lints

changelog: Fix `#[allow(..)]` over statements for [`needless_collect`], [`short_circuit_statement`] and [`unnecessary_operation`]

Fixes #7171
Fixes #7202

3 years agoAuto merge of #7187 - camsteffen:avoid-break-exported, r=flip1995,phansch
bors [Thu, 27 May 2021 04:49:56 +0000 (04:49 +0000)]
Auto merge of #7187 - camsteffen:avoid-break-exported, r=flip1995,phansch

Add avoid_breaking_exported_api config option

changelog: Add `avoid_breaking_exported_api` config option for [`enum_variant_names`], [`large_types_passed_by_value`], [`trivially_copy_pass_by_ref`], [`unnecessary_wraps`], [`upper_case_acronyms`] and [`wrong_self_convention`].

changelog: Deprecates [`pub_enum_variant_names`] and [`wrong_pub_self_convention`] as the non-pub variants are now configurable.

changelog: Fix various false negatives for `pub` items that are not exported from the crate.

A couple changes to late passes in order to use `cx.access_levels.is_exported` rather than `item.vis.kind.is_pub`.

I'm not sure how to better document the config option or lints that are (not) affected (see comments in #6806). Suggestions are welcome. cc `@rust-lang/clippy`

I added `/clippy.toml` to use the config internally and `/tests/clippy.toml` to maintain a default config in ui tests.

Closes #6806
Closes #4504

3 years agoFix allow on some statement lints
Cameron Steffen [Thu, 27 May 2021 03:07:53 +0000 (22:07 -0500)]
Fix allow on some statement lints

3 years agoFix config file lookup
Cameron Steffen [Fri, 7 May 2021 17:07:59 +0000 (12:07 -0500)]
Fix config file lookup

3 years agoAdd deprecated lint tests
Cameron Steffen [Fri, 7 May 2021 16:19:35 +0000 (11:19 -0500)]
Add deprecated lint tests

3 years agoAuto merge of #7280 - camsteffen:macro-use, r=Manishearth
bors [Wed, 26 May 2021 22:15:07 +0000 (22:15 +0000)]
Auto merge of #7280 - camsteffen:macro-use, r=Manishearth

Add macro_use clippy_utils

changelog: none

3 years agoEat dogfood
Cameron Steffen [Fri, 7 May 2021 01:22:10 +0000 (20:22 -0500)]
Eat dogfood

3 years agoAdd clippy.toml to project and tests
Cameron Steffen [Thu, 6 May 2021 20:43:19 +0000 (15:43 -0500)]
Add clippy.toml to project and tests

3 years agoUse break api config for upper_case_acronyms
Cameron Steffen [Thu, 6 May 2021 19:42:55 +0000 (14:42 -0500)]
Use break api config for upper_case_acronyms

3 years agoUse break api config for unnecessary_wraps
Cameron Steffen [Thu, 6 May 2021 19:33:23 +0000 (14:33 -0500)]
Use break api config for unnecessary_wraps

3 years agoUse break api config for enum_variant_names
Cameron Steffen [Thu, 6 May 2021 19:02:24 +0000 (14:02 -0500)]
Use break api config for enum_variant_names

3 years agoUse break api config for pass by value or ref
Cameron Steffen [Thu, 6 May 2021 17:45:21 +0000 (12:45 -0500)]
Use break api config for pass by value or ref

3 years agoUse break api config for wrong_pub_self_convention
Cameron Steffen [Wed, 26 May 2021 21:39:39 +0000 (16:39 -0500)]
Use break api config for wrong_pub_self_convention

3 years agoAdd avoid_breaking_exported_api config option
Cameron Steffen [Thu, 6 May 2021 17:41:58 +0000 (12:41 -0500)]
Add avoid_breaking_exported_api config option

3 years agoFix missing_docs_in_private_items FP
Cameron Steffen [Wed, 26 May 2021 21:13:57 +0000 (16:13 -0500)]
Fix missing_docs_in_private_items FP

3 years agoAdd macro_use clippy_utils
Cameron Steffen [Wed, 26 May 2021 13:40:43 +0000 (08:40 -0500)]
Add macro_use clippy_utils

3 years agoAuto merge of #7256 - xFrednet:7172-trick-cargos-caching-for-collection, r=flip1995
bors [Tue, 25 May 2021 14:08:02 +0000 (14:08 +0000)]
Auto merge of #7256 - xFrednet:7172-trick-cargos-caching-for-collection, r=flip1995

Adding the ability to invalidate caches to force metadata collection

This adds the discussed hack to touch `clippy_lints/src/lib.rs` to invalidate cargos cache and force metadata collection. I've decided to use the [`filetime`](https://github.com/alexcrichton/filetime) crate instead of the touch command to make is cross-platform and just cleaner in general. Looking at the maintainers I would say that it's a save crate to use xD.

---

cc: #7172 I know this ID without looking it up now... This is not good

changelog: none

r? `@flip1995`

3 years agoAuto merge of #7268 - mbartlett21:update_semi, r=Manishearth
bors [Tue, 25 May 2021 13:53:37 +0000 (13:53 +0000)]
Auto merge of #7268 - mbartlett21:update_semi, r=Manishearth

Move `semicolon_if_nothing_returned` to `pedantic`

This moves the `semicolon_if_nothing_returned` lint to `pedantic` category.
I had done #7148, but on the master branch, and Github doesn't seem to let me change that, so here's another PR

changelog: Move [`semicolon_if_nothing_returned`] lint into `pedantic` category.

3 years agoRun `cargo fmt`
mbartlett21 [Tue, 25 May 2021 06:05:52 +0000 (06:05 +0000)]
Run `cargo fmt`

3 years agoRemove semicolons in `clippy_utils`
mbartlett21 [Tue, 25 May 2021 02:12:27 +0000 (02:12 +0000)]
Remove semicolons in `clippy_utils`

3 years agoAdd semicolon in `needless_for_each.rs`
mbartlett21 [Tue, 25 May 2021 02:06:45 +0000 (02:06 +0000)]
Add semicolon in `needless_for_each.rs`

3 years agoFix `same_item_push.rs`
mbartlett21 [Tue, 25 May 2021 02:03:31 +0000 (02:03 +0000)]
Fix `same_item_push.rs`

3 years agoAdd all the semicolons to `clippy_lints`
mbartlett21 [Tue, 25 May 2021 01:46:33 +0000 (01:46 +0000)]
Add all the semicolons to `clippy_lints`

3 years agoAdd semicolons up to `needless_for_each.rs`
mbartlett21 [Tue, 25 May 2021 00:54:50 +0000 (00:54 +0000)]
Add semicolons up to `needless_for_each.rs`

3 years agoMove `semicolon_if_nothing_returned` to `pedantic`
mbartlett21 [Mon, 24 May 2021 22:09:07 +0000 (22:09 +0000)]
Move `semicolon_if_nothing_returned` to `pedantic`

3 years agoAuto merge of #7267 - camsteffen:sphash-improvements, r=Manishearth
bors [Mon, 24 May 2021 16:18:19 +0000 (16:18 +0000)]
Auto merge of #7267 - camsteffen:sphash-improvements, r=Manishearth

Some SpanlessHash improvements

changelog: none

* Use `mem::discriminant().hash()` instead of `stable_hash` for simple enums and then use `FxHasher` instead of `StableHasher`. We don't use any StableHash features.
* Use `UnHashMap` for maps keyed by spanless hash values.

3 years agoHash Symbol directly
Cameron Steffen [Mon, 24 May 2021 15:51:33 +0000 (10:51 -0500)]
Hash Symbol directly

3 years agoFix SpanlessEq for GenericArg::Const
Cameron Steffen [Mon, 24 May 2021 15:46:45 +0000 (10:46 -0500)]
Fix SpanlessEq for GenericArg::Const

3 years agoremove cfg(bootstrap)
Pietro Albini [Thu, 6 May 2021 11:36:07 +0000 (13:36 +0200)]
remove cfg(bootstrap)

3 years agoAdd a short-circuiting case
Cameron Steffen [Mon, 17 May 2021 20:40:34 +0000 (15:40 -0500)]
Add a short-circuiting case

3 years agoUse UnhashMap
Cameron Steffen [Wed, 12 May 2021 15:50:19 +0000 (10:50 -0500)]
Use UnhashMap

3 years agoUse FxHasher
Cameron Steffen [Wed, 12 May 2021 15:15:51 +0000 (10:15 -0500)]
Use FxHasher

3 years agoUse discriminant instead of stable_hash
Cameron Steffen [Wed, 12 May 2021 15:15:28 +0000 (10:15 -0500)]
Use discriminant instead of stable_hash

3 years agoMinor SpanlessHash improvements
Cameron Steffen [Tue, 4 May 2021 15:35:54 +0000 (10:35 -0500)]
Minor SpanlessHash improvements

3 years agoAuto merge of #7266 - mikerite:20210524_sus_nursery, r=giraffate
bors [Mon, 24 May 2021 13:38:19 +0000 (13:38 +0000)]
Auto merge of #7266 - mikerite:20210524_sus_nursery, r=giraffate

Downgrade suspicious_op..._groupings to Nursery

This addresses #6722.

changelog: Downgrade [`suspicious_lint_operations`] to Nursery

3 years agoDowngrade suspicious_op..._groupings to Nursery
Michael Wright [Mon, 24 May 2021 04:42:20 +0000 (06:42 +0200)]
Downgrade suspicious_op..._groupings to Nursery

This addresses #6722.

3 years agoAuto merge of #7255 - whatisaphone:feat/similar-names-wparam-lparam, r=giraffate
bors [Mon, 24 May 2021 00:20:17 +0000 (00:20 +0000)]
Auto merge of #7255 - whatisaphone:feat/similar-names-wparam-lparam, r=giraffate

Allow wparam and lparam in similar_names

`wparam` and `lparam` are often used as generic parameter names in win32 (for example [WindowProc](https://docs.microsoft.com/en-us/previous-versions/windows/desktop/legacy/ms633573(v=vs.85))). This PR adds them to the similar_names exception list.

changelog: [`similar_names`] don't treat wparam and lparam as similar

3 years agoAuto merge of #7264 - yotamofek:from_iter_instead_collect_as_trait, r=llogiq
bors [Sat, 22 May 2021 23:08:51 +0000 (23:08 +0000)]
Auto merge of #7264 - yotamofek:from_iter_instead_collect_as_trait, r=llogiq

Fix invalid syntax in `from_iter_instead_of_collect` suggestion

First attempt at contributing, hopefully this is a good start and can be improved. :)

fixes #7259

changelog: [`from_iter_instead_of_collect`] fix invalid suggestion involving "as Trait"

3 years agoAuto merge of #7263 - Jarcho:redundant_closure_macro, r=llogiq
bors [Sat, 22 May 2021 21:41:08 +0000 (21:41 +0000)]
Auto merge of #7263 - Jarcho:redundant_closure_macro, r=llogiq

Fix `redundant_closure` for `vec![]` macro in a closure with arguments

fixes: #7224
changelog: Fix `redundant_closure` for `vec![]` macro in a closure with arguments

3 years agoFix invalid syntax in `from_iter_instead_of_collect` suggestion with "as Trait"
Yotam Ofek [Sat, 22 May 2021 18:47:11 +0000 (21:47 +0300)]
Fix invalid syntax in `from_iter_instead_of_collect` suggestion with "as Trait"

3 years agoFix `redundant_closure` for `vec![]` macro in a closure with arguments
Jason Newcomb [Fri, 21 May 2021 19:42:57 +0000 (15:42 -0400)]
Fix `redundant_closure` for `vec![]` macro in a closure with arguments

3 years agoAuto merge of #7254 - Jarcho:needless_borrow_2, r=Manishearth
bors [Fri, 21 May 2021 17:56:43 +0000 (17:56 +0000)]
Auto merge of #7254 - Jarcho:needless_borrow_2, r=Manishearth

Move `needless_borrow` to style

fixes: #3742

#7105 should be merged first to fix the false positive.

changelog: move `needless_borrow` from `nursery` to `style`

3 years agoMove `needless_borrow` to style
Jason Newcomb [Wed, 19 May 2021 20:27:06 +0000 (16:27 -0400)]
Move `needless_borrow` to style

3 years agoAuto merge of #7105 - Jarcho:needless_borrow_pat, r=camsteffen
bors [Fri, 21 May 2021 14:53:04 +0000 (14:53 +0000)]
Auto merge of #7105 - Jarcho:needless_borrow_pat, r=camsteffen

fix `needless_borrow` suggestion

fixes: #2610

While I'm working on this, should needless_borrow be split into two? One lint for expressions and another for patterns. In expression it only lints when the compiler inserts a dereference, but for patterns it's whenever a double reference is created. I think at least the case where a double reference is needed should be split into a new lint as it's not 'needless', it can just be done without a ref binding.

For illustration:

```rust
fn foo(x: &&str) {}

match Some("test") {
    // ref binding is useless here
    Some(ref x) => *x,
    _ => (),
}

match Some("test") {
    // ref binding is useless here
    Some(ref x) => x.len(),
    _ => (),
}

match Some("test") {
    // double reference is needed, but could be `Some(x) => foo(&x)`
    Some(ref x) => foo(x),
    _ => (),
}
```

changelog: Improve the suggestion for `needless_borrow` in patterns to change all usage sites as needed.
changelog: Add lint `ref_binding_to_reference`

3 years agoAuto merge of #7258 - YohDeadfall:update-copyrights, r=Manishearth
bors [Fri, 21 May 2021 00:37:00 +0000 (00:37 +0000)]
Auto merge of #7258 - YohDeadfall:update-copyrights, r=Manishearth

Updated years in copyrigths

This PR just updates years in copyrights, nothing more.

changelog: none

3 years agoUpdated years in copyrigths
Yoh Deadfall [Thu, 20 May 2021 21:09:27 +0000 (23:09 +0200)]
Updated years in copyrigths

3 years agoAdding the ability to invalidate caches to force metadata collection
xFrednet [Thu, 20 May 2021 20:29:09 +0000 (22:29 +0200)]
Adding the ability to invalidate caches to force metadata collection

3 years agoAllow wparam and lparam in similar_names
John Simon [Thu, 20 May 2021 14:12:54 +0000 (10:12 -0400)]
Allow wparam and lparam in similar_names

3 years agoImprove `needless_borrow` lint
Jason Newcomb [Sun, 18 Apr 2021 00:35:39 +0000 (20:35 -0400)]
Improve `needless_borrow` lint
Suggest changing usages of ref bindings to match the new type
Split out some cases into new lint `ref_binding_to_reference`

3 years agoRemove fix for rustc bug from `needless_borrow`
Jason Newcomb [Sun, 18 Apr 2021 00:46:13 +0000 (20:46 -0400)]
Remove fix for rustc bug from `needless_borrow`
The spans given for derived traits used to not indicate they were from a macro expansion.

3 years agoAuto merge of #7253 - flip1995:shrink-monster, r=xFrednet
bors [Thu, 20 May 2021 12:32:06 +0000 (12:32 +0000)]
Auto merge of #7253 - flip1995:shrink-monster, r=xFrednet

Early return from LintPass registration when collecting metadata

This speeds up the metadata collection by 2-2.5x on my machine. During
metadata collection other lint passes don't have to be registered, only
the lints themselves.

cc #7172

r? `@xFrednet`

changelog: none

3 years agoEarly return from LintPass registration when collecting metadata
flip1995 [Thu, 20 May 2021 11:57:52 +0000 (13:57 +0200)]
Early return from LintPass registration when collecting metadata

This speeds up the metadata collection by 2-2.5x on my machine. During
metadata collection other lint passes don't have to be registered, only
the lints themselves.

3 years agoMerge commit '9e3cd88718cd1912a515d26dbd9c4019fd5a9577' into clippyup
flip1995 [Thu, 20 May 2021 10:30:31 +0000 (12:30 +0200)]
Merge commit '9e3cd88718cd1912a515d26dbd9c4019fd5a9577' into clippyup

3 years agoAuto merge of #7252 - flip1995:rustup, r=flip1995
bors [Thu, 20 May 2021 10:07:36 +0000 (10:07 +0000)]
Auto merge of #7252 - flip1995:rustup, r=flip1995

Rustup

r? `@ghost`

cc `@xFrednet` There was a change to the `rustc_span::FileName` removing the `Display` impl for it. I adapted the metadata collector to compile with that change. I'm not sure if I changed the behavior with this. The path to the string is now printed relative to the `clippy_lints` dir. So for example `src/swap.rs`. I think this should be fine, but probably something to be aware of.

changelog: none

3 years agoBump nightly version -> 2021-05-20
flip1995 [Thu, 20 May 2021 10:06:22 +0000 (12:06 +0200)]
Bump nightly version -> 2021-05-20

3 years agoMerge remote-tracking branch 'upstream/master' into rustup
flip1995 [Thu, 20 May 2021 09:59:34 +0000 (11:59 +0200)]
Merge remote-tracking branch 'upstream/master' into rustup

3 years agoAuto merge of #7246 - xFrednet:7172-add-lint-level-to-output, r=flip1995
bors [Wed, 19 May 2021 15:23:58 +0000 (15:23 +0000)]
Auto merge of #7246 - xFrednet:7172-add-lint-level-to-output, r=flip1995

Adding the default lint level to the metadata collection

I noticed while working on the website adaption that the lint groups still had the `clippy::` prefix in the JSON output. This PR removes this prefix and adds a `level` field to each lint and with that simplifies the website display and saves performance.

The deprecated lints get are assigned to the level `none`. This is a bit different in comparison to the current lint list, but I believe that this will look better overall. Unless there is any argument against this :).

That's it just a small baby PR in comparison to the original monster ^^

---

See: #7172 for the full metadata collection to-do list or to suggest a new feature in connection to it.

---

changelog: none

r? `@flip1995`

3 years agoFixed a type
Fridtjof Stoldt [Wed, 19 May 2021 15:23:33 +0000 (17:23 +0200)]
Fixed a type

Co-authored-by: Philipp Krones <hello@philkrones.com>
3 years agoAdding the default lint level to the metadata collection
xFrednet [Wed, 19 May 2021 14:32:09 +0000 (16:32 +0200)]
Adding the default lint level to the metadata collection

And stripping the clippy:: prefix from the group

3 years agoAuto merge of #84767 - scottmcm:try_trait_actual, r=lcnr
bors [Tue, 18 May 2021 20:50:01 +0000 (20:50 +0000)]
Auto merge of #84767 - scottmcm:try_trait_actual, r=lcnr

Implement the new desugaring from `try_trait_v2`

~~Currently blocked on https://github.com/rust-lang/rust/issues/84782, which has a PR in https://github.com/rust-lang/rust/pull/84811~~ Rebased atop that fix.

`try_trait_v2` tracking issue: https://github.com/rust-lang/rust/issues/84277

Unfortunately this is already touching a ton of things, so if you have suggestions for good ways to split it up, I'd be happy to hear them.  (The combination between the use in the library, the compiler changes, the corresponding diagnostic differences, even MIR tests mean that I don't really have a great plan for it other than trying to have decently-readable commits.

r? `@ghost`

~~(This probably shouldn't go in during the last week before the fork anyway.)~~ Fork happened.

3 years agoAuto merge of #7089 - Jarcho:multiple_impls_generic, r=Jarcho
bors [Tue, 18 May 2021 16:35:48 +0000 (16:35 +0000)]
Auto merge of #7089 - Jarcho:multiple_impls_generic, r=Jarcho

Don't lint `multiple_inherent_impl` with generic arguments

fixes: #5772
changelog: Treat different generic arguments as different types in `multiple_inherent_impl`

3 years agoImprove `multiple_inherent_impl` lint
Jason Newcomb [Thu, 15 Apr 2021 16:20:43 +0000 (12:20 -0400)]
Improve `multiple_inherent_impl` lint
Treat different generic arguments as different types.
Allow the lint to be ignored on the type definition, or any impl blocks.

3 years agoAuto merge of #7242 - Jarcho:implicit_return_ice, r=flip1995
bors [Tue, 18 May 2021 15:40:17 +0000 (15:40 +0000)]
Auto merge of #7242 - Jarcho:implicit_return_ice, r=flip1995

Fix ICE in `implicit_return`

fixes: #7231

changelog: Fix ICE in `implicit_return` for async functions

3 years agoFix ICE in `implicit_return`
Jason Newcomb [Tue, 18 May 2021 14:51:59 +0000 (10:51 -0400)]
Fix ICE in `implicit_return`
async functions always return a value

3 years agoAuto merge of #7241 - flip1995:warn-deny-warnings, r=camsteffen
bors [Tue, 18 May 2021 13:31:18 +0000 (13:31 +0000)]
Auto merge of #7241 - flip1995:warn-deny-warnings, r=camsteffen

Deny warnings in every main sub-crate

Pointed out by `@xFrednet` in https://github.com/rust-lang/rust-clippy/pull/7229#issuecomment-842978909

This enables the same (rustc) lints in every main sub-crate:

- `clippy`
- `clippy_lints`
- `clippy_utils`
- `clippy_dev`

In addition it forwards the `deny-warnings` feature to those sub-crates, so we don't miss warnings that then become a problem during sync. (I wanted to fix that before, but forgot about it, so thanks for pointing it out `@xFrednet!)`

changelog: none

3 years agoFix fallout from not ignoring warnings anymore
flip1995 [Tue, 18 May 2021 09:08:19 +0000 (11:08 +0200)]
Fix fallout from not ignoring warnings anymore

3 years agoDeny warning in every main sub-crate
flip1995 [Tue, 18 May 2021 09:01:00 +0000 (11:01 +0200)]
Deny warning in every main sub-crate

This enables the same warnings that are enabled in `clippy_lints` also
in `clippy_utils` and `clippy_dev`. Then it makes sure, that the
`deny-warnings` feature is passed down to `clippy_lints` and
`clippy_utils` when compiling Clippy.

3 years agoAuto merge of #7240 - flip1995:rollup-6nwjgyp, r=flip1995
bors [Tue, 18 May 2021 08:24:04 +0000 (08:24 +0000)]
Auto merge of #7240 - flip1995:rollup-6nwjgyp, r=flip1995

Rollup of 3 pull requests

Successful merges:

 - #7235 (Fix another manual_unwrap_or deref FP)
 - #7237 (Add the command to add upstream remote)
 - #7239 (CI: update rustup before installing the toolchain on windows)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup

changelog: rollup

3 years agoRollup merge of #7239 - flip1995:ci-windows-rustup, r=flip1995
Philipp Krones [Tue, 18 May 2021 08:21:56 +0000 (10:21 +0200)]
Rollup merge of #7239 - flip1995:ci-windows-rustup, r=flip1995

CI: update rustup before installing the toolchain on windows

Ok, fine windows, if this is what you want, take it...

r? `@ghost`

changelog: none

3 years agoRollup merge of #7237 - hi-rustin:rustin-patch-command, r=flip1995
Philipp Krones [Tue, 18 May 2021 08:21:55 +0000 (10:21 +0200)]
Rollup merge of #7237 - hi-rustin:rustin-patch-command, r=flip1995

Add the command to add upstream remote

changelog: none

Adding this command should better help new contributors.

3 years agoRollup merge of #7235 - camsteffen:manual-unwrap-or-deref, r=flip1995
Philipp Krones [Tue, 18 May 2021 08:21:55 +0000 (10:21 +0200)]
Rollup merge of #7235 - camsteffen:manual-unwrap-or-deref, r=flip1995

Fix another manual_unwrap_or deref FP

changelog: none (since this just piggybacks on #7233)

Fixes #6960

3 years agoCI: update rustup before installing the toolchain on windows
flip1995 [Tue, 18 May 2021 08:03:36 +0000 (10:03 +0200)]
CI: update rustup before installing the toolchain on windows

3 years agoAuto merge of #7201 - mucinoab:master, r=giraffate
bors [Tue, 18 May 2021 05:28:42 +0000 (05:28 +0000)]
Auto merge of #7201 - mucinoab:master, r=giraffate

Remove powi, "square can be computed more efficiently"

powi(2) produces exactly the same native code as x * x
powi was part of the [`suboptimal_flops`] lint

fixes #7058
changelog: Remove powi [`suboptimal_flops`], "square can be computed more efficiently"

3 years agoAdd the command to add upstream remote
hi-rustin [Tue, 18 May 2021 03:47:53 +0000 (11:47 +0800)]
Add the command to add upstream remote

3 years agoRemove powi, "square can be computed more efficiently"
Bruno A. Muciño [Tue, 18 May 2021 02:59:08 +0000 (21:59 -0500)]
Remove powi, "square can be computed more efficiently"

powi(2) produces exactly the same native code as x * x

3 years agoAuto merge of #7234 - camsteffen:if-let-else-braces, r=flip1995
bors [Mon, 17 May 2021 21:42:21 +0000 (21:42 +0000)]
Auto merge of #7234 - camsteffen:if-let-else-braces, r=flip1995

Remove dead code after #7216

changelog: none

3 years agoFix manual_unwrap_or FP deref reference
Cameron Steffen [Mon, 17 May 2021 19:20:26 +0000 (14:20 -0500)]
Fix manual_unwrap_or FP deref reference

3 years agoRemove dead code after not linting else if let
Cameron Steffen [Mon, 17 May 2021 19:02:42 +0000 (14:02 -0500)]
Remove dead code after not linting else if let

3 years agoAuto merge of #7133 - arya-k:master, r=llogiq
bors [Mon, 17 May 2021 18:57:14 +0000 (18:57 +0000)]
Auto merge of #7133 - arya-k:master, r=llogiq

Add `needless_bitwise_bool` lint

fixes #6827
fixes #1594

changelog: Add ``[`needless_bitwise_bool`]`` lint

Creates a new `bitwise_bool` lint to convert `x & y` to `x && y` when both `x` and `y` are booleans. I also had to adjust thh `needless_bool` lint slightly, and fix a couple failing dogfood tests. I made it a correctness lint as per flip1995's comment [here](https://github.com/rust-lang/rust-clippy/pull/3385#issuecomment-434715723), from a previous WIP attempt at this lint.

3 years agoSimplify manual_unwrap_or
Cameron Steffen [Sun, 16 May 2021 22:40:29 +0000 (17:40 -0500)]
Simplify manual_unwrap_or