Detect unconditional recursion in Drop #50049
Labels
A-destructors
Area: Destructors (`Drop`, …)
A-lint
Area: Lints (warnings about flaws in source code) such as unused_mut.
C-bug
Category: This is a bug.
T-compiler
Relevant to the compiler team, which will review and decide on the PR/issue.
If you instantiate the same struct in the Drop function, the program will loop indefinitely and crash.
The Code
Well, I expected the compiler to catch this at compilation. So this could be an area of improvement.
Here is another variation that also causes a stackoverflow without intializing the same variable
The error message at execution
The text was updated successfully, but these errors were encountered: