You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In the 2023 fall midterm exam, there is a true/false question "In safe Rust, a variable can be drop()ed using its &mut reference."
I think it's possible to drop the value behind &mut by using mem::replace. (-> True)
But the question asks if a variable can be dropped using &mut, which makes me think it's just asking about the signatue of drop, which takes T. (-> False)
Which interpretation is correct in this case?
The text was updated successfully, but these errors were encountered:
In the 2023 fall midterm exam, there is a true/false question "In safe Rust, a variable can be
drop()
ed using its&mut
reference."I think it's possible to drop the value behind
&mut
by usingmem::replace
. (-> True)But the question asks if a variable can be dropped using
&mut
, which makes me think it's just asking about the signatue ofdrop
, which takesT
. (-> False)Which interpretation is correct in this case?
The text was updated successfully, but these errors were encountered: