Skip to content

lint nested patterns and slice patterns in needless_borrowed_reference#9573

Merged
bors merged 1 commit intorust-lang:masterfrom
Alexendoo:needless-borrowed-ref-slice
Oct 2, 2022
Merged

lint nested patterns and slice patterns in needless_borrowed_reference#9573
bors merged 1 commit intorust-lang:masterfrom
Alexendoo:needless-borrowed-ref-slice

Conversation

@Alexendoo
Copy link
Member

Now lints in positions other than top level, e.g. Some(&ref a). Or patterns are excluded as that can cause issues

Slice patterns of refs are now linted, e.g. &[ref a, ref b]. An easy one to walk into as you might expect that to match against a slice you should use &[], then to get around a cannot move out of type [T] error you apply a ref

changelog: [needless_borrowed_reference]: lint nested patterns and slice patterns

@rust-highfive
Copy link

r? @dswij

(rust-highfive has picked a reviewer for you, use r? to override)

@rust-highfive rust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties label Oct 1, 2022
@Alexendoo Alexendoo force-pushed the needless-borrowed-ref-slice branch from 65eb0ca to 52a68dc Compare October 1, 2022 22:31
Copy link
Member

@dswij dswij left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thanks for this!

@dswij
Copy link
Member

dswij commented Oct 2, 2022

@bors r+

@bors
Copy link
Contributor

bors commented Oct 2, 2022

📌 Commit 52a68dc has been approved by dswij

It is now in the queue for this repository.

@bors
Copy link
Contributor

bors commented Oct 2, 2022

⌛ Testing commit 52a68dc with merge 5d837b5...

@bors
Copy link
Contributor

bors commented Oct 2, 2022

☀️ Test successful - checks-action_dev_test, checks-action_remark_test, checks-action_test
Approved by: dswij
Pushing 5d837b5 to master...

@bors bors merged commit 5d837b5 into rust-lang:master Oct 2, 2022
@Alexendoo Alexendoo deleted the needless-borrowed-ref-slice branch October 2, 2022 11:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

S-waiting-on-review Status: Awaiting review from the assignee but also interested parties

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants