Box sometimes forgets to drop its allocator when the Box is conditionally initialized. #131082
Labels
A-box
Area: Our favorite opsem complication
A-MIR
Area: Mid-level IR (MIR) - https://blog.rust-lang.org/2016/04/19/MIR.html
C-bug
Category: This is a bug.
T-compiler
Relevant to the compiler team, which will review and decide on the PR/issue.
I tried this code:
I expected the program to output:
Instead it output:
Seems like there's something wrong with the drop flags.
Making
HasDrop
not implementDrop
causes the program to behave as expected.Meta
Reproducible on the playground with version
1.83.0-nightly (2024-09-30 fb4aebddd18d258046dd)
The text was updated successfully, but these errors were encountered: