3 ms·
This code compiles just fine. It doesn't do anything since immutable references are Copy, and so dropping them doesn't do anything. https://play.rust-lang.org/
by lpghatguy 7y ago
This code compiles just fine. It doesn't do anything since immutable references are Copy, and so dropping them doesn't do anything.
https://play.rust-lang.org/?version=stable&mode=debug&edition=2018&gist=f2b4935fbb248718f1f2878ee4c53409 https://play.rust-lang.org/?version=stable&mode=debug&editio...
- hathawsh 7y agoOh right, I forgot about the interaction with generics in this case. Semantically, I suppose it's creating and dropping a reference 4 times.