Skip to content

Conversation

Dominic-Moser
Copy link

This lint closes #1593

This is my first lint, please let me know if I messed something up anywhere!

changelog: [always_true_conditions]: add new lint

@rustbot
Copy link
Collaborator

rustbot commented Mar 18, 2025

r? @Alexendoo

rustbot has assigned @Alexendoo.
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 18, 2025
@samueltardieu
Copy link
Member

The lintcheck results shows 64 hits, which seem to be all false positives.

@samueltardieu
Copy link
Member

@Dominic-Moser Do you plan to continue working on this lint?
@rustbot author

@rustbot rustbot added S-waiting-on-author Status: This is awaiting some action from the author. (Use `@rustbot ready` to update this status) and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties labels Apr 6, 2025
@rustbot
Copy link
Collaborator

rustbot commented Apr 6, 2025

Reminder, once the PR becomes ready for a review, use @rustbot ready.

@Dominic-Moser
Copy link
Author

@rustbot ready, sorry school's been hitting hard

@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties and removed S-waiting-on-author Status: This is awaiting some action from the author. (Use `@rustbot ready` to update this status) labels Apr 8, 2025
@Dominic-Moser
Copy link
Author

never mind, I have to to checks to make sure the same variable is being used throughout the whole expression

@rustbot

This comment has been minimized.

@rustbot

This comment has been minimized.

@rustbot rustbot added has-merge-commits PR has merge commits, merge with caution. S-waiting-on-author Status: This is awaiting some action from the author. (Use `@rustbot ready` to update this status) labels Apr 18, 2025
@rustbot

This comment has been minimized.

@Dominic-Moser
Copy link
Author

@samueltardieu I am so confused right now, I keep trying to rebase and it keeps saying I need to rebase. I am sure this is my fault but i have no clue how to fix this...
On the bright side I do actually think that the code works properly now 🫠

@rustbot

This comment has been minimized.

@rustbot rustbot removed has-merge-commits PR has merge commits, merge with caution. S-waiting-on-author Status: This is awaiting some action from the author. (Use `@rustbot ready` to update this status) labels Apr 18, 2025
@rustbot

This comment has been minimized.

@Alexendoo
Copy link
Member

Your first commit contains a lot of unrelated changes 9ce8566

What I would do is first reset your branch to the current state of master

git fetch upstream
git reset --hard upstream/master

Then grab the main parts of the PR - the lint and the test file

git checkout b55d82f89c1b29f25044aeaafbbdb7a241c82c3b -- clippy_lints/src/always_true_conditions.rs tests/ui/always_true_conditions.rs

Now you can run cargo dev update_lints, add the lint registration to clippy_lints/src/lib.rs again, and make sure tests pass. Then you can create the commit once more

@Alexendoo Alexendoo added S-waiting-on-author Status: This is awaiting some action from the author. (Use `@rustbot ready` to update this status) and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties labels Apr 20, 2025
@Dominic-Moser
Copy link
Author

@rustbot ready

@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties and removed S-waiting-on-author Status: This is awaiting some action from the author. (Use `@rustbot ready` to update this status) labels May 3, 2025
@rustbot

This comment has been minimized.

@rustbot

This comment has been minimized.

@rustbot

This comment has been minimized.

@rustbot rustbot added has-merge-commits PR has merge commits, merge with caution. S-waiting-on-author Status: This is awaiting some action from the author. (Use `@rustbot ready` to update this status) labels Sep 15, 2025
@rustbot

This comment has been minimized.

@rustbot

This comment has been minimized.

@rustbot rustbot removed S-waiting-on-author Status: This is awaiting some action from the author. (Use `@rustbot ready` to update this status) has-merge-commits PR has merge commits, merge with caution. labels Sep 15, 2025
@rustbot

This comment has been minimized.

@rustbot

This comment has been minimized.

Dominic-Moser added a commit to Dominic-Moser/rust-clippy that referenced this pull request Oct 18, 2025
This lint aims to flag a common mistake where a variable is compared against two primitives using a != operator and mistakenly linked with the || with always evaluate to true. 
ex.  ```a != 1 || a != 2```

This helps flag a common mistake and maintain overall quality of code.

changelog: new lint
@rustbot
Copy link
Collaborator

rustbot commented Oct 18, 2025

This PR was rebased onto a different master commit. Here's a range-diff highlighting what actually changed.

Rebasing is a normal part of keeping PRs up to date, so no action is needed—this note is just to help reviewers.

@rustbot

This comment has been minimized.

This lint aims to flag a common mistake where a variable is compared against two primitives using a != operator and mistakenly linked with the || with always evaluate to true. 
ex.  ```a != 1 || a != 2```

This helps flag a common mistake and maintain overall quality of code.

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

Labels

needs-fcp 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.

Always true expressions in if expressions

4 participants