]> git.lizzy.rs Git - rust.git/log
rust.git
2 years agoAuto merge of #9093 - Jarcho:deref_ice, r=giraffate
bors [Mon, 4 Jul 2022 00:22:17 +0000 (00:22 +0000)]
Auto merge of #9093 - Jarcho:deref_ice, r=giraffate

Fix ICE in `dereference.rs`

fixes #9089
changelog: Fix ICE when dereferencing or borrowing on explicit returns from closures

2 years agoAuto merge of #9105 - Serial-ATA:lint-invalid-utf8, r=Jarcho
bors [Sun, 3 Jul 2022 20:02:38 +0000 (20:02 +0000)]
Auto merge of #9105 - Serial-ATA:lint-invalid-utf8, r=Jarcho

Add `invalid_utf8_in_unchecked`

changelog: Add [`invalid_utf8_in_unchecked`]
closes: #629

Don't know how useful of a lint this is, just saw this was a really old issue :smile:.

2 years agoAdd `invalid_utf8_in_unchecked`
Serial [Sun, 3 Jul 2022 02:24:26 +0000 (22:24 -0400)]
Add `invalid_utf8_in_unchecked`

2 years agoAuto merge of #9110 - alex-semenyuk:fix_trailling_commas, r=xFrednet
bors [Sun, 3 Jul 2022 19:33:01 +0000 (19:33 +0000)]
Auto merge of #9110 - alex-semenyuk:fix_trailling_commas, r=xFrednet

Remove trailing spaces

Closes #9108
changelog: remove trailing spaces,  which are not allowed by the JSON standard.

2 years agoFixed comment
alexey semenyuk [Sun, 3 Jul 2022 19:03:51 +0000 (19:03 +0000)]
Fixed comment

2 years agoAuto merge of #9112 - xFrednet:9088-fix-lint-versions, r=Jarcho
bors [Sun, 3 Jul 2022 18:41:54 +0000 (18:41 +0000)]
Auto merge of #9112 - xFrednet:9088-fix-lint-versions, r=Jarcho

Correct `[clippy::version]` for 1.62 lints and add note to docs

closes: https://github.com/rust-lang/rust-clippy/issues/9088

changelog: none

---

It feels weird to have such a short PR description. So, what should I add to this one... Yes, art:

```txt
 ,-----.,--.,--.
'  .--./|  |`--' ,---.  ,---.,--. ,--.
|  |    |  |,--.| .-. || .-. |\  '  /
'  '--'\|  ||  || '-' '| '-' ' \   '
 `-----'`--'`--'|  |-' |  |-'.-'  /
                `--'   `--'  `---'
```

```txt
 ,-----.,--.   ,--.,------. ,------.,--.   ,--.
'  .--./|  |   |  ||  .--. '|  .--. '\  `.'  /
|  |    |  |   |  ||  '--' ||  '--' | '.    /
'  '--'\|  '--.|  ||  | --' |  | --'    |  |
 `-----'`-----'`--'`--'     `--'        `--'
```

```txt
   _____ _      _____ _____  _______     __
  / ____| |    |_   _|  __ \|  __ \ \   / /
 | |    | |      | | | |__) | |__) \ \_/ /
 | |    | |      | | |  ___/|  ___/ \   /
 | |____| |____ _| |_| |    | |      | |
  \_____|______|_____|_|    |_|      |_|
```

2 years agoCorrect `[clippy::version]` for 1.62 lints and add note to docs
xFrednet [Sun, 3 Jul 2022 15:02:48 +0000 (17:02 +0200)]
Correct `[clippy::version]` for 1.62 lints and add note to docs

2 years agoRemove trailing spaces
alexey semenyuk [Sun, 3 Jul 2022 14:44:09 +0000 (17:44 +0300)]
Remove trailing spaces

2 years agoAuto merge of #9106 - usefulmove:master, r=flip1995
bors [Sun, 3 Jul 2022 13:10:07 +0000 (13:10 +0000)]
Auto merge of #9106 - usefulmove:master, r=flip1995

corrected README.md book link

This change corrects the book link on the Clippy Book README.md.

changelog: none

2 years agocorrected README.md book link
Duane [Sun, 3 Jul 2022 03:41:58 +0000 (20:41 -0700)]
corrected README.md book link

2 years agoFix ICE in `dereference.rs`
Jason Newcomb [Sat, 2 Jul 2022 04:59:58 +0000 (00:59 -0400)]
Fix ICE in `dereference.rs`

2 years agoAuto merge of #9087 - alex-semenyuk:fix_link, r=llogiq
bors [Fri, 1 Jul 2022 18:39:54 +0000 (18:39 +0000)]
Auto merge of #9087 - alex-semenyuk:fix_link, r=llogiq

Fix broken link

changelog: none

2 years agoFix link
alexey semenyuk [Fri, 1 Jul 2022 18:31:57 +0000 (18:31 +0000)]
Fix link

2 years agoAuto merge of #9085 - xFrednet:9081-update-format-push-version, r=Manishearth,flip1995
bors [Fri, 1 Jul 2022 16:51:34 +0000 (16:51 +0000)]
Auto merge of #9085 - xFrednet:9081-update-format-push-version, r=Manishearth,flip1995

Correct lint version for `format_push_string`

Closes #9081

changelog: none

IDK what else to say. Look I can draw an ascii penguin =D:

```
 (^v^)
<(   )>
  w w
```

2 years agoCorrect lint version for `format_push_string`
xFrednet [Fri, 1 Jul 2022 16:05:45 +0000 (18:05 +0200)]
Correct lint version for `format_push_string`

2 years agoAuto merge of #9082 - Alexendoo:let_unit_allow, r=xFrednet
bors [Fri, 1 Jul 2022 15:51:41 +0000 (15:51 +0000)]
Auto merge of #9082 - Alexendoo:let_unit_allow, r=xFrednet

Fix direct `#[allow]` attributes in `let_unit_value`

Fixes part of #9080

Not sure why it doesn't work when the lint is emitted at the statement, but switching it to the local works fine

changelog: Fix direct `#[allow]` attributes in [`let_unit_value`]

2 years agoAuto merge of #9083 - giraffate:fix_link_in_changelog, r=flip1995
bors [Fri, 1 Jul 2022 12:55:38 +0000 (12:55 +0000)]
Auto merge of #9083 - giraffate:fix_link_in_changelog, r=flip1995

Fix some links

changelog: none

2 years agoFix some links
Takayuki Nakata [Fri, 1 Jul 2022 12:30:59 +0000 (21:30 +0900)]
Fix some links

2 years agoFix allow attributes in let_unit_value
Alex Macleod [Fri, 1 Jul 2022 12:08:28 +0000 (12:08 +0000)]
Fix allow attributes in let_unit_value

2 years agoAuto merge of #9039 - Serial-ATA:dev-dogfood, r=giraffate
bors [Fri, 1 Jul 2022 01:07:25 +0000 (01:07 +0000)]
Auto merge of #9039 - Serial-ATA:dev-dogfood, r=giraffate

Add `cargo dev dogfood`

changelog: Add `cargo dev dogfood`

Part of #5394

2 years agoAuto merge of #9075 - Serial-ATA:update-docs, r=flip1995
bors [Thu, 30 Jun 2022 20:55:04 +0000 (20:55 +0000)]
Auto merge of #9075 - Serial-ATA:update-docs, r=flip1995

Add `dev deprecate` to the development basics

changelog: none

2 years agoAuto merge of #9078 - hamza1311:patch-1, r=xFrednet
bors [Thu, 30 Jun 2022 19:24:50 +0000 (19:24 +0000)]
Auto merge of #9078 - hamza1311:patch-1, r=xFrednet

Fix broken hyperlink in documentation

changelog: none

The hyperlinks in [`is_digit_ascii_radix`](https://rust-lang.github.io/rust-clippy/master/index.html#is_digit_ascii_radix)'s docs are broken. This PR fixes those.

2 years agoFix broken hyperlink
Muhammad Hamza [Thu, 30 Jun 2022 19:14:38 +0000 (00:14 +0500)]
Fix broken hyperlink

2 years agoAuto merge of #9058 - xFrednet:changelog-1-62, r=flip1995
bors [Thu, 30 Jun 2022 17:33:33 +0000 (17:33 +0000)]
Auto merge of #9058 - xFrednet:changelog-1-62, r=flip1995

Changelog for Rust 1.62 :t-rex:

This special artifact was just discovered. The artifact details changes to something called Clippy. Presently and from the context, we were unable to determine what this is supposed to be. All we know, is that it seems to have an active community around it which supports it. The members sometimes use paper clips as a secret symbol for Clippy.

I want to donate this artifact to the rust-lang organization, to have it displayed to the public.

---

changelog: none

2 years agoAdd `dev deprecate` to the development basics
Serial [Thu, 30 Jun 2022 16:45:48 +0000 (12:45 -0400)]
Add `dev deprecate` to the development basics

2 years agoAuto merge of #9074 - daxpedda:equatable-if-let-external-macro, r=Manishearth
bors [Thu, 30 Jun 2022 16:24:03 +0000 (16:24 +0000)]
Auto merge of #9074 - daxpedda:equatable-if-let-external-macro, r=Manishearth

Fix false-positive in `equatable_if_let`

Was linting in external macros. I guess now that I know about https://github.com/rust-lang/rust-clippy/pull/8694 it seems all kinda pointless until we resolve that.

Nevertheless, it's an improvement.

Fixes #9066.

changelog:`equatable_if_let` No longer lint on macros

2 years agoFix false-positive in `equatable_if_let`
dAxpeDDa [Thu, 30 Jun 2022 15:45:34 +0000 (17:45 +0200)]
Fix false-positive in `equatable_if_let`

2 years agoAuto merge of #9071 - Alexendoo:8734, r=dswij
bors [Thu, 30 Jun 2022 10:43:39 +0000 (10:43 +0000)]
Auto merge of #9071 - Alexendoo:8734, r=dswij

Uncomment test for #8734

I believe the issue was an interaction between rustfix and `span_lint_and_sugg_for_edges`, so this would've been fixed by https://github.com/rust-lang/rust/pull/98261 (Thanks, `@WaffleLapkin!)`

Closes #8734

changelog: none

2 years agoAuto merge of #9070 - flip1995:ci-fix, r=xFrednet
bors [Thu, 30 Jun 2022 10:27:24 +0000 (10:27 +0000)]
Auto merge of #9070 - flip1995:ci-fix, r=xFrednet

Make sure bors success depends on metadata_collection

r? `@xFrednet`

Currently bors runs the `metadata_collection` but merges before the run is finished, because the bors success dummy step didn't depend on it. This also makes sure that the `metadata_collection` test is run at the same time as the other base runs to not produce overhead.

changelog: none

2 years agoUncomment test for #8734
Alex Macleod [Thu, 30 Jun 2022 10:13:54 +0000 (10:13 +0000)]
Uncomment test for #8734

2 years agoMake sure bors success depends on metadata_collection
Philipp Krones [Thu, 30 Jun 2022 09:37:48 +0000 (11:37 +0200)]
Make sure bors success depends on metadata_collection

2 years agoAuto merge of #9069 - flip1995:rustup, r=flip1995
bors [Thu, 30 Jun 2022 08:32:54 +0000 (08:32 +0000)]
Auto merge of #9069 - flip1995:rustup, r=flip1995

Rustup

r? `@ghost`

changelog: none

2 years agoBump Clippy version -> 0.1.64
Philipp Krones [Thu, 30 Jun 2022 08:29:22 +0000 (10:29 +0200)]
Bump Clippy version -> 0.1.64

2 years agoBump nightly version -> 2022-06-30
Philipp Krones [Thu, 30 Jun 2022 08:28:58 +0000 (10:28 +0200)]
Bump nightly version -> 2022-06-30

2 years agoFix dogfood
Philipp Krones [Thu, 30 Jun 2022 08:28:04 +0000 (10:28 +0200)]
Fix dogfood

2 years agoMerge remote-tracking branch 'upstream/master' into rustup
Philipp Krones [Thu, 30 Jun 2022 08:27:25 +0000 (10:27 +0200)]
Merge remote-tracking branch 'upstream/master' into rustup

2 years agoAuto merge of #9068 - tamaroning:fix-typo-2022-6-30, r=giraffate,xFrednet
bors [Thu, 30 Jun 2022 06:18:19 +0000 (06:18 +0000)]
Auto merge of #9068 - tamaroning:fix-typo-2022-6-30, r=giraffate,xFrednet

fix typo in Clippy Lints page

https://rust-lang.github.io/rust-clippy/master/#significant_drop_in_scrutinee

changelog: none

2 years agoUpdate large_const_arrays.rs
tamaron [Thu, 30 Jun 2022 04:21:17 +0000 (13:21 +0900)]
Update large_const_arrays.rs

2 years agoAuto merge of #8666 - Jarcho:while_let_loop_7913, r=dswij
bors [Thu, 30 Jun 2022 04:04:08 +0000 (04:04 +0000)]
Auto merge of #8666 - Jarcho:while_let_loop_7913, r=dswij

Don't lint `while_let_loop` when significant drop order would change

fixes #7226
fixes #7913
fixes #5717

For #5717 it may not stay fully fixed. This is only completely fixed right now due to all the allowed drop impls have `#[may_dangle]` on their drop impls. This may get changed in the future based on how significant drops are determined, but the example listed with `RefCell` shouldn't break.

changelog: Don't lint `while_let_loop` when the order of significant drops would change

2 years agofix
tamaron [Thu, 30 Jun 2022 02:59:23 +0000 (11:59 +0900)]
fix

2 years agoAdd `dev dogfood` to the book
Serial [Thu, 30 Jun 2022 02:42:58 +0000 (22:42 -0400)]
Add `dev dogfood` to the book

2 years agoDon't lint `while_let_loop` when drop order would change
Jason Newcomb [Fri, 8 Apr 2022 17:21:04 +0000 (13:21 -0400)]
Don't lint `while_let_loop` when drop order would change

2 years agoExtract util functions from `redundant_pattern_match`
Jason Newcomb [Fri, 8 Apr 2022 16:55:48 +0000 (12:55 -0400)]
Extract util functions from `redundant_pattern_match`

2 years agoAuto merge of #9043 - dswij:9037-test, r=Manishearth
bors [Wed, 29 Jun 2022 15:09:37 +0000 (15:09 +0000)]
Auto merge of #9043 - dswij:9037-test, r=Manishearth

`extra_unused_lifetimes` add FP test case emitting from derived attributes.

Add test to cover for #9014 which is fixed in #9037.

changelog: [`extra_unused_lifetimes`] Add FP test case emitting from derived attributes.

---

Seeing the FP from the test:

```sh
$ git revert -m 1 1d1ae10876d3eaa5c982dd3daa083b7c2fc363b9
$ TESTNAME=extra_unused_lifetime cargo uitest
```

2 years agoAuto merge of #8981 - PrestonFrom:more_details_for_significant_drop_lint, r=flip1995
bors [Wed, 29 Jun 2022 13:23:21 +0000 (13:23 +0000)]
Auto merge of #8981 - PrestonFrom:more_details_for_significant_drop_lint, r=flip1995

Add details about how significant drop in match scrutinees can cause deadlocks

Adds more details about how a significant drop in a match scrutinee can cause a deadlock and include link to documentation.

changelog: Add more details to significant drop lint to explicitly show how temporaries in match scrutinees can cause deadlocks.

2 years agoAuto merge of #9046 - xFrednet:rust-97660-expection-something-something, r=Jarcho
bors [Tue, 28 Jun 2022 18:28:38 +0000 (18:28 +0000)]
Auto merge of #9046 - xFrednet:rust-97660-expection-something-something, r=Jarcho

Fix `#[expect]` for most clippy lints

This PR fixes most `#[expect]` - lint interactions listed in rust-lang/rust#97660. [My comment in the issue](https://github.com/rust-lang/rust/issues/97660#issuecomment-1147269504) shows the current progress (Once this is merged). I plan to work on `duplicate_mod` and `multiple_inherent_impl` and leave the rest for later. I feel like stabilizing the feature is more important than fixing the last few nits, which currently also don't work with `#[allow]`.

---

changelog: none

r? `@Jarcho`

cc: rust-lang/rust#97660

2 years agoAuto merge of #8355 - Jarcho:explicit_auto_deref_2, r=flip1995
bors [Tue, 28 Jun 2022 18:09:26 +0000 (18:09 +0000)]
Auto merge of #8355 - Jarcho:explicit_auto_deref_2, r=flip1995

Add lint `explicit_auto_deref` take 2

fixes: #234
fixes: #8367
fixes: #8380

Still things to do:

* ~~This currently only lints `&*<expr>` when it doesn't trigger `needless_borrow`.~~
* ~~This requires a borrow after a deref to trigger. So `*<expr>` changing `&&T` to `&T` won't be caught.~~
* The `deref` and `deref_mut` trait methods aren't linted.
* Neither ~~field accesses~~, nor method receivers are linted.
* ~~This probably shouldn't lint reborrowing.~~
* Full slicing to deref should probably be handled here as well. e.g. `&vec[..]` when just `&vec` would do

changelog: new lint `explicit_auto_deref`

2 years agoAuto merge of #8921 - Jarcho:merge_passes, r=llogiq
bors [Tue, 28 Jun 2022 17:24:06 +0000 (17:24 +0000)]
Auto merge of #8921 - Jarcho:merge_passes, r=llogiq

Add `Operators` lint pass

changelog: None

2 years agoMove `SelfAssignment` into `Operators` lint pass
Jason Newcomb [Wed, 1 Jun 2022 14:43:02 +0000 (10:43 -0400)]
Move `SelfAssignment` into `Operators` lint pass

2 years agoFix dogfood
Jason Newcomb [Tue, 14 Jun 2022 15:44:43 +0000 (11:44 -0400)]
Fix dogfood

2 years agoMove `PtrEq` into `Operators` lin pass
Jason Newcomb [Wed, 1 Jun 2022 14:37:37 +0000 (10:37 -0400)]
Move `PtrEq` into `Operators` lin pass

2 years agoMove `NeedlessBitwiseBool` into `Operators` lint pass
Jason Newcomb [Wed, 1 Jun 2022 14:12:26 +0000 (10:12 -0400)]
Move `NeedlessBitwiseBool` into `Operators` lint pass

2 years agoMove `ModuloArithmetic` into `Operators` lint pass
Jason Newcomb [Wed, 1 Jun 2022 13:50:33 +0000 (09:50 -0400)]
Move `ModuloArithmetic` into `Operators` lint pass

2 years agoMove some lints from `Misc` to `Operators`
Jason Newcomb [Wed, 1 Jun 2022 06:06:12 +0000 (02:06 -0400)]
Move some lints from `Misc` to `Operators`

2 years agoMove `IntegerDivision` into `Operators` lint pass
Jason Newcomb [Wed, 1 Jun 2022 05:33:06 +0000 (01:33 -0400)]
Move `IntegerDivision` into `Operators` lint pass

2 years agoMove `IdentityOp` into `Operators` lint pass
Jason Newcomb [Wed, 1 Jun 2022 05:23:57 +0000 (01:23 -0400)]
Move `IdentityOp` into `Operators` lint pass

2 years agoMove `FloatEqualityWithoutAbs` into `Operators` lint pass
Jason Newcomb [Wed, 1 Jun 2022 05:06:56 +0000 (01:06 -0400)]
Move `FloatEqualityWithoutAbs` into `Operators` lint pass

2 years agoMove `ErasingOp` into `Operators` lint pass
Jason Newcomb [Wed, 1 Jun 2022 03:47:59 +0000 (23:47 -0400)]
Move `ErasingOp` into `Operators` lint pass

2 years agoMove `EqOp` into `Operators` lint pass
Jason Newcomb [Wed, 1 Jun 2022 03:39:00 +0000 (23:39 -0400)]
Move `EqOp` into `Operators` lint pass

2 years agoMove `DurationSubsec` into `Operators` lint pass
Jason Newcomb [Wed, 1 Jun 2022 02:48:17 +0000 (22:48 -0400)]
Move `DurationSubsec` into `Operators` lint pass

2 years agoMove `DoubleComparison` into `Operators` lint pass
Jason Newcomb [Wed, 1 Jun 2022 02:32:13 +0000 (22:32 -0400)]
Move `DoubleComparison` into `Operators` lint pass

2 years agoMove `BitMask` into `Operators` lint pass
Jason Newcomb [Wed, 1 Jun 2022 02:14:43 +0000 (22:14 -0400)]
Move `BitMask` into `Operators` lint pass

2 years agoMove `AssignOps` into `Operators` lint pass
Jason Newcomb [Wed, 1 Jun 2022 01:57:32 +0000 (21:57 -0400)]
Move `AssignOps` into `Operators` lint pass

2 years agoMove `Arithmetic` into `Operators` lint pass
Jason Newcomb [Wed, 1 Jun 2022 01:27:29 +0000 (21:27 -0400)]
Move `Arithmetic` into `Operators` lint pass

2 years agoAdd `Operators` lint pass
Jason Newcomb [Tue, 31 May 2022 18:07:50 +0000 (14:07 -0400)]
Add `Operators` lint pass

2 years agoAdd `explicit_auto_deref` test for variadic function
Jason Newcomb [Mon, 13 Jun 2022 17:09:52 +0000 (13:09 -0400)]
Add `explicit_auto_deref` test for variadic function

2 years agoCode cleanup
Jason Newcomb [Mon, 7 Feb 2022 15:29:45 +0000 (10:29 -0500)]
Code cleanup

2 years agoHandle future precedence issues in `explicit_auto_deref` + cleanup
Jason Newcomb [Mon, 31 Jan 2022 07:06:18 +0000 (02:06 -0500)]
Handle future precedence issues in `explicit_auto_deref` + cleanup

2 years agoFix `needless_borrow` suggestion when calling a trait method taking `self`
Jason Newcomb [Sun, 30 Jan 2022 01:29:43 +0000 (20:29 -0500)]
Fix `needless_borrow` suggestion when calling a trait method taking `self`

2 years agoRefactor `dereference.rs`
Jason Newcomb [Sat, 29 Jan 2022 23:06:14 +0000 (18:06 -0500)]
Refactor `dereference.rs`

Merge `Position` and `AutoDerefStability`

2 years agoLint `explicit_auto_deref` immediately after `needless_borrow`
Jason Newcomb [Sat, 29 Jan 2022 14:36:46 +0000 (09:36 -0500)]
Lint `explicit_auto_deref` immediately after `needless_borrow`

2 years agoLint `explicit_auto_deref` without a leading borrow
Jason Newcomb [Fri, 28 Jan 2022 19:54:28 +0000 (14:54 -0500)]
Lint `explicit_auto_deref` without a leading borrow

2 years agoOnly check parent node once in `dereference.rs`
Jason Newcomb [Fri, 28 Jan 2022 15:56:20 +0000 (10:56 -0500)]
Only check parent node once in `dereference.rs`

2 years agoLint field accesses in `explicit_auto_deref`
Jason Newcomb [Fri, 28 Jan 2022 14:12:34 +0000 (09:12 -0500)]
Lint field accesses in `explicit_auto_deref`

2 years agoMerge different parent walking loops in `dereference.rs`
Jason Newcomb [Fri, 28 Jan 2022 01:03:50 +0000 (20:03 -0500)]
Merge different parent walking loops in `dereference.rs`

`needless_borrow` will now walk further to find the target type.

2 years agoDon't lint `explicit_auto_deref` on reborrows
Jason Newcomb [Thu, 27 Jan 2022 15:17:14 +0000 (10:17 -0500)]
Don't lint `explicit_auto_deref` on reborrows

2 years agoAdd `explicit_auto_deref` lint
Jason Newcomb [Thu, 27 Jan 2022 03:47:09 +0000 (22:47 -0500)]
Add `explicit_auto_deref` lint

2 years agoBetter support projection types when finding the signature for an expression
Jason Newcomb [Tue, 25 Jan 2022 21:26:30 +0000 (16:26 -0500)]
Better support projection types when finding the signature for an expression

2 years agoUpdate `boxed_local` expect attribute location
xFrednet [Tue, 28 Jun 2022 10:38:52 +0000 (12:38 +0200)]
Update `boxed_local` expect attribute location

2 years agoChangelog for Rust 1.62 :t-rex:
xFrednet [Mon, 27 Jun 2022 21:32:35 +0000 (23:32 +0200)]
Changelog for Rust 1.62 :t-rex:

2 years agoAuto merge of #8774 - hellow554:cargo-rust-version, r=flip1995
bors [Tue, 28 Jun 2022 07:27:08 +0000 (07:27 +0000)]
Auto merge of #8774 - hellow554:cargo-rust-version, r=flip1995

try reading rust-version from Cargo.toml

Cargo.toml can contain a field `rust-version`, that acts like a MSRV of
clippy.toml file: https://doc.rust-lang.org/cargo/reference/manifest.html#the-rust-version-field
This will try to read that field and use it, if the clippy.toml config
has no `msrv` entry

changelog: respect `rust-version` from `Cargo.toml`

closes #8746
closes #7765

2 years agoAuto merge of #8639 - Jarcho:trivially_copy_pass_by_ref_5953, r=dswij
bors [Tue, 28 Jun 2022 07:03:57 +0000 (07:03 +0000)]
Auto merge of #8639 - Jarcho:trivially_copy_pass_by_ref_5953, r=dswij

`trivially_copy_pass_by_ref` fixes

fixes #5953
fixes #2961

The fix for #5953 is overly aggressive, but the suggestion is so bad that it's worth the false negatives. Basically three things together:
* It's not obviously wrong
* It compiles
* It may actually work when tested

changelog: Don't lint `trivially_copy_pass_by_ref` when unsafe pointers are used.
changelog: Better track lifetimes when linting `trivially_copy_pass_by_ref`.

2 years agoadd uitests for cargo rust-version field
Marcel Hellwig [Tue, 10 May 2022 12:46:05 +0000 (14:46 +0200)]
add uitests for cargo rust-version field

2 years agoparse `Cargo.toml` file in ui-cargo tests
Marcel Hellwig [Mon, 27 Jun 2022 09:11:52 +0000 (11:11 +0200)]
parse `Cargo.toml` file in ui-cargo tests

compiletest_rs is not meant to test full cargo projects, but instead
only files.
So we need to parse the `Cargo.toml` file ourself and set the
corresponding environment variable. In this case we just set
`CARGO_PKG_RUST_VERSION`, nothing more. But, of course, this can be
extended.

2 years agoupdate README.md to reflect rust-version in cargo.toml
Marcel Hellwig [Tue, 10 May 2022 11:09:28 +0000 (13:09 +0200)]
update README.md to reflect rust-version in cargo.toml

2 years agotry reading rust-version from Cargo.toml
Marcel Hellwig [Mon, 2 May 2022 09:31:39 +0000 (11:31 +0200)]
try reading rust-version from Cargo.toml

Cargo.toml can contain a field `rust-version`, that acts like a MSRV of
clippy.toml file: https://doc.rust-lang.org/cargo/reference/manifest.html#the-rust-version-field
This will try to read that field and use it, if the clippy.toml config
has no `msrv` entry

2 years agoRun cargo dev fmt
Preston From [Tue, 28 Jun 2022 05:01:47 +0000 (23:01 -0600)]
Run cargo dev fmt

2 years agoMake messages more accurate, check lint enabled
Preston From [Tue, 28 Jun 2022 04:52:22 +0000 (22:52 -0600)]
Make messages more accurate, check lint enabled

2 years agoAuto merge of #9045 - alex-semenyuk:self_assignment_example, r=llogiq
bors [Mon, 27 Jun 2022 17:33:31 +0000 (17:33 +0000)]
Auto merge of #9045 - alex-semenyuk:self_assignment_example, r=llogiq

Fix example `SELF_ASSIGNMENT`

changelog: Fix example in `SELF_ASSIGNMENT` docs

2 years agoAuto merge of #8649 - ebobrow:imperative_find, r=flip1995
bors [Mon, 27 Jun 2022 17:15:25 +0000 (17:15 +0000)]
Auto merge of #8649 - ebobrow:imperative_find, r=flip1995

add [`manual_find`] lint for function return case

part of the implementation discussed in #7143

changelog: add [`manual_find`] lint for function return case

2 years agoDon't lint `trivially_copy_pass_by_ref` when unsafe pointers are used
Jason Newcomb [Wed, 6 Apr 2022 02:48:47 +0000 (22:48 -0400)]
Don't lint `trivially_copy_pass_by_ref` when unsafe pointers are used

2 years agoActually check lifetimes in `trivially_copy_pass_by_ref`
Jason Newcomb [Wed, 6 Apr 2022 01:14:42 +0000 (21:14 -0400)]
Actually check lifetimes in `trivially_copy_pass_by_ref`

2 years agoFix example `SELF_ASSIGNMENT`
alexey semenyuk [Sat, 25 Jun 2022 11:57:32 +0000 (11:57 +0000)]
Fix example `SELF_ASSIGNMENT`

2 years agoAuto merge of #8972 - kyoto7250:use_retain, r=llogiq
bors [Mon, 27 Jun 2022 13:58:26 +0000 (13:58 +0000)]
Auto merge of #8972 - kyoto7250:use_retain, r=llogiq

feat(new lint): new lint `manual_retain`

close #8097

This PR is  a new  lint implementation.
This lint checks if the `retain` method is available.

Thank you in advance.

changelog: add new ``[`manual_retain`]`` lint

2 years agoAuto merge of #8990 - tsoutsman:master, r=llogiq
bors [Mon, 27 Jun 2022 13:38:50 +0000 (13:38 +0000)]
Auto merge of #8990 - tsoutsman:master, r=llogiq

Fix `let_undescore_lock` false-positive when binding without locking

Fixes #8486.

changelog: Fix `let_undescore_lock` false-positive when binding without locking.

2 years agoFix `let_undescore_lock` false-positive when binding without locking
Klim Tsoutsman [Mon, 13 Jun 2022 03:08:50 +0000 (13:08 +1000)]
Fix `let_undescore_lock` false-positive when binding without locking

Signed-off-by: Klim Tsoutsman <klimusha@gmail.com>
2 years agoAuto merge of #9054 - alex-semenyuk:string_add_example, r=giraffate
bors [Mon, 27 Jun 2022 06:08:00 +0000 (06:08 +0000)]
Auto merge of #9054 - alex-semenyuk:string_add_example, r=giraffate

STRING_ADD example

changelog: none
STRING_ADD example, how it should be

2 years agoAuto merge of #8871 - Serial-ATA:cargo-dev-deprecate, r=giraffate
bors [Mon, 27 Jun 2022 00:32:22 +0000 (00:32 +0000)]
Auto merge of #8871 - Serial-ATA:cargo-dev-deprecate, r=giraffate

Add `cargo dev deprecate`

changelog: none

I wrote this awhile ago when `regex` was still a dependency. Is it alright to add it back?

2 years agoAuto merge of #8939 - Jarcho:transmute_ptr_to_ref_lt, r=giraffate
bors [Mon, 27 Jun 2022 00:05:50 +0000 (00:05 +0000)]
Auto merge of #8939 - Jarcho:transmute_ptr_to_ref_lt, r=giraffate

Suggest `pointer::cast` when possible in `transmute_ptr_to_ref`

fixes #8924

changelog: Suggest casting the pointer for any type containing lifetimes in `transmute_ptr_to_ref`.
changelog: Suggest `pointer::cast` when possible in `transmute_ptr_to_ref`.

2 years agocargo dev update_lints
kyoto7250 [Sun, 26 Jun 2022 23:20:30 +0000 (08:20 +0900)]
cargo dev update_lints