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

[DONT MERGE] Always take reference when accessing value passed as argument to a macro #714

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

msrd0
Copy link
Contributor

@msrd0 msrd0 commented Aug 6, 2022

This was proposed by @djc to fix #708 - but just blindly taking references does not seem to work

@djc
Copy link
Owner

djc commented Aug 9, 2022

Sorry, I don't have much time for this so if you want more help can you comment here with some of the generated code and point out where/why the problem happens?

@msrd0
Copy link
Contributor Author

msrd0 commented Aug 9, 2022

It fails because it cannot compare &str with str (i.e. when the macro argument was already a borrowed string, it becomes a double borrow which cannot be compared to a literal anymore). You can see it in the CI here: https://github.com/djc/askama/runs/7705017639?check_suite_focus=true

@Kijewski Kijewski marked this pull request as draft August 10, 2022 05:29
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.

Iterating over elements of an iterator inside a macro moves the inner collection
2 participants