Comment

Comment by Hugsun

The quote betrays a slight misunderstanding of non lexical lifetimes. The two borrows happen in separate implicit scopes. The first borrow is only valid until the second borrow is made. At that point it's dropped. So the two mutable references can't exist at the same time.

A refactor that breaks this ordering results in code that obviously shouldn't work in the eyes of any non-beginner rust programmer.

parent Hugsun 2 years ago

Discussion

Live from the official Hacker News API

A modern reader for Hacker News · SvelteKit + Skeleton