On 10-08-30 08:43 PM, ori bar wrote:
I've just uploaded an implementation of break to tohava/rust. This
implementation only implements break for while-loops. While I think
this implementation is mostly complete, I am not sure how it should
interact with typestate. If anyone cares to explain (admittedly I
don't know the typestate code very good, I only know the basic idea of
using check() to make sure a predicate is true and being able to know
in compile-time it's true afterwards) how break interacts with the
typestate mechanism it would be very helpful.

The typestate interaction is that 'break' causes an edge to be added to the control flow graph in the typestate calculator from the point of the break to the end of the loop. Similarly 'continue' adds an edge back to the loop header. Wiring these in is a matter of adding some cases to the graph_special_block_structure_building_visitor in typestate.ml.

I'll do this if you prefer to leave it where you've already taken it. The work you have here is definitely the hard part, thanks!

-Graydon
_______________________________________________
Rust-dev mailing list
[email protected]
https://mail.mozilla.org/listinfo/rust-dev

Reply via email to