Skip to content

Invert suggestion if pointer is tested for non-nullness #15015

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

Merged
merged 1 commit into from
Jun 8, 2025

Conversation

samueltardieu
Copy link
Member

@samueltardieu samueltardieu commented Jun 8, 2025

Fixes #15010


changelog: [cmp_null]: emit proper suggestion when pointer is checked for non-nullness

@rustbot
Copy link
Collaborator

rustbot commented Jun 8, 2025

r? @llogiq

rustbot has assigned @llogiq.
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 Jun 8, 2025
@llogiq llogiq added this pull request to the merge queue Jun 8, 2025
@llogiq
Copy link
Contributor

llogiq commented Jun 8, 2025

Thank you!

Merged via the queue into rust-lang:master with commit a1a1393 Jun 8, 2025
17 of 21 checks passed
@samueltardieu samueltardieu deleted the issue-15010 branch June 8, 2025 09:35
@samueltardieu
Copy link
Member Author

We should have beta-nominated this. @flip1995 if you hear about a point release for Rust 1.88.1, we should add this one as this fixes a I-suggestion-causes-bug on a warn by default lint, this may produce code with an inverted logic.

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.

cmp_null suggests incorrect code, and --fix applies it
3 participants