r/rustjerk • • Oct 14 '26

Rust devs hate this one simple trick

Post image
409 Upvotes

39 comments sorted by

View all comments

Show parent comment

25

u/uahw Oct 14 '26

I don’t think it is. I think rust especially states that two mut references aren’t allowed to exist at the same time even if on is unused

28

u/CommonNoiter Oct 14 '26

As neither are used i don't think their lifetimes overlap so they don't both exist at the same time.

16

u/simonask_ Oct 14 '26

Saved by the NLL.