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
A statement of the form let _ = <place> has no effect (modulo Deref coersion) as the place is not moved from. This should instead be omited (if all Deref coersion is pure) or otherwise written to be more clear on intent (explicitly calling side-effectful Deref).
50% of people had the wrong intuition of behavior here, so this definitely would help avoid potentially misleading code.
The text was updated successfully, but these errors were encountered:
let _ = $expr is perfectly fine for an expr that has an effect (e.g. calls a method). It's specifically "path expressions" that are problematic, as they lead to a no-op (modulo deref coersions) statement.
As featured in this Twitter poll.
A statement of the form
let _ = <place>
has no effect (modulo Deref coersion) as the place is not moved from. This should instead be omited (if all Deref coersion is pure) or otherwise written to be more clear on intent (explicitly calling side-effectful Deref).50% of people had the wrong intuition of behavior here, so this definitely would help avoid potentially misleading code.
The text was updated successfully, but these errors were encountered: