logoalt Hacker News

user142 • today at 2:10 PM • 1 reply • view on HN

I noticed that there is no control flow in the examples.


Replies

verdagon • today at 2:20 PM

Next article =) How the borrow checker handles ifs and loops is a pretty fun topic. If-statements work like you'd expect (invalidations from both branches are merged). Loops is where it gets weird: we have to scout all the invalidations that happen inside the loop and then "replay" them _before_ the body of the loop. I can explain it more if you'd like.

➕ show 1 reply