Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Merged
merged 1 commit into from Mar 25, 2024

Conversation

y21
Copy link
Member

@y21 y21 commented Mar 25, 2024

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

@rustbot
Copy link
Collaborator

rustbot commented Mar 25, 2024

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 rustbot added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties label Mar 25, 2024
Copy link
Member

@xFrednet xFrednet left a comment

Choose a reason for hiding this comment

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

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.

@xFrednet
Copy link
Member

@bors r+

@bors
Copy link
Collaborator

bors commented Mar 25, 2024

📌 Commit 9e82ad8 has been approved by xFrednet

It is now in the queue for this repository.

@bors
Copy link
Collaborator

bors commented Mar 25, 2024

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

@bors
Copy link
Collaborator

bors commented Mar 25, 2024

☀️ Test successful - checks-action_dev_test, checks-action_remark_test, checks-action_test
Approved by: xFrednet
Pushing 4ef57d3 to master...

@bors 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
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.

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