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

make never_loop applicability more flexible #14203

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

lapla-cogito
Copy link
Contributor

@lapla-cogito lapla-cogito commented Feb 12, 2025

The applicability of never_loop is currently set to Unspecified, but if the loop block does not contain break or continue, it can be MachineApplicable.

changelog: [never_loop]: the applicability is now MachineApplicable when the loop block contains neither break nor continue

@rustbot
Copy link
Collaborator

rustbot commented Feb 12, 2025

r? @y21

rustbot has assigned @y21.
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 Feb 12, 2025
@samueltardieu
Copy link
Contributor

You should create a tests/ui/never_loop_fixable.rs to test the fixed version, which would not include //@no-rustfix (which never_loop.rs includes).

@lapla-cogito
Copy link
Contributor Author

Thanks, I've ported the test for this patch to a new file.

@lapla-cogito
Copy link
Contributor Author

Rebased to address the recent changes in error annotation.

@lapla-cogito lapla-cogito force-pushed the never_loop_app branch 4 times, most recently from 919f52b to 6082c1b Compare February 21, 2025 18:55
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.

4 participants