MAIN FEEDS
Do you want to continue?
https://www.reddit.com/r/rustjerk/comments/1x5d2lw/rust_devs_hate_this_one_simple_trick/pgltwqg/
r/rustjerk • u/CorgiApprehensive159 • Oct 14 '26
39 comments sorted by
View all comments
131
Well since you're only defining but not using, it is actually safe!
44 u/SirKastic23 Oct 14 '26 Safe and not sound! 9 u/thisiselgun Oct 14 '26 https://youtu.be/47dtFZ8CFo8 5 u/SirKastic23 Oct 14 '26 That's the song I was thinking of too! It's a classic 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.
44
Safe and not sound!
9 u/thisiselgun Oct 14 '26 https://youtu.be/47dtFZ8CFo8 5 u/SirKastic23 Oct 14 '26 That's the song I was thinking of too! It's a classic
9
https://youtu.be/47dtFZ8CFo8
5 u/SirKastic23 Oct 14 '26 That's the song I was thinking of too! It's a classic
5
That's the song I was thinking of too! It's a classic
25
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.
28
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.
16
Saved by the NLL.
View all comments
131
u/renchuwang Oct 14 '26
Well since you're only defining but not using, it is actually safe!