Skip to content

Make environment arguments reference-only #34

@Feliix42

Description

@Feliix42

Currently, environment values are captured as owned references and cloned, if necessary. This raises a number of issues however, ranging from required workarounds (see #29) to bugs due to the fact that ohuac does not know about these changes (see smap::smap_with_envarc_in_loop test case).

When discussing this with Justus, we agreed that enforcing the use of borrowed environment arguments would be a fine thing to do as it would make the constraints to environment arcs transparent.

Enforcing this could become quite hard however, due to the fact that we cannot typecheck a variable name handed to the macro.

It might suffices to just remove any existing workarounds and add a note to the documentation, saying that any environment values have to be borrowed?

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions