-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
Consider side effects when rewriting iterator behaviors #14490
base: master
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't see why this needs to be limited to checking only closure captures. Any iterator that contains a mutable reference has the same issue.
I think any iterator type containing one of the following would need to not lint:
- A mutable reference/pointer
- A reference/pointer to a non-
Freeze
type - A
PhantomData
type containing any of the previous.
92e35bf
to
4a54775
Compare
Updated. Now these will also be covered. |
This CI failure does not seem to be my problem. Any ideas? |
I've restarted it to see if it's intermittent (we'll have to fix it anyway) or not. For reference, here is the failing version. Edit: this does not look like it is intermittent. |
Thanks to #14514, the CI is working now. |
Closes #9191
Closes #14444
Closes #8055
Adds a new helper to partly check for side effects by recursively checking if the iterator type contains closures with mutable captures.
changelog: [
double_ended_iterator_last
] fix FP when iter has side effectschangelog: [
needless_collect
] fix lint not consider side effects