Skip to content

R1CS: Closure of challenge phase is Fn. #244

Closed
@rubdos

Description

@rubdos

Since #222, one writes the challenge phase using a closure. This closure gets stored in a Vec<Box<Fn(...)>>, and then gets called once at the start of the second phase.

Ideally, this closure should be FnOnce, such that it's able to consume some of its context (e.g. a set of variables could be consumed instead of borrowed).

Note that it is currently impossible to call a Box<FnOnce>, because it would call a method with unsized self. Cfr. rust-lang/rust#28796

Nightly does support FnBox(), which is a temporary workaround. The above issue is discussion deprecation of FnBox() in favour of the unsized_locals feature (which makes Box<FnOnce> callable).


Note that there does not seem to be a fix for stable Rust, but I thought this should be noted somewhere. I'm not sure whether you are in favour of keeping this issue open while waiting for unsized_locals stabilization.

Metadata

Metadata

Assignees

No one assigned

    Labels

    E-easyP-lowT-apiChange to the APIT-r1csRelated to constraint system

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions