-
Notifications
You must be signed in to change notification settings - Fork 234
Description
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.