Skip to content

Fix if_not_else linting on macro expanded conditions#17405

Open
Gri-ffin wants to merge 1 commit into
rust-lang:masterfrom
Gri-ffin:issues/17373
Open

Fix if_not_else linting on macro expanded conditions#17405
Gri-ffin wants to merge 1 commit into
rust-lang:masterfrom
Gri-ffin:issues/17373

Conversation

@Gri-ffin

@Gri-ffin Gri-ffin commented Jul 11, 2026

Copy link
Copy Markdown
Contributor

fixes #17373

Don't try to reason about macro expanded conditions. Also pass the condition's ctxt instead of the expression's.

changelog: [if_not_else]: do not lint on macro expanded conditions.

@rustbot

rustbot commented Jul 11, 2026

Copy link
Copy Markdown
Collaborator

Thanks for the pull request. A reviewer will take a look after it receives 2 community reviews.

In the meantime, we would highly appreciate if you could try to review any of PRs waiting on community reviews.

Please see the contribution instructions for more information. Namely, in order to ensure the minimum review times lag, PR authors and assigned reviewers should ensure that the review label (S-waiting-on-review and S-waiting-on-author) stays updated, invoking these commands when appropriate:

  • @rustbot author: the review is finished, PR author should check the comments and take action accordingly
  • @rustbot review: the author is ready for a review, this PR will be queued again in the reviewer's queue

@rustbot rustbot added S-waiting-on-community-reviews Status: This is awaiting for positive reviews from the community before a maintainer is assigned. S-waiting-on-review Status: Awaiting review from the assignee but also interested parties labels Jul 11, 2026
@Gri-ffin

Copy link
Copy Markdown
Contributor Author

crates.io appears to be down..

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

Labels

S-waiting-on-community-reviews Status: This is awaiting for positive reviews from the community before a maintainer is assigned. 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.

if_not_else false positive with macro condition

2 participants