logoalt Hacker News

jmalickitoday at 2:43 AM2 repliesview on HN

> because it means subtle changes (introducing a destructor, re-ordering code, etc) can change semantics without you realizing it.

No, it won't change semantics - if you say @musttail or similar, it will simply fail to compile if you, say, introduce a destructor - the semantics will not subtly change.


Replies

afdbcreidtoday at 4:25 AM

Incorrect. `become` does change drop order - https://play.rust-lang.org/?version=nightly&mode=debug&editi....

show 1 reply
gpmtoday at 2:47 AM

Uh, yes, if you guarantee the semantics only when the code explicitly opts in and not by default then semantics will not subtly change, that is the point of my comment

show 1 reply