3

[`let_and_return`]: avoid linting when code between last stmt and return expr is...

 4 weeks ago
source link: https://github.com/rust-lang/rust-clippy/pull/12558
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.

[let_and_return]: avoid linting when code between last stmt and return expr is cfg'd out #12558

Merged

Conversation

Member

@y21 y21

commented

Mar 25, 2024

edited

Fixes #9150

This moves span_contains_cfg to utils and starts using it in let_and_return as well.

changelog: [let_and_return]: avoid linting when code between the last statement and the final return expression is #[cfg]ed out

RealKC reacted with heart emoji

Collaborator

r? @xFrednet

rustbot has assigned @xFrednet.
They will have a look at your PR within the next two weeks and either review your PR or reassign to another reviewer.

Use r? to explicitly pick a reviewer

rustbot

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

Mar 25, 2024

Member

@xFrednet xFrednet

left a comment

LGTM, thank you!

At one point, I would like some better support from rustc for stuff like this, but I'm also not quite sure how to do it better. For now, this is a solid solution.

y21 reacted with thumbs up emoji

Member

@bors r+

Collaborator

📌 Commit 9e82ad8 has been approved by xFrednet

It is now in the queue for this repository.

Collaborator

⌛ Testing commit 9e82ad8 with merge 4ef57d3...

bors

merged commit 4ef57d3 into

rust-lang:master

Mar 25, 2024

5 checks passed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

xFrednet

xFrednet approved these changes
Assignees

xFrednet

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

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

let_and_return false positive in presence of [cfg]ed out blocks

4 participants

About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK