It will in today’s rust, but in 1.31, it will be accepted, thanks to “non-lexical lifetimes.” If you add another println to the bottom, it will fail again.
-
This Tweet is unavailable.
-
-
This Tweet is unavailable.
-
This Tweet is unavailable.
-
Replying to @BigBobGardner @rustlang
I don't have further reading on hand unfortunately but my understanding of non-lexical lifetimes (NLL) is that, without them, the lifetime of a borrow is until the end of the scope. With NLL the lifetime of a borrow is until it's last use...
1 reply 0 retweets 0 likes -
... so the rule "one write or multiple reads" is still in place; NLL just means that the read borrow is released before declaring the write borrow. A second use of the read borrow after the write causes an error because it's lifetime now overlaps the write borrow.
1 reply 0 retweets 1 like
Replying to @DanielDynisious @BigBobGardner
Yes, that’s correct, thanks!
2:49 PM - 27 Sep 2018
0 replies
0 retweets
0 likes
Loading seems to be taking a while.
Twitter may be over capacity or experiencing a momentary hiccup. Try again or visit Twitter Status for more information.