Re:Linux: Using goto In Kernel Code (2003)
by chrismorgan on Saturday July 17, 2021 @09:03AM
(#27865487)
No, not impossible at all; it will just reject any that would be memory-unsafe due to problems with borrow lengths, potentially undefined variables, and things like that. I never said you could goto absolutely anywhere; plenty of gotos are patently unsafe, and Rust would duly reject them.
Rust currently checks borrows using control-flow graphs (though I believe the plan is for that to change, and the replacement might make life harder for implementing goto, I don’t know). Rust’s mid-level intermediate representation (MIR) actually has goto. In a control-flow graph, goto is just adding new edges, and it’s comparatively simple to make it work.
Rust currently checks borrows using control-flow graphs (though I believe the plan is for that to change, and the replacement might make life harder for implementing goto, I don’t know). Rust’s mid-level intermediate representation (MIR) actually has goto. In a control-flow graph, goto is just adding new edges, and it’s comparatively simple to make it work.