Skip to content

Conversation

@rbtcollins
Copy link
Contributor

Without this semicolon attempting to return an impl '_ + Iterator<...> + Clone from a generator results in an error about the temp borrow created in run_gen. The ; causes the temp to be dropped before the outer scope that owns data exits and runs its own drops.

@remi-dupre
Copy link
Owner

Hi!

Thanks for the fix!

I've been working on a refactor which uses less macros. It will make the code more maintainable and fix #15. However this PR currently removes the possibility to return borrowed data from the generator. Do you think it would be a big bummer for you?

@remi-dupre remi-dupre merged commit bb08c55 into remi-dupre:main Dec 10, 2022
@rbtcollins rbtcollins deleted the borrowed_gen_data branch December 11, 2022 06:49
@rbtcollins
Copy link
Contributor Author

Thank you for merging my fix! I've commented on #15 - it is definitely recursive; whether you can express your syntax non-recursively is a different question, but I'm sure you could do an incompatible change that would give you a non-recursive syntax with macros if needed - no worse than an incompatible change to not use macros.

On the macro vs non-macro question I have no strong opinion.

On borrowing a preference, written up in the PR you have open for that.

Thanks!

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.

2 participants