logoalt Hacker News

verdagon • today at 2:47 PM • 1 reply • view on HN

Theoretically, we can have a reference that points to two paths, a "path union" so to speak. If the user explicitly typed out the path union, it would be something like:

let my_ref &Entity in (live_list[], dead_list[]) = if ...

though it would be nicer in practice, because the compiler could infer that.

Haven't implemented it yet of course, but the data structures in the borrow checker are designed with this in mind.


Replies

eptcyka • today at 3:56 PM

Would it then be possible to mutably reference two entries in the same hashmap?

➕ show 1 reply