Prevent jinja macros to move variables

This commit is contained in:
Guillaume Gomez 2024-07-01 18:04:51 +02:00
parent eb419049bf
commit 6be20d5782

View File

@ -687,6 +687,9 @@ impl<'a> Generator<'a> {
names.write(arg);
values.write("(");
if !is_copyable(expr) {
values.write("&");
}
values.write(self.visit_expr_root(ctx, expr)?);
values.write(")");
self.locals.insert_with_default(Cow::Borrowed(arg));