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
Indeed good catch, CheckLifetimes is currently ignoring types that don't have a destructor for liveness analysis. The rationale is that there is no codegen need to know whether something is alive, and the parser does various simplifications for trivial types. As you mention, codegen isn't all that matters though.
The solution here is to tighten up checklifetimes thing to work on actually-trivial types and not just destructor-less things. The parser should also reject the transfer operator on trivial types.
Bug description
I expect the following code to raise compile time error:
However, it compiles successfully.
If I uncomment the
__del__
method, then it shows:I would have expected moving a location should not be dependent on definition of a destructor.
Steps to reproduce
Compile with the above code.
System information
The text was updated successfully, but these errors were encountered: