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

Fixes loop generation when accessing field #500

Merged
merged 2 commits into from
Jun 23, 2021
Merged

Fixes loop generation when accessing field #500

merged 2 commits into from
Jun 23, 2021

Conversation

vallentin
Copy link
Collaborator

@vallentin vallentin commented Jun 23, 2021

Fixes #494

Straightforward to fix, added a case when iter is a Expr::Attr, so it borrows the field.

Added a few tests, to assert it works regardless if the inner type is Vec<_> or &[_]. I also added a case for Range, though since Range is not Copy then it requires .clone(), so it was added more to ensure that continues to work.

Not a big fan of the naming of the tests and structs.

@vallentin vallentin requested a review from djc June 23, 2021 16:29
Copy link
Owner

@djc djc left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, this is great!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

move occurs because item1.list2 has type Vec<Box<dyn MyTrait + Send>>, which does not implement the Copy trait
2 participants